Bioformats API
Posted: Wed Oct 06, 2010 8:44 pm
when accessing the omero shell, is there access to the bioformats api?
The OME community
https://www.openmicroscopy.org/community/
https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=499
395 def downloadPlane(rawPixelsStore, pixels, z, c, t):
...
406 rawPlane = rawPixelsStore.getPlane(z, c, t);
...
411 convertType ='>'+str(sizeX*sizeY)+pixelstypetopython.toPython(pixelType);
412 convertedPlane = unpack(convertType, rawPlane);
413 numpyType = pixelstypetopython.toNumpy(pixelType)
414 remappedPlane = numpy.array(convertedPlane, numpyType);
415 remappedPlane.resize(sizeY, sizeX);
416 return remappedPlane;
In [122]: plane = utils.downloadPlane( rawPixelsStore, pixels, 0, 0, 0 );
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (8, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (22, 0))
---------------------------------------------------------------------------
UnloadedEntityException Traceback (most recent call last)
/afs/cs.cmu.edu/user/bhcho/<ipython console> in <module>()
/usr0/local/omero.server/OMERO.server-Beta-4.2.0/lib/python/omero/util/script_utils.pyc in downloadPlane(rawPixelsStore, pixels, z, c, t)
404 sizeY = pixels.getSizeY().getValue();
405 pixelsId = pixels.getId().getValue();
--> 406 pixelType = pixels.getPixelsType().getValue().getValue();
407 convertType ='>'+str(sizeX*sizeY)+pixelstypetopython.toPython(pixelType);
408 convertedPlane = unpack(convertType, rawPlane);
/usr0/local/omero.server/OMERO.server-Beta-4.2.0/lib/python/omero_model_PixelsTypeI.pyc in getValue(self, current)
109
110 def getValue(self, current = None):
--> 111 self.errorIfUnloaded()
112 return self._value
113
/usr0/local/omero.server/OMERO.server-Beta-4.2.0/lib/python/omero_model_PixelsTypeI.pyc in errorIfUnloaded(self)
36 def errorIfUnloaded(self):
37 if not self._loaded:
---> 38 raise _omero.UnloadedEntityException("Object unloaded:"+str(self))
39
40 def throwNullCollectionException(self,propertyName):
UnloadedEntityException: Object unloaded:object #0 (::omero::model::PixelsType)
{
_id = object #1 (::omero::RLong)
{
_val = 5
}
_details = <nil>
_loaded = False
_value = <nil>
}
rawPixelsStore = session.createRawPixelsStore()
image = gateway.getImage( iid )
pixels = image.getPixels( 0 )
pid = pixels.getId().getValue()
rawPixelsStore.setPixelsId( pid, True )
plane = utils.downloadPlane( rawPixelsStore, pixels, 0, 0, 0 );