当前位置: 首页>>代码示例>>Python>>正文


Python omero_model_ImageI.ImageI类代码示例

本文整理汇总了Python中omero_model_ImageI.ImageI的典型用法代码示例。如果您正苦于以下问题:Python ImageI类的具体用法?Python ImageI怎么用?Python ImageI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ImageI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testUnloadedCtor

 def testUnloadedCtor(self):
     img = ImageI(rlong(1), False)
     assert not img.isLoaded()
     try:
         assert img.sizeOfDatasetLinks() < 0
         assert False, "Should throw"
     except:
         # Is true, but can't test it.
         pass
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:9,代码来源:test_model.py

示例2: testIterators

 def testIterators(self):
     d = DatasetI()
     image = ImageI()
     image.linkDataset(d)
     it = image.iterateDatasetLinks()
     count = 0
     for i in it:
         count += 1
     assert count == 1
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:9,代码来源:test_model.py

示例3: testUnloadedCtor

 def testUnloadedCtor(self):
     img = ImageI(rlong(1),False)
     self.assert_( not img.isLoaded() )
     try:
         self.assert_( img.sizeOfDatasetLinks() < 0 )
         self.fail("Should throw")
     except:
         # Is true, but can't test it.
         pass
开发者ID:DirkHaehnel,项目名称:openmicroscopy,代码行数:9,代码来源:t_model.py

示例4: testGetAttrGood

 def testGetAttrGood(self):
     i = ImageI()
     assert i.loaded
     assert i.isLoaded()
     assert not i.name
     i.name = rstring("name")
     assert i.name
     i.setName(None)
     assert not i.getName()
     i.copyAnnotationLinks()
     i.linkAnnotation(omero.model.BooleanAnnotationI())
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:11,代码来源:test_model.py

示例5: testClearSet

 def testClearSet(self):
     img = ImageI()
     assert img.sizeOfPixels() >= 0
     img.addPixels(PixelsI())
     assert 1 == img.sizeOfPixels()
     img.clearPixels()
     assert img.sizeOfPixels() >= 0
     assert 0 == img.sizeOfPixels()
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:8,代码来源:test_model.py

示例6: testClearSet

 def testClearSet(self):
     img = ImageI()
     self.assert_( img.sizeOfPixels() >= 0 )
     img.addPixels( PixelsI() )
     self.assert_( 1==img.sizeOfPixels() )
     img.clearPixels()
     self.assert_( img.sizeOfPixels() >= 0 )
     self.assert_( 0==img.sizeOfPixels() )
开发者ID:DirkHaehnel,项目名称:openmicroscopy,代码行数:8,代码来源:t_model.py

示例7: testUnloadSet

 def testUnloadSet(self):
     img = ImageI()
     assert img.sizeOfPixels() >= 0
     img.addPixels(PixelsI())
     assert 1 == img.sizeOfPixels()
     img.unloadPixels()
     assert img.sizeOfPixels() < 0
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:7,代码来源:test_model.py

示例8: testGetAttrBad

 def testGetAttrBad(self):
    i = ImageI()
    def assign_loaded():
         i.loaded = False
    self.assertRaises( AttributeError, assign_loaded )
    self.assertRaises( AttributeError, lambda: i.foo )
    def assign_foo():
         i.foo = 1
    self.assertRaises( AttributeError, assign_foo )
    self.assertRaises( AttributeError, lambda: i.annotationLinks )
    self.assertRaises( AttributeError, lambda: i.getAnnotationLinks() )
    def assign_links():
         i.annotationLinks = []
    self.assertRaises( AttributeError, assign_links)
开发者ID:DirkHaehnel,项目名称:openmicroscopy,代码行数:14,代码来源:t_model.py

