Changeset 3359


Ignore:
Timestamp:
11/09/07 13:59:24 (12 years ago)
Author:
melissa
Message:

Compare the primary file's used file list against FilePattern's file list - if FilePattern's list is a subset of the primary file's list, then FileStitcher should do nothing. This handles the case where smarter stitching logic is present in a format's reader (e.g. BioRad, OME-TIFF, PerkinElmer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FileStitcher.java

    r3357 r3359  
    843843    reader.setId(files[0]); 
    844844 
     845    String[] originalUsedFiles = reader.getUsedFiles(); 
     846 
     847    boolean doNotStitch = true; 
     848    for (int i=0; i<files.length; i++) { 
     849      boolean found = false; 
     850      for (int j=0; j<originalUsedFiles.length; j++) { 
     851        if (originalUsedFiles[j].endsWith(files[i])) { 
     852          found = true; 
     853          break; 
     854        } 
     855      } 
     856      if (!found) { 
     857        doNotStitch = false; 
     858        break; 
     859      } 
     860    } 
     861 
     862    if (doNotStitch) { 
     863      // the reader for this file uses its own stitching logic that is probably 
     864      // smarter than FileStitcher 
     865      readers = new IFormatReader[] {reader}; 
     866      files = new String[] {files[0]}; 
     867      fp = new FilePattern(files[0]); 
     868    } 
     869 
    845870    int seriesCount = reader.getSeriesCount(); 
    846871    ag = new AxisGuesser[seriesCount]; 
Note: See TracChangeset for help on using the changeset viewer.