[ome-devel] Reading group of files

Melissa Linkert melissa at glencoesoftware.com
Thu Jul 3 23:05:24 BST 2014


Hi Dimitri,

> So I was double-checking the data and I realized two major issues in
> my case:
> 1) the first timestep is actually the last one;
> 2) if one or more files of the dataset is missing, the first
> timestep is used instead.
> 
> I'm uploading timesteps here: http://qa.openmicroscopy.org.uk/qa/feedback/9389/?token=2dfafb0cfd6001f2e6bd32dcf505653a
> 
> The whole dataset size is 7GB, so I may be able to upload only 20 timesteps.

Thank you for uploading a dataset.  Unfortunately, the problem is that
the file grouping metadata in the files is incorrect; there are also 63
files, when only 62 timepoints are recorded in the metadata.

Probably the easiest thing to do for just reading the images is to
replace the first line of your code with:

// --
IFormatReader reader = new FileStitcher(new TiffReader());
// --

That should read the images correctly, but will ignore almost all of the
metadata that is in the files.  If you wish to extract any metadata beyond the
image dimensions and number of timepoints/Z sections, that can be done
separately:

// --
String omexml = new TiffParser(firstFile).getComment();
OMEXMLService service = new ServiceFactory().getInstance(OMEXMLService.class);
IMetadata metadata = service.createOMEXMLMetadata(omexml);
// --

It looks like this dataset was generated using LaVision's Imspector Pro; I would
suggest reporting this problem to LaVision as well, so that hopefully
they can fix how the metadata is being written.

Regards,
-Melissa

On Wed, Jul 02, 2014 at 05:06:06PM +0200, Dimitri Fabrèges wrote:
> Hi Melissa,
> 
> So I was double-checking the data and I realized two major issues in
> my case:
> 1) the first timestep is actually the last one;
> 2) if one or more files of the dataset is missing, the first
> timestep is used instead.
> 
> I'm uploading timesteps here: http://qa.openmicroscopy.org.uk/qa/feedback/9389/?token=2dfafb0cfd6001f2e6bd32dcf505653a
> 
> The whole dataset size is 7GB, so I may be able to upload only 20 timesteps.
> 
> Thanks,
> Dimitri.
> 
> Le 29/06/2014 19:18, Melissa Linkert a écrit :
> >Hi Dimitri,
> >
> >>I have been developing an application in Java for my lab which reads
> >>and converts microscopy files.
> >>Recently I have tried to convert a group of TIFF files. I was used
> >>to work with single file dataset, which works nicely. With multiple
> >>files dataset, it works too, except that files are not read in the
> >>correct order.
> >>
> >>Is there a method or something to:
> >>1) get the order used to read multiple files dataset?
> >>2) change the order?
> >How the files are grouped depends a lot upon the internal metadata in
> >the files.  Would you be able to send a small dataset that illustrates
> >the problem?  Files can be uploaded to
> >http://qa.openmicroscopy.org.uk/qa/upload, and are visible only to OME
> >developers.
> >
> >It's very possible that what you're seeing is something that needs to be
> >fixed in Bio-Formats, but we can better advise after looking at a
> >dataset.
> >
> >Regards,
> >-Melissa
> >
> >On Mon, Jun 30, 2014 at 06:12:19PM +0200, Dimitri Fabrèges wrote:
> >>Dear mailinglist,
> >>
> >>This is my first post here, so please let me know if I'm not clear
> >>enough or if you need more informations.
> >>
> >>I have been developing an application in Java for my lab which reads
> >>and converts microscopy files.
> >>Recently I have tried to convert a group of TIFF files. I was used
> >>to work with single file dataset, which works nicely. With multiple
> >>files dataset, it works too, except that files are not read in the
> >>correct order.
> >>
> >>Is there a method or something to:
> >>1) get the order used to read multiple files dataset?
> >>2) change the order?
> >>
> >>I'm doing this:
> >>
> >>IFormatReader reader = new ImageReader();
> >>reader.setMetadataStore(MetadataTools.createOMEXMLMetadata());
> >>reader.setId (firstFile);
> >>
> >>int c = reader.getSizeC();
> >>int t = reader.getSizeT();
> >>int z = reader.getSizeZ();
> >>
> >>for (int series = 0; series < reader.getSeriesCount(); series++)
> >>{
> >>     reader.setSeries (series);
> >>     for (int timestep = 0; timestep < t; timestep ++)
> >>     {
> >>         for (int channel = 0; channel < c; channel ++)
> >>         {
> >>             for (int depth = 0; depth < z; depth ++)
> >>             {
> >>                int index   = reader.getIndex (depth, channel, timestep);
> >>byte[] data = reader.openBytes ();
> >>                [...]
> >>                // Do stuff and write files (one file per timestep
> >>and channel)
> >>             }
> >>         }
> >>     }
> >>}
> >>
> >>Thank you very much in advance.
> >>
> >>Best,
> >>Dimitri.
> >>_______________________________________________
> >>ome-devel mailing list
> >>ome-devel at lists.openmicroscopy.org.uk
> >>http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
> 


More information about the ome-devel mailing list