I trying to get the value of overlap metadata in ome.tif Lavision image. Opening image in Fiji with Bioformats and metadata actived shown the field :
- Code: Select all
xyz-Table_XY_Overlap 10.000000
However, using java code as :
- Code: Select all
ServiceFactory factory;
factory = new ServiceFactory();
OMEXMLService service = factory.getInstance(OMEXMLService.class);
IMetadata meta = service.createOMEXMLMetadata();
ImageProcessorReader reader = new ImageProcessorReader();
reader.setMetadataStore(meta);
reader.setId(imageDir+imageFile[0]);
int series = 0;
reader.setSeries(series);
double sx = meta.getPixelsPhysicalSizeX(series).value().doubleValue();
double sy = meta.getPixelsPhysicalSizeY(series).value().doubleValue();
double sz = meta.getPixelsPhysicalSizeZ(series).value().doubleValue();
cal.pixelWidth = sx;
cal.pixelHeight = sy;
cal.pixelDepth = sz;
cal.setUnit("microns");
String overlapMetadata = "xyz-Table_XY_Overlap";
String overlap =reader.getSeriesMetadataValue(overlapMetadata).toString());
return a null pointer exception for overlap but not sx, sy or sz ????
Philippe