Changeset 1951


Ignore:
Timestamp:
12/20/06 16:40:51 (13 years ago)
Author:
curtis
Message:
  • Fix bug causing "Out of order access or missing metadata 'sizeC'." message.
  • Comment out "store.setDefaultDisplaySettings(null);" line in BaseTiffReader, because it relies on global minimum and maximum values, which are missing. This prevents a "Out of order access or missing metadata 'channelMinimum'." message.

The whole "Plane2D" thing with BaseTiffReader is still totally disjointed from
the rest of Bio-Formats; need to coordinate with Dundee developers to iron that
out.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r1821 r1951  
    520520    // to store it in instance variables. 
    521521    if (channelMinimum == null) { 
    522       Float sizeC = getPixelSizeC(i); 
     522      Integer sizeC = getSizeC(i); 
    523523      if (sizeC == null) { 
    524524        warn("Out of order access or missing metadata 'sizeC'."); 
     
    529529 
    530530    if (channelMaximum == null) { 
    531       Float sizeC = getPixelSizeC(i); 
     531      Integer sizeC = getSizeC(i); 
    532532      if (sizeC == null) { 
    533533        warn("Out of order access or missing metadata 'sizeC'."); 
     
    556556    int ndx = i == null ? 0 : i.intValue(); 
    557557 
    558     Float sizeCAsFloat = getPixelSizeC(i); 
    559     if (sizeCAsFloat == null) { 
     558    Integer sizeCAsInteger = getSizeC(i); 
     559    if (sizeCAsInteger == null) { 
    560560      warn("Out of order access or missing metadata 'sizeC'."); 
    561561      return; 
    562562    } 
    563     int sizeC = sizeCAsFloat.intValue(); 
     563    int sizeC = sizeCAsInteger.intValue(); 
    564564 
    565565    // Sanity check 
     
    749749    //log.warn(msg); 
    750750    System.err.println(msg); 
     751    new Exception(msg).printStackTrace(); 
    751752  } 
    752753 
  • trunk/loci/formats/in/BaseTiffReader.java

    r1947 r1951  
    533533    Hashtable ifd = ifds[0]; 
    534534    try { 
    535       // Set the pixel values in the metadata store. 
    536       setPixels(); 
    537  
    538       // The metadata store we're working with. 
     535      // the metadata store we're working with 
    539536      MetadataStore store = getMetadataStore(currentId); 
     537 
     538      // set the pixel values in the metadata store 
     539      store.setPixels(new Integer(getSizeX(currentId)), 
     540        new Integer(getSizeY(currentId)), new Integer(getSizeZ(currentId)), 
     541        new Integer(getSizeC(currentId)), new Integer(getSizeT(currentId)), 
     542        new Integer(getPixelType(currentId)), 
     543        new Boolean(!isLittleEndian(currentId)), 
     544        getDimensionOrder(currentId), null); 
    540545 
    541546      // populate Experimenter element 
     
    556561 
    557562      // populate Image element 
    558       setImage(); 
     563      store.setImage(getImageName(), 
     564        getImageCreationDate(), getImageDescription(), null); 
    559565 
    560566      // populate Logical Channel elements 
     
    572578      } 
    573579 
    574       //Populate the default display options 
    575       store.setDefaultDisplaySettings(null); 
    576  
    577       // Use a default "real" pixel dimension of 1 for each dimensionality. 
     580      // populate the default display options 
     581//      store.setDefaultDisplaySettings(null); 
     582 
     583      // use a default "real" pixel dimension of 1 for each dimensionality. 
    578584      Float f = new Float(1); 
    579585      store.setDimensions(f, f, f, f, f, null); 
     
    618624 
    619625  /** 
    620    * If the TIFF is big-endian. 
    621    * @return <code>true</code> if the TIFF is big-endian, <code>false</code> 
    622    * otherwise. 
    623    * @throws FormatException if there is a problem parsing this metadata. 
    624    */ 
    625   protected Boolean getBigEndian() throws FormatException { 
    626     return new Boolean(!TiffTools.isLittleEndian(ifds[0])); 
    627   } 
    628  
    629   /** 
    630626   * Retrieves the image name from the TIFF. 
    631627   * @return the image name. 
     
    842838 
    843839  // -- Helper methods -- 
    844  
    845   /** 
    846    * Performs the actual setting of the pixels attributes in the active 
    847    * metadata store by calling: 
    848    * 
    849    * <ul> 
    850    *   <li>{@link #getSizeX()}</li> 
    851    *   <li>{@link #getSizeY()}</li> 
    852    *   <li>{@link #getSizeZ()}</li> 
    853    *   <li>{@link #getSizeC()}</li> 
    854    *   <li>{@link #getSizeT()}</li> 
    855    *   <li>{@link #getPixelType()}</li> 
    856    *   <li>{@link #getDimensionOrder()}</li> 
    857    *   <li>{@link #getBigEndian()}</li> 
    858    * </ul> 
    859    * 
    860    * If the retrieval of any of these attributes is non-standard, the sub-class 
    861    * should override the corresponding method. 
    862    * @throws FormatException if there is a problem parsing any of the 
    863    * attributes. 
    864    */ 
    865   private void setPixels() throws FormatException, IOException { 
    866     getMetadataStore(currentId).setPixels( 
    867       new Integer(getSizeX(currentId)), new Integer(getSizeY(currentId)), 
    868       new Integer(getSizeZ(currentId)), new Integer(getSizeC(currentId)), 
    869       new Integer(getSizeT(currentId)), new Integer(getPixelType(currentId)), 
    870       getBigEndian(), getDimensionOrder(currentId), null); 
    871   } 
    872  
    873   /** 
    874    * Performs the actual setting of the image attributes in the active metadata 
    875    * store by calling: 
    876    * 
    877    * <ul> 
    878    *   <li>{@link #getImageName()}</li> 
    879    *   <li>{@link #getImageCreationDate()}</li> 
    880    *   <li>{@link #getgetImageDescription()}</li> 
    881    * </ul> 
    882    * 
    883    * If the retrieval of any of these attributes is non-standard, the sub-class 
    884    * should override the corresponding method. 
    885    * @throws FormatException if there is a problem parsing any of the 
    886    * attributes. 
    887    */ 
    888   private void setImage() throws FormatException, IOException { 
    889     getMetadataStore(currentId).setImage(getImageName(), 
    890         getImageCreationDate(), getImageDescription(), null); 
    891   } 
    892840 
    893841  /** 
Note: See TracChangeset for help on using the changeset viewer.