Changeset 3219


Ignore:
Timestamp:
10/02/07 11:03:13 (12 years ago)
Author:
melissa
Message:

Fixed how files are grouped.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/OMETiffReader.java

    r3199 r3219  
    9494    FormatTools.checkPlaneNumber(this, no); 
    9595    FormatTools.checkBufferSize(this, buf.length); 
     96 
     97    if (used.length == 1) { 
     98      TiffTools.getSamples(ifds[no], in, buf); 
     99      return swapIfRequired(buf); 
     100    } 
    96101 
    97102    int[] zct = getZCTCoords(no); 
     
    133138 
    134139    for (int i=0; i<fileList.length; i++) { 
    135       Hashtable ifd = TiffTools.getFirstIFD(new RandomAccessStream( 
    136         l.getAbsolutePath() + File.separator + fileList[i])); 
    137       if (ifd == null) continue; 
    138       String comment = 
    139         (String) TiffTools.getIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION); 
    140       tempComments.add(comment); 
    141       ndx = comment.indexOf("<Image"); 
    142       ndx = comment.indexOf("ID=\"", ndx); 
    143       comment = comment.substring(ndx + 4, comment.indexOf("\"", ndx + 5)); 
    144  
    145140      String check = fileList[i].toLowerCase(); 
    146       if ((check.endsWith(".tif") || check.endsWith(".tiff")) && 
    147         comment.equals(imageId)) 
    148       { 
    149         files.add(l.getAbsolutePath() + File.separator + fileList[i]); 
     141      if (check.endsWith(".tif") || check.endsWith(".tiff")) { 
     142        Hashtable ifd = TiffTools.getFirstIFD(new RandomAccessStream( 
     143          l.getAbsolutePath() + File.separator + fileList[i])); 
     144        if (ifd == null) continue; 
     145        String comment = 
     146          (String) TiffTools.getIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION); 
     147        tempComments.add(comment); 
     148        ndx = comment.indexOf("<Image"); 
     149        ndx = comment.indexOf("ID=\"", ndx); 
     150        if (ndx > -1) { 
     151          comment = comment.substring(ndx + 4, comment.indexOf("\"", ndx + 5)); 
     152          if (comment.equals(imageId)) { 
     153            files.add(l.getAbsolutePath() + File.separator + fileList[i]); 
     154          } 
     155        } 
    150156      } 
    151157    } 
     
    294300        core.currentOrder[i] = pixels[i].getAttribute("DimensionOrder"); 
    295301        core.orderCertain[i] = true; 
     302 
     303        if ((core.rgb[i] && (core.sizeZ[i] * core.sizeT[i] == ifds.length)) || 
     304          (core.sizeC[i] * core.sizeZ[i] * core.sizeT[i] == ifds.length)) 
     305        { 
     306          used = new String[] {currentId}; 
     307        } 
    296308 
    297309        boolean[][][] zct = new boolean[core.sizeZ[i]][sc][core.sizeT[i]]; 
Note: See TracChangeset for help on using the changeset viewer.