Hi David,
Thanks! Unfortunately, since the example you are showing is in Java, I'm having a hard time finding the equivalent for Python:
- instead of getPixels(), I guess I should use getPrimaryPixels() ?
- in Python getPlane() returns a numpy array which has no getPositionX() attribute. Is there a way to access the real OME Plane object's info?
I'm mostly trying to get the coordinates for images from a large ND2 file so I can organize them by their location. The showinf output shows this type of info:
- Code: Select all
Generating OME-XML (schema version 2016-06)
<?xml version="1.0" encoding="UTF-8"?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
<Instrument ID="Instrument:0">
<Detector ID="Detector:0:0" Type="Other"/>
<Objective Correction="Other" ID="Objective:0:0" Immersion="Other"/>
</Instrument>
<Image ID="Image:0" Name="PlateLI9V01905_WellA01_Seq0000.nd2 (series 01)">
<InstrumentRef ID="Instrument:0"/>
<ObjectiveSettings ID="Objective:0:0" RefractiveIndex="1.0"/>
<Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.321212" PhysicalSizeXUnit="µm" PhysicalSizeY="0.321212" PhysicalSizeYUnit="µm" SignificantBits="16" SizeC="2" SizeT="1" SizeX="1600" SizeY="1600" SizeZ="1" Type="uint16">
<Channel Color="65535" EmissionWavelength="440.0" EmissionWavelengthUnit="nm" ID="Channel:0:0" Name="395nm" SamplesPerPixel="1">
<DetectorSettings ID="Detector:0:0"/>
<LightPath/>
</Channel>
<Channel Color="-13434625" EmissionWavelength="607.0" EmissionWavelengthUnit="nm" ID="Channel:0:1" Name="555nm" SamplesPerPixel="1">
<DetectorSettings ID="Detector:0:0"/>
<LightPath/>
</Channel>
<MetadataOnly/>
<Plane DeltaT="7.729394392967224" DeltaTUnit="s" ExposureTime="0.0" ExposureTimeUnit="s" PositionX="113148.35" PositionXUnit="reference frame" PositionY="75198.0" PositionYUnit="reference frame" PositionZ="200.0" PositionZUnit="reference frame" TheC="0" TheT="0" TheZ="0"/>
<Plane DeltaT="7.729394392967224" DeltaTUnit="s" ExposureTime="100.0" ExposureTimeUnit="s" PositionX="113148.35" PositionXUnit="reference frame" PositionY="75198.0" PositionYUnit="reference frame" PositionZ="200.0" PositionZUnit="reference frame" TheC="1" TheT="0" TheZ="0"/>
</Pixels>
</Image>
<Image ID="Image:1" Name="PlateLI9V01905_WellA01_Seq0000.nd2 (series 02)">
<InstrumentRef ID="Instrument:0"/>
<ObjectiveSettings ID="Objective:0:0" RefractiveIndex="1.0"/>
<Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:1" Interleaved="false" PhysicalSizeX="0.321212" PhysicalSizeXUnit="µm" PhysicalSizeY="0.321212" PhysicalSizeYUnit="µm" SignificantBits="16" SizeC="2" SizeT="1" SizeX="1600" SizeY="1600" SizeZ="1" Type="uint16">
<Channel Color="65535" EmissionWavelength="440.0" EmissionWavelengthUnit="nm" ID="Channel:1:0" Name="395nm" SamplesPerPixel="1">
<DetectorSettings ID="Detector:0:0"/>
<LightPath/>
</Channel>
<Channel Color="-13434625" EmissionWavelength="607.0" EmissionWavelengthUnit="nm" ID="Channel:1:1" Name="555nm" SamplesPerPixel="1">
<DetectorSettings ID="Detector:0:0"/>
<LightPath/>
</Channel>
<MetadataOnly/>
<Plane DeltaT="9.107385417938232" DeltaTUnit="s" ExposureTime="0.0" ExposureTimeUnit="s" PositionX="112418.75" PositionXUnit="reference frame" PositionY="75198.0" PositionYUnit="reference frame" PositionZ="200.0" PositionZUnit="reference frame" TheC="0" TheT="0" TheZ="0"/>
<Plane DeltaT="9.107385417938232" DeltaTUnit="s" ExposureTime="0.0" ExposureTimeUnit="s" PositionX="112418.75" PositionXUnit="reference frame" PositionY="75198.0" PositionYUnit="reference frame" PositionZ="200.0" PositionZUnit="reference frame" TheC="1" TheT="0" TheZ="0"/>
</Pixels>
</Image>
and those (PositionX, PositionY) coordinates per image are correct and what I need.
Thanks,
- Damir