Changeset 1843


Ignore:
Timestamp:
11/22/06 09:27:14 (13 years ago)
Author:
melissa
Message:
  • Removed ImageTools stuff from todo list.
  • Minor tweaks and bugfixes.
Location:
trunk/loci/formats
Files:
8 edited

Legend:

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

    r1838 r1843  
    4444  public boolean canMerge(String id) throws FormatException, IOException { 
    4545    int c = getSizeC(id); 
    46     return c > 1 && c <= 4 && !(c >= 3 && reader.isRGB(id)); 
     46    return c > 1 && c <= 4 && !(c > 1 && reader.isRGB(id)); 
    4747  } 
    4848 
  • trunk/loci/formats/ImageTools.java

    r1842 r1843  
    925925      rtn[1][i] = (byte) ((pix[i] >> 8) & 0xff); 
    926926      byte b = (byte) (pix[i] & 0xff); 
    927       rtn[0][i] = reverse ? b : r; 
    928       rtn[2][i] = reverse ? r : b; 
     927      rtn[0][i] = reverse ? r : b; 
     928      rtn[2][i] = reverse ? b : r; 
    929929    } 
    930930    return rtn; 
  • trunk/loci/formats/in/ImarisTiffReader.java

    r1826 r1843  
    5757 
    5858    int ifdlocation = DataTools.bytesToInt(block, 4, little); 
    59     if (ifdlocation < 0 || ifdlocation + 1 > block.length) { 
    60       return false; 
    61     } 
     59    if (ifdlocation < 0) return false; 
     60    else if (ifdlocation + 1 > block.length) return true; 
    6261    else { 
    6362      int ifdnumber = DataTools.bytesToInt(block, ifdlocation, 2, little); 
     
    9594  // -- Internal BaseTiffReader API methods -- 
    9695 
     96  /* @see BaseTiffReader#getImageCount(String) */ 
    9797  public int getImageCount(String id) throws FormatException, IOException { 
    9898    if (!id.equals(currentId)) initFile(id); 
    9999    return numImages; 
     100  } 
     101 
     102  /* @see BaseTiffReader#isInterleaved(String) */ 
     103  public boolean isInterleaved(String id) throws FormatException, IOException { 
     104    if (!id.equals(currentId)) initFile(id); 
     105    return false; 
    100106  } 
    101107 
  • trunk/loci/formats/in/MetamorphReader.java

    r1834 r1843  
    126126          if (uic1[i] >= in.length() / 2) { 
    127127            in.seek(uic1[i] + 12); 
    128             while (in.getFilePointer() < in.length()) { 
    129               // read a null-terminated string (key), followed by an int value 
    130               StringBuffer sb = new StringBuffer(); 
    131               char c = (char) in.read(); 
    132               while (c != 0 || sb.length() < 128) { 
    133                 sb = sb.append(c); 
    134                 c = (char) in.read(); 
     128          
     129            // read a null-terminated string (key), followed by an int value 
     130               
     131            byte[] b = new byte[(int) (in.length() - in.getFilePointer())]; 
     132            in.read(b); 
     133 
     134            StringBuffer sb = new StringBuffer(new String(b)); 
     135 
     136            int pt = 0; 
     137            while (pt < sb.length()) {   
     138              if (!Character.isDefined(sb.charAt(i))) { 
     139                sb = sb.deleteCharAt(i); 
    135140              } 
    136  
    137               String key = sb.toString().trim(); 
    138               int value = in.readInt(); 
    139               if (!key.trim().equals("") && key.trim().length() > 3 && 
    140                 key.trim().indexOf("?") == -1) 
    141               { 
    142                 metadata.put(key, new Integer(value)); 
    143               } 
     141              else pt++; 
    144142            } 
     143 
     144            metadata.put("Extra data", sb.toString().trim()); 
    145145          } 
    146146        } 
  • trunk/loci/formats/in/ND2Reader.java

    r1834 r1843  
    114114  /** Returns whether or not the channels are interleaved. */ 
    115115  public boolean isInterleaved(String id) throws FormatException, IOException { 
    116     return true; 
     116    return false; 
    117117  } 
    118118 
  • trunk/loci/formats/in/OIBReader.java

    r1817 r1843  
    147147  /** Returns whether or not the channels are interleaved. */ 
    148148  public boolean isInterleaved(String id) throws FormatException, IOException { 
    149     return true; 
     149    return false; 
    150150  } 
    151151 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r1781 r1843  
    435435      channels = cSize; 
    436436 
    437       // some LSM files will have a thumbnail associated with each plane; this 
    438       // thumbnail is counted as an extra channel, but since we strip out the 
    439       // thumbnails, we need to correct the channel count 
    440       while (zSize * cSize * tSize > numImages) { 
    441         cSize--; 
    442       } 
    443  
    444       if (cSize == 0) cSize++; 
    445  
    446       if (isRGB(currentId) && cSize == 1 && channels > 2) cSize = 3; 
    447  
    448       channels = cSize; 
    449  
    450       while (numImages > zSize * cSize * tSize) { 
     437      if (channels == 0) channels++; 
     438      if (channels == 2) channels--; 
     439 
     440      while (numImages > zSize * channels * tSize) { 
    451441        if (zSize > tSize) zSize++; 
    452442        else tSize++; 
     
    460450        new Integer(imageLength), // SizeY 
    461451        new Integer(zSize), // SizeZ 
    462         new Integer(cSize), // SizeC 
     452        new Integer(channels), // SizeC 
    463453        new Integer(tSize), // SizeT 
    464454        new Integer(pixelType[0]), // PixelType 
  • trunk/loci/formats/todo.txt

    r1777 r1843  
    1010* Anything listed online: http://www.loci.wisc.edu/ome/formats.html 
    1111* MNG (low) 
    12  
    13 API/Other: 
    14 * improve efficiency of BufferedImage construction and 
    15   harvesting pixels from a BufferedImage 
Note: See TracChangeset for help on using the changeset viewer.