Changeset 2168


Ignore:
Timestamp:
01/26/07 16:32:16 (13 years ago)
Author:
melissa
Message:

Hopefully fixed FileStitcher to retrieve used files list from each stitched file.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r2131 r2168  
    105105  /** Constructs a FileStitcher around a new image reader. */ 
    106106  public FileStitcher() { this(new ImageReader()); } 
     107 
     108  /**  
     109   * Constructs a FileStitcher around a new image reader.  
     110   * @param patternIds Whether string ids given should be treated as file 
     111   *    patterns rather than single file paths. 
     112   */ 
     113  public FileStitcher(boolean patternIds) { 
     114    this(new ImageReader(), patternIds); 
     115  } 
    107116 
    108117  /** 
     
    412421  } 
    413422 
     423  /* @see IFormatReader#close(boolean) */ 
     424  /* 
     425  public void close(boolean fileOnly) throws FormatException, IOException { 
     426    if (readers != null) { 
     427      for (int i=0; i<readers.length; i++) readers[i].close(fileOnly); 
     428    } 
     429    if (!fileOnly) { 
     430      readers = null; 
     431      blankImage = null; 
     432      blankBytes = null; 
     433      currentId = null; 
     434    } 
     435  } 
     436  */ 
     437 
    414438  /* @see IFormatReader#close() */ 
    415439  public void close() throws FormatException, IOException { 
     
    601625    } 
    602626    files = fp.getFiles(); 
     627    String[][] s = new String[files.length][]; 
     628    int total = files.length; 
     629    for (int i=0; i<files.length; i++) { 
     630      s[i] = reader.getUsedFiles(files[i]); 
     631      total += s[i].length; 
     632    } 
     633    String[] tmp = files; 
     634    files = new String[total]; 
     635    System.arraycopy(tmp, 0, files, 0, tmp.length); 
     636    int off = tmp.length; 
     637    for (int i=0; i<s.length; i++) { 
     638      System.arraycopy(s[i], 0, files, off, s[i].length);  
     639      off += s[i].length; 
     640    } 
     641 
    603642    if (files == null) { 
    604643      throw new FormatException("No files matching pattern (" + 
  • trunk/loci/formats/in/OIFReader.java

    r2167 r2168  
    5858  private int[] validBits; 
    5959 
    60   private Vector usedFiles = new Vector(); 
     60  private Vector usedFiles; 
    6161 
    6262  // -- Constructor -- 
     
    272272    reader = new RandomAccessStream(oifFile); 
    273273 
    274     usedFiles.clear(); 
     274    usedFiles = new Vector(); 
    275275    usedFiles.add(new Location(oifFile).getAbsolutePath()); 
    276276 
     
    352352      Location dir = new Location(tiffPath); 
    353353      String[] list = dir.list(); 
    354       for (int i=0; i<list.length; i++) usedFiles.add(list[i]); 
     354      for (int i=0; i<list.length; i++) { 
     355        usedFiles.add(new Location(tiffPath, list[i]).getAbsolutePath()); 
     356      } 
    355357    } 
    356358 
Note: See TracChangeset for help on using the changeset viewer.