Search in sources :

Example 6 with Sequence

use of loci.formats.in.PrairieMetadata.Sequence in project bioformats by openmicroscopy.

the class PrairieReader method getSeriesUsedFiles.

@Override
public String[] getSeriesUsedFiles(boolean noPixels) {
    FormatTools.assertId(currentId, true, 1);
    if (singleTiffMode)
        return tiff.getSeriesUsedFiles(noPixels);
    // add metadata files to the used files list
    final ArrayList<String> usedFiles = new ArrayList<String>();
    if (xmlFile != null)
        usedFiles.add(xmlFile.getAbsolutePath());
    if (cfgFile != null)
        usedFiles.add(cfgFile.getAbsolutePath());
    if (envFile != null)
        usedFiles.add(envFile.getAbsolutePath());
    if (!noPixels) {
        // add TIFF files to the used files list
        final int s = getSeries();
        for (int t = 0; t < getSizeT(); t++) {
            final Sequence sequence = sequence(t, s);
            for (int z = 0; z < getSizeZ(); z++) {
                final int index = frameIndex(sequence, z, t, s);
                final Frame frame = sequence.getFrame(index);
                if (frame == null) {
                    warnFrame(sequence, index);
                    continue;
                }
                for (int c = 0; c < getSizeC(); c++) {
                    final int channel = channels[c];
                    final PFile file = frame.getFile(channel);
                    if (file == null) {
                        warnFile(sequence, index, channel);
                        continue;
                    }
                    final String filename = file.getFilename();
                    if (filename == null) {
                        warnFilename(sequence, index, channel);
                        continue;
                    }
                    usedFiles.add(getPath(file));
                }
            }
        }
    }
    return usedFiles.toArray(new String[usedFiles.size()]);
}
Also used : Frame(loci.formats.in.PrairieMetadata.Frame) PFile(loci.formats.in.PrairieMetadata.PFile) ArrayList(java.util.ArrayList) Sequence(loci.formats.in.PrairieMetadata.Sequence)

Aggregations

Sequence (loci.formats.in.PrairieMetadata.Sequence)6 Frame (loci.formats.in.PrairieMetadata.Frame)5 PFile (loci.formats.in.PrairieMetadata.PFile)4 Length (ome.units.quantity.Length)2 ArrayList (java.util.ArrayList)1 CoreMetadata (loci.formats.CoreMetadata)1 FormatException (loci.formats.FormatException)1 ValueTable (loci.formats.in.PrairieMetadata.ValueTable)1 MetadataStore (loci.formats.meta.MetadataStore)1 Power (ome.units.quantity.Power)1 Time (ome.units.quantity.Time)1 PositiveFloat (ome.xml.model.primitives.PositiveFloat)1 Timestamp (ome.xml.model.primitives.Timestamp)1