We're Hiring!

reading metadata

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

reading metadata

Postby phm » Tue Mar 20, 2018 11:06 am

Hi,
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
phm
 
Posts: 185
Joined: Tue Mar 19, 2013 3:39 pm

Re: reading metadata

Postby mtbc » Wed Mar 21, 2018 9:13 am

Dear Philippe,

Perhaps that key is among the global rather than the series metadata? You can check using showinf -nopix as at https://docs.openmicroscopy.org/latest/ ... splay.html

If you still have trouble, please do feel free to paste to us the output of showinf applied to your file or even just upload the image to http://qa.openmicroscopy.org.uk/qa/upload/ with a covering comment and we should be glad to take a look.

Cheers,
Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Re: reading metadata

Postby phm » Wed Mar 21, 2018 1:47 pm

Hi Mark,
I uploaded the file 11-30-56_140218E17-5netpattehomo4 x 3-2_UltraII[00 x 00]_C00_xyz-Table Z0000.ome.tif
on your server.
Thanks
Philippe
phm
 
Posts: 185
Joined: Tue Mar 19, 2013 3:39 pm

Re: reading metadata

Postby mtbc » Wed Mar 21, 2018 2:20 pm

Dear Philippe,

Yes, showinf shows that the overlay's in the global metadata, not the series metadata. Try instead something like,

Code: Select all
String overlap = reader.getGlobalMetadata().get(overlapMetadata).toString();


Cheers,
Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Re: reading metadata

Postby phm » Wed Mar 21, 2018 2:51 pm

mtbc wrote:Dear Philippe,

Yes, showinf shows that the overlay's in the global metadata, not the series metadata. Try instead something like,

Code: Select all
String overlap = reader.getGlobalMetadata().get(overlapMetadata).toString();


Cheers,
Mark


Solved !
Thanks Mark,

Philippe
phm
 
Posts: 185
Joined: Tue Mar 19, 2013 3:39 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest

cron