use of ome.units.quantity.Time in project bioformats by openmicroscopy.
the class GetPhysicalMetadata method printPhysicalDimensions.
/**
* Outputs global timing details.
*/
public static void printPhysicalDimensions(IMetadata meta, int series) {
Length physicalSizeX = meta.getPixelsPhysicalSizeX(series);
Length physicalSizeY = meta.getPixelsPhysicalSizeY(series);
Length physicalSizeZ = meta.getPixelsPhysicalSizeZ(series);
Time timeIncrement = meta.getPixelsTimeIncrement(series);
System.out.println();
System.out.println("Physical dimensions:");
System.out.println("\tX spacing = " + physicalSizeX.value() + " " + physicalSizeX.unit().getSymbol());
System.out.println("\tY spacing = " + physicalSizeY.value() + " " + physicalSizeY.unit().getSymbol());
System.out.println("\tZ spacing = " + physicalSizeZ.value() + " " + physicalSizeZ.unit().getSymbol());
System.out.println("\tTime increment = " + timeIncrement.value(UNITS.SECOND).doubleValue() + " seconds");
}
use of ome.units.quantity.Time in project bioformats by openmicroscopy.
the class PrintTimestamps method printGlobalTiming.
/**
* Outputs global timing details.
*/
public static void printGlobalTiming(IMetadata meta, int series) {
String imageName = meta.getImageName(series);
String creationDate = null;
if (meta.getImageAcquisitionDate(series) != null) {
creationDate = meta.getImageAcquisitionDate(series).getValue();
}
Time timeInc = meta.getPixelsTimeIncrement(series);
System.out.println();
System.out.println("Global timing information:");
System.out.println("\tImage name = " + imageName);
System.out.println("\tCreation date = " + creationDate);
if (creationDate != null) {
System.out.println("\tCreation time (in ms since epoch) = " + DateTools.getTime(creationDate, DateTools.ISO8601_FORMAT));
}
System.out.println("\tTime increment (in seconds) = " + timeInc.value(UNITS.SECOND).doubleValue());
}
use of ome.units.quantity.Time in project bioformats by openmicroscopy.
the class PrintTimestamps method printTimingPerTimepoint.
/**
* Outputs timing details per timepoint.
*/
public static void printTimingPerTimepoint(IMetadata meta, int series) {
System.out.println();
System.out.println("Timing information per timepoint (from beginning of experiment):");
int planeCount = meta.getPlaneCount(series);
for (int i = 0; i < planeCount; i++) {
Time deltaT = meta.getPlaneDeltaT(series, i);
if (deltaT == null)
continue;
// convert plane ZCT coordinates into image plane index
int z = meta.getPlaneTheZ(series, i).getValue().intValue();
int c = meta.getPlaneTheC(series, i).getValue().intValue();
int t = meta.getPlaneTheT(series, i).getValue().intValue();
if (z == 0 && c == 0) {
System.out.println("\tTimepoint #" + t + " = " + deltaT.value(UNITS.SECOND).doubleValue() + " s");
}
}
}
use of ome.units.quantity.Time in project bioformats by openmicroscopy.
the class TillVisionReader method populateMetadataStore.
// -- Helper methods --
private void populateMetadataStore() throws FormatException {
MetadataStore store = makeFilterMetadata();
MetadataTools.populatePixels(store, this, true);
for (int i = 0; i < getSeriesCount(); i++) {
// populate Image data
if (i < imageNames.size()) {
store.setImageName(imageNames.get(i), i);
}
String date = i < dates.size() ? dates.get(i) : "";
if (date != null && !date.equals("")) {
store.setImageAcquisitionDate(new Timestamp(date), i);
}
}
if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) {
for (int i = 0; i < getSeriesCount(); i++) {
for (int q = 0; q < core.get(i).imageCount; q++) {
if (exposureTimes.get(i) != null) {
store.setPlaneExposureTime(new Time(exposureTimes.get(i), UNITS.SECOND), i, q);
}
}
if (i < types.size()) {
store.setExperimentID(MetadataTools.createLSID("Experiment", i), i);
store.setExperimentType(getExperimentType(types.get(i)), i);
}
}
}
}
use of ome.units.quantity.Time 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;
}
Aggregations