We're Hiring!

setting names/values for Z, C, T

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

setting names/values for Z, C, T

Postby yuriy_alexandrov » Fri Jan 10, 2014 12:17 pm

Hi All,

I wonder - in Omero image, what is the easiest (and maybe uniform?) way of setting the values/names for ZCT.
Meaning, Z (e.g. something in microns), C (.. wavelengths), and T(.. minutes).

Here is the code that sets up channels' names; it is quite involved

Code: Select all
pixelsDesc = pixelsService.retrievePixDescription(pixels.getId().getValue());
channels = pixelsDesc.copyChannels();
objects = java.util.ArrayList();
%
for c = 1:sizeC
    ch = channels.get(c-1);
    ch.getLogicalChannel().setName(omero.rtypes.rstring(char(channels_names{c})));
    % ...   
    objects.add(ch);
end
%
factory.getUpdateService().saveAndReturnArray(objects);

There is also this RawPixelStore -> SetTimepoint function that might be useful but I am not sure.
http://users.openmicroscopy.org.uk/~spl ... tTimepoint

Basically the question is, is it possible to set it up at once, in a cheapest way.

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: setting names/values for Z, C, T

Postby jburel » Mon Jan 13, 2014 3:58 pm

Hi Yuri

Could you expand what you are trying to record? Is it for your customised import?
We have the planeInfo objects that contain information about exposure time, position etc.
is it what you are trying to set for each plane?

Thanks

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: setting names/values for Z, C, T

Postby yuriy_alexandrov » Mon Jan 13, 2014 5:40 pm

yes this is about setting/getting values for XY planes.
I found set/getWaveIncremet, set/getWaveStart but it looks like, not it.
I will examine planeInfo methods and usage and come back - hopefully it will suffice.

Best regards,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: setting names/values for Z, C, T

Postby jburel » Tue Jan 14, 2014 9:14 am

Let us know if it satisfies your needs.

Cheers

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: setting names/values for Z, C, T

Postby yuriy_alexandrov » Tue Jan 14, 2014 11:51 am

Many thanks Jmaie,

"getPlaneInfo.m" function looks very useful -
https://github.com/openmicroscopy/openmicroscopy/pull/1194

The context of the question is importing our raw OPT and SPIM data that might have potentially many attributes per XY plane.

So any code snippets for setting/getting ZCTs with "planeInfo" would be very helpful.
For example, there are several instances - set/getTheC, set/getTheT and simply theC, theT etc. - how does it work?

Another question is on "Annotation" - is it possible to set arbitrary annotation for XY plane?
For now, we can transfer OPT data by simply packing planes along some dimension and then using "ModuloAlong" XML annotation mechanism that we are familiar with from the work on lifetime data.
In this XML annotation, XY planes are annotated by the acquisition filenames.

It looks like "planeInfo" opion is able to handle some of the metadata to Omero schema, but

1) for OPT and lifetime-OPT, both angle and lifetime vaiables need using ModuloAlong
2) there might be several cameras, excitation wavelengths, polarizations, exposure times, light sheet characteristics, and more

The last question is about units - is it presumed that ZCT are always in microns, nanometers and minutes?

Cheers,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: setting names/values for Z, C, T

Postby ajpatterson » Wed Jan 15, 2014 12:06 pm

Hi Yuri,

The last question is about units - is it presumed that ZCT are always in microns, nanometers and minutes?


The Plane object has the following values:
DeltaT - float - Units are seconds since the beginning of the experiment [s]
ExposureTime - float - Units are seconds [s]
PositionX, PositionY, PositionZ - float The X, Y, Z position of the stage. [units are in the microscope reference frame]
TheC - integer - The channel this plane is for. [units:none]
TheT - integer - The timepoint this plane is for. [units:none]
TheZ - integer - The Z-section this plane is for. [units:none]

So at the Plane level there are no units for TheC, TheZ, TheC, as they are behaving as simple counters 0,1,2…

The Pixels object has the following values:
PhysicalSizeX - float - Physical size of a pixel in microns[um].
PhysicalSizeY - float - Physical size of a pixel in microns[um].
PhysicalSizeZ - float - Physical size of a pixel in microns[um].
SizeC - int - Dimensional size of pixel data array [units:none]
SizeT - int - Dimensional size of pixel data array [units:none]
SizeX - int - Dimensional size of pixel data array [units:none]
SizeY - int - Dimensional size of pixel data array [units:none]
SizeZ - int - Dimensional size of pixel data array [units:none]
TimeIncrement - float - TimeIncrement is used for time series that have a global timing specification instead of per-timepoint timing info. For example in a video stream. The unit is seconds[s].

So at the Pixels level the size of the pixels can be defined in microns.

Hope the helps,

Andrew
--
Andrew Patterson
Software Developer, Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression
University of Dundee
ajpatterson
 
Posts: 50
Joined: Fri May 01, 2009 11:18 am

Re: setting names/values for Z, C, T

Postby yuriy_alexandrov » Wed Jan 15, 2014 3:25 pm

Thanks Andrew,

I understand that examples of Matlab usage of planeInfo setups might be scarce.
Is it possible at all, or used mostly (only?) in Bioformats?

Other thing I would like to ask is some image(s) where planeInfo's are properly populated.
Either as correctly importable file, or Omero object.
I tried Sebastien's getPlaneInfo function on B&H *sdts and usual tifs imported by Omero.Insight - getPlaneInfo returns are always empty; possibility that I missed something in params?

