Changeset 6983


Ignore:
Timestamp:
09/24/10 13:17:50 (9 years ago)
Author:
melissa
Message:

Fixed various dimension ordering bugs in new multi-file Improvision TIFF support.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r6970 r6983  
    102102  } 
    103103 
    104   /* @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) */ 
     104  /** 
     105   * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) 
     106   */  
    105107  public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) 
    106108    throws FormatException, IOException 
     
    108110    FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); 
    109111 
    110     int file = no % files.length; 
     112    int[] zct = getZCTCoords(no); 
     113    int file = FormatTools.getIndex("XYZCT", getSizeZ(), getEffectiveSizeC(), 
     114      getSizeT(), getImageCount(), zct[0], zct[1], zct[2]) % files.length; 
    111115    int plane = no / files.length; 
    112116 
     
    217221      String currentUUID = getUUID(currentId); 
    218222 
    219       Location parent = new Location(currentId).getAbsoluteFile().getParentFile(); 
     223      Location parent = 
     224        new Location(currentId).getAbsoluteFile().getParentFile(); 
    220225      String[] list = parent.list(true); 
    221226      Arrays.sort(list); 
     
    251256 
    252257    core[0].dimensionOrder = "XY"; 
     258    if (isRGB()) core[0].dimensionOrder += "C"; 
    253259    for (int i=1; i<coords.length; i++) { 
    254260      int zDiff = coords[i][0] - coords[i - 1][0]; 
  • branches/4.2/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r6970 r6983  
    100100  } 
    101101 
    102   /* @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) */ 
     102  /** 
     103   * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) 
     104   */  
    103105  public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) 
    104106    throws FormatException, IOException 
     
    106108    FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); 
    107109 
    108     int file = no % files.length; 
     110    int[] zct = getZCTCoords(no); 
     111    int file = FormatTools.getIndex("XYZCT", getSizeZ(), getEffectiveSizeC(), 
     112      getSizeT(), getImageCount(), zct[0], zct[1], zct[2]) % files.length; 
    109113    int plane = no / files.length; 
    110114 
     
    216220      String currentUUID = getUUID(currentId); 
    217221 
    218       Location parent = new Location(currentId).getAbsoluteFile().getParentFile(); 
     222      Location parent = 
     223        new Location(currentId).getAbsoluteFile().getParentFile(); 
    219224      String[] list = parent.list(true); 
    220225      Arrays.sort(list); 
     
    252257 
    253258    core[0].dimensionOrder = "XY"; 
     259    if (isRGB()) core[0].dimensionOrder += "C"; 
    254260    for (int i=1; i<coords.length; i++) { 
    255261      int zDiff = coords[i][0] - coords[i - 1][0]; 
  • trunk/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r6970 r6983  
    100100  } 
    101101 
    102   /* @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) */ 
     102  /** 
     103   * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) 
     104   */  
    103105  public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) 
    104106    throws FormatException, IOException 
     
    106108    FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); 
    107109 
    108     int file = no % files.length; 
     110    int[] zct = getZCTCoords(no); 
     111    int file = FormatTools.getIndex("XYZCT", getSizeZ(), getEffectiveSizeC(), 
     112      getSizeT(), getImageCount(), zct[0], zct[1], zct[2]) % files.length; 
    109113    int plane = no / files.length; 
    110114 
     
    216220      String currentUUID = getUUID(currentId); 
    217221 
    218       Location parent = new Location(currentId).getAbsoluteFile().getParentFile(); 
     222      Location parent = 
     223        new Location(currentId).getAbsoluteFile().getParentFile(); 
    219224      String[] list = parent.list(true); 
    220225      Arrays.sort(list); 
     
    252257 
    253258    core[0].dimensionOrder = "XY"; 
     259    if (isRGB()) core[0].dimensionOrder += "C"; 
    254260    for (int i=1; i<coords.length; i++) { 
    255261      int zDiff = coords[i][0] - coords[i - 1][0]; 
Note: See TracChangeset for help on using the changeset viewer.