[ome-devel] Reading group of files

Dimitri Fabrèges dimitri.fabreges at yahoo.fr
Mon Jun 30 17:12:19 BST 2014


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.


More information about the ome-devel mailing list