示例9: test1184

    def test1184(self):
        uuid = self.uuid()
        client = self.new_client(perms="rw----")

        share = client.sf.getShareService()
        query = client.sf.getQueryService()
        update = client.sf.getUpdateService()
        admin = client.sf.getAdminService()
        cont = client.sf.getContainerService()

        ds = DatasetI()
        ds.setName(rstring('test1184-ds-%s' % (uuid)))

        for i in range(1,2001):
            img = ImageI()
            img.setName(rstring('img1184-%s' % (uuid)))
            img.setAcquisitionDate(rtime(time.time()))
            # Saving in one go
            #dil = DatasetImageLinkI()
            #dil.setParent(ds)
            #dil.setChild(img)
            #update.saveObject(dil)
            ds.linkImage(img)
        ds = update.saveAndReturnObject(ds)

        c = cont.getCollectionCount(ds.__class__.__name__, ("imageLinks"), [ds.id.val], None)
        assert c[ds.id.val] == 2000

        page = 1
        p = omero.sys.Parameters()
        p.map = {}
        p.map["eid"] = rlong(admin.getEventContext().userId)
        p.map["oid"] = rlong(ds.id.val)
        if page is not None:
            f = omero.sys.Filter()
            f.limit = rint(24)
            f.offset = rint((int(page)-1)*24)
            p.theFilter = f

        sql = "select im from Image im join fetch im.details.owner join fetch im.details.group " \
              "left outer join fetch im.datasetLinks dil left outer join fetch dil.parent d " \
              "where d.id = :oid and im.details.owner.id=:eid order by im.id asc"

        start = time.time()
        res = query.findAllByQuery(sql,p)
        assert 24 ==  len(res)
        end = time.time()
        elapsed = end - start
        assert elapsed < 3.0,\
            "Expected the test to complete in < 3 seconds, took: %f" % elapsed
开发者ID:bramalingam,项目名称:openmicroscopy,代码行数:50,代码来源:test_tickets2000.py

示例10: testUnloadSet

 def testUnloadSet(self):
     img = ImageI()
     self.assert_( img.sizeOfPixels() >= 0 )
     img.addPixels( PixelsI() )
     self.assert_( 1==img.sizeOfPixels() )
     img.unloadPixels()
     self.assert_( img.sizeOfPixels() < 0 )
开发者ID:DirkHaehnel,项目名称:openmicroscopy,代码行数:7,代码来源:t_model.py

示例11: testGetAttrBad

 def testGetAttrBad(self):
    i = ImageI()
    def assign_loaded():
         i.loaded = False
    pytest.raises( AttributeError, assign_loaded )
    pytest.raises( AttributeError, lambda: i.foo )
    def assign_foo():
         i.foo = 1
    pytest.raises( AttributeError, assign_foo )
    pytest.raises( AttributeError, lambda: i.annotationLinks )
    pytest.raises( AttributeError, lambda: i.getAnnotationLinks() )
    def assign_links():
         i.annotationLinks = []
    pytest.raises( AttributeError, assign_links)
开发者ID:bramalingam,项目名称:openmicroscopy,代码行数:14,代码来源:test_model.py

示例12: testRemoveFromSet

    def testRemoveFromSet(self):
        pix = PixelsI()
        img = ImageI()
        self.assert_( img.sizeOfPixels() >= 0 )

        img.addPixels( pix )
        self.assert_( 1==img.sizeOfPixels() )

        img.removePixels( pix )
        self.assert_( 0==img.sizeOfPixels() )
开发者ID:DirkHaehnel,项目名称:openmicroscopy,代码行数:10,代码来源:t_model.py

示例13: testRemoveFromSet

    def testRemoveFromSet(self):
        pix = PixelsI()
        img = ImageI()
        assert img.sizeOfPixels() >= 0

        img.addPixels(pix)
        assert 1 == img.sizeOfPixels()

        img.removePixels(pix)
        assert 0 == img.sizeOfPixels()
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:10,代码来源:test_model.py

示例14: testUnloadCheckPtr

 def testUnloadCheckPtr(self):
     img = ImageI()
     assert img.isLoaded()
     assert img.getDetails()  # details are auto instantiated
     assert not img.getName()  # no other single-valued field is
     img.unload()
     assert not img.isLoaded()
     pytest.raises(omero.UnloadedEntityException, img.getDetails)
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:8,代码来源:test_model.py

示例15: testSequences

 def testSequences(self):
     img = ImageI()
     assert img.sizeOfAnnotationLinks() >= 0
     img.linkAnnotation(None)
     img.unload()
     try:
         assert not img.sizeOfAnnotationLinks() >= 0
         assert len(img.copyAnnotationLinks()) == 0
         assert False, "can't reach here"
     except:
         # These are true, but can't be tested
         pass
开发者ID:sbesson,项目名称:openmicroscopy,代码行数:12,代码来源:test_model.py


注:本文中的omero_model_ImageI.ImageI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。