Changeset 6264


Ignore:
Timestamp:
05/10/10 18:48:08 (10 years ago)
Author:
curtis
Message:

Allow toggling of patternIds flag in existing FileStitcher.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/FileStitcher.java

    r6252 r6264  
    156156  public FileStitcher(IFormatReader r, boolean patternIds) { 
    157157    reader = DimensionSwapper.makeDimensionSwapper(r); 
    158     this.patternIds = patternIds; 
     158    setUsingPatternIds(patternIds); 
    159159  } 
    160160 
     
    163163  /** Gets the wrapped reader prototype. */ 
    164164  public IFormatReader getReader() { return reader; } 
     165 
     166  /** Sets whether the reader is using file patterns for IDs. */ 
     167  public void setUsingPatternIds(boolean patternIds) { 
     168    this.patternIds = patternIds; 
     169  } 
     170 
     171  /** Gets whether the reader is using file patterns for IDs. */ 
     172  public boolean isUsingPatternIds() { return patternIds; } 
    165173 
    166174  /** Gets the reader appropriate for use with the given image plane. */ 
     
    234242   */ 
    235243  public FilePattern findPattern(String id) { 
    236     FormatTools.assertId(currentId, true, 2); 
    237244    if (!patternIds) { 
    238245      // find the containing pattern 
     
    247254      else { 
    248255        // id is an unmapped file path; look to similar files on disk 
    249  
    250256        pattern = FilePattern.findPattern(new Location(id)); 
    251257      } 
     
    731737      } 
    732738    } 
    733     return (String[]) v.toArray(new String[0]); 
     739    return v.toArray(new String[0]); 
    734740  } 
    735741 
     
    991997      } 
    992998 
    993       seriesBlocks = (String[]) sBlock.toArray(new String[0]); 
     999      seriesBlocks = sBlock.toArray(new String[0]); 
    9941000      fileVector = new Vector<String[]>(); 
    9951001      seriesNames = new Vector<String>(); 
     
    10101016      } 
    10111017 
    1012       setFiles((String[]) tmpFiles.toArray(new String[0]), seriesBlocks[0], 
     1018      setFiles(tmpFiles.toArray(new String[0]), seriesBlocks[0], 
    10131019        fp.getFirst()[0], fp.getLast()[0], fp.getStep()[0], dpath, 0); 
    10141020 
     
    10171023 
    10181024      for (int i=0; i<seriesCount; i++) { 
    1019         files[i] = (String[]) fileVector.get(i); 
     1025        files[i] = fileVector.get(i); 
    10201026      } 
    10211027    } 
     
    13601366      } 
    13611367    } 
    1362     f = (String[]) v.toArray(new String[0]); 
     1368    f = v.toArray(new String[0]); 
    13631369    return new FilePattern(FilePattern.findPattern(f[0], dir, f)); 
    13641370  } 
Note: See TracChangeset for help on using the changeset viewer.