use of loci.formats.meta.MetadataRetrieve in project bioformats by openmicroscopy.
the class LociFunctions method getPlaneTimingDeltaT.
public void getPlaneTimingDeltaT(Double[] deltaT, Double no) {
int imageIndex = r.getSeries();
int planeIndex = getPlaneIndex(r, no.intValue());
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
Double val = Double.NaN;
if (planeIndex >= 0) {
Time valTime = retrieve.getPlaneDeltaT(imageIndex, planeIndex);
if (valTime != null) {
val = valTime.value(UNITS.SECOND).doubleValue();
}
}
deltaT[0] = val;
}
use of loci.formats.meta.MetadataRetrieve in project bioformats by openmicroscopy.
the class LociFunctions method getPixelsPhysicalSizeZ.
public void getPixelsPhysicalSizeZ(Double[] sizeZ) {
int imageIndex = r.getSeries();
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
Length z = retrieve.getPixelsPhysicalSizeZ(imageIndex);
if (z != null) {
sizeZ[0] = z.value(UNITS.MICROMETER).doubleValue();
}
if (sizeZ[0] == null)
sizeZ[0] = new Double(Double.NaN);
}
use of loci.formats.meta.MetadataRetrieve in project bioformats by openmicroscopy.
the class LociFunctions method getPlanePositionY.
public void getPlanePositionY(Double[] positionY, Double no) {
int imageIndex = r.getSeries();
int planeIndex = getPlaneIndex(r, no.intValue());
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
Length val = null;
if (planeIndex >= 0) {
val = retrieve.getPlanePositionY(imageIndex, planeIndex);
}
if (val == null) {
val = new Length(Double.NaN, UNITS.REFERENCEFRAME);
}
positionY[0] = val == null ? Double.NaN : val.value(UNITS.REFERENCEFRAME).doubleValue();
}
use of loci.formats.meta.MetadataRetrieve in project bioformats by openmicroscopy.
the class LociFunctions method getPlaneIndex.
// -- Utility methods --
/**
* Finds the Plane index corresponding to the given image plane number.
*/
private static int getPlaneIndex(IFormatReader r, int no) {
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
int imageIndex = r.getSeries();
int planeCount = retrieve.getPlaneCount(imageIndex);
int[] zct = r.getZCTCoords(no);
for (int i = 0; i < planeCount; i++) {
Integer theC = retrieve.getPlaneTheC(imageIndex, i).getValue();
Integer theT = retrieve.getPlaneTheT(imageIndex, i).getValue();
Integer theZ = retrieve.getPlaneTheZ(imageIndex, i).getValue();
if (zct[0] == theZ.intValue() && zct[1] == theC.intValue() && zct[2] == theT.intValue()) {
return i;
}
}
return -1;
}
use of loci.formats.meta.MetadataRetrieve in project bioformats by openmicroscopy.
the class LociFunctions method getPlaneTimingExposureTime.
public void getPlaneTimingExposureTime(Double[] exposureTime, Double no) {
int imageIndex = r.getSeries();
int planeIndex = getPlaneIndex(r, no.intValue());
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
Double val = null;
if (planeIndex >= 0) {
Time valTime = retrieve.getPlaneExposureTime(imageIndex, planeIndex);
if (valTime != null) {
val = valTime.value(UNITS.SECOND).doubleValue();
}
}
exposureTime[0] = val == null ? new Double(Double.NaN) : val;
}
Aggregations