Best wishes,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: setting names/values for Z, C, T

Postby wmoore » Wed Jan 15, 2014 4:07 pm

Hi Yuri,

If you download OME.xml files from JCB dataviewer (E.g. Deltavision files at http://jcb-dataviewer.rupress.org/jcb/browse/105/128/) these seem to have plane-info populated.

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: setting names/values for Z, C, T

Postby yuriy_alexandrov » Wed Jan 15, 2014 4:49 pm

Many thanks for Your help Will - yes, getPlaneInfo output isn't empty this time, I will look at it.

What was the java code for these settings? - I found OMETiffReader.java in Bioformats but there is not much there, and it seems very low-level..

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: setting names/values for Z, C, T

Postby yuriy_alexandrov » Thu Jan 16, 2014 12:25 pm

I downloaded Will's JCB example and tried to read it:

Code: Select all
    tT = Tiff(filename);
    s = tT.getTag('ImageDescription');     
    edit(s)

Matlab editor fails to read that string - the error message likely contains what was parsed before error -

up the original data before doing so. For more information, see the OME-TIFF web site:
http:\ome-xml.org\wiki\OmeTiff. --><OME xmlns="http:\www.openmicroscopy.org\Schemas\OME\2012-06"
xmlns:xsi="http:\www.w3.org\2001\XMLSchema-instance"
UUID="urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de"
xsi:schemaLocation="http:\www.openmicroscopy.org\Schemas\OME\2012-06
http:\www.openmicroscopy.org\Schemas\OME\2012-06\ome.xsd"><Image
ID="urn:lsid:export.openmicroscopy.org:Image:9a19817c-74c5-4432-9494-8cffa84d3446_120:34571"
Name="Bod1 siRNA"><AcquisitionDate>2009-03-27T04:19:24<\AcquisitionDate><Description>Figure 4.
Bod1 is required for the efficient resolution of syntelic attachments. (A) The mitotic profile of
control and Bod1-depleted cells was determined 72 h after transfection of siRNA. (B)
GFPCENP-Btransfected HeLa cells were cotransfected with control or Bod1 siRNA, and time-lapse
microscopy was performed 72 h after transfection. Projections of selected time points are shown.
(C) Control or Bod1 siRNA HeLa cells were treated with monastrol for 3 h, washed, and released
into media containing MG132 for 1 h before fixing. The mitotic profile before and after monastrol
release is shown. (D) Syntelic attachments in Bod1 siRNA cells 1 h after release from monastrol
showing microtubules (green), anti-Hec1 (red), and ACA (blue). Insets are magnified images of
boxed areas. Error bars represent SD. Bars, 5 µm.<\Description><ImagingEnvironment\><Pixels
DimensionOrder="XYZCT"
ID="urn:lsid:export.openmicroscopy.org:Pixels:9a19817c-74c5-4432-9494-8cffa84d3446_120:34574"
PhysicalSizeX="0.3312" PhysicalSizeY="0.3312" PhysicalSizeZ="2.25" SizeC="1" SizeT="157"
SizeX="237" SizeY="265" SizeZ="6" Type="uint16"><Channel EmissionWavelength="528"
ExcitationWavelength="490"
ID="urn:lsid:export.openmicroscopy.org:Channel:9a19817c-74c5-4432-9494-8cffa84d3446_130:34575"
NDFilter="1.0" SamplesPerPixel="1"><LightPath\><\Channel><TiffData FirstC="0" FirstT="0"
FirstZ="0" IFD="0" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="0" FirstZ="1" IFD="1" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="0" FirstZ="2" IFD="2" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="0" FirstZ="3" IFD="3" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="0" FirstZ="4" IFD="4" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="0" FirstZ="5" IFD="5" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="0" IFD="6" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="1" IFD="7" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="2" IFD="8" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="3" IFD="9" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="4" IFD="10" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="1" FirstZ="5" IFD="11" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="0" IFD="12" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="1" IFD="13" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="2" IFD="14" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="3" IFD="15" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="4" IFD="16" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="2" FirstZ="5" IFD="17" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="0" IFD="18" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="1" IFD="19" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="2" IFD="20" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="3" IFD="21" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="4" IFD="22" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="3" FirstZ="5" IFD="23" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="0" IFD="24" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="1" IFD="25" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="2" IFD="26" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="3" IFD="27" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="4" IFD="28" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="4" FirstZ="5" IFD="29" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="5" FirstZ="0" IFD="30" PlaneCount="1"><UUID
FileName="__omero_export__5730137797165245821.ome.tiff">urn:uuid:0e78bd9e-4054-452f-a687-eed0dbb4a2de<\UUID><\TiffData><TiffData
FirstC="0" FirstT="5" Fi

the XML utility "xmlreadstring" failed, too -

Code: Select all
     [parseResult,~] = xmlreadstring(s);
     tree = xml_read(parseResult);

the error was
Error using xmlreadstring (line 12)
Java exception occurred:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element
content of the document.

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)

if one applies "bfopen" to this file, it reads seemingly correctly but then the metadata are empty:

Code: Select all
bfdata = bfopen(filename);
metadata = bfdata{1, 2};

for i=1:metadata.size()
%...
end

metadata.size() returns 0.

next I will look what is in "planeInfo" structure in corresponding Omero image imported by Omero.Insight.

we may try 1) to save the data properly as OME.tiff and then 2) use Bioformats to import to Omero.
maybe one can take "bfsave" as basis and add ZCT and other information?

Thanks,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Next

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest