Changeset 7169


Ignore:
Timestamp:
11/06/10 09:50:36 (9 years ago)
Author:
melissa
Message:

Backported r6515, r6527, and most of r7071 to fix a few problems with reading certain Metamorph files.

Location:
branches/4.1/components/bio-formats/src/loci/formats/in
Files:
2 edited

Legend:

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

    r6803 r7169  
    8989    } 
    9090 
     91    if (parent.getParent() == null) return false; 
    9192    parent = parent.getParentFile(); 
    9293    if (parent == null) return false; 
  • branches/4.1/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r6923 r7169  
    116116  /** Constructs a new Metamorph reader. */ 
    117117  public MetamorphReader() { 
    118     super("Metamorph STK", new String[] {"stk", "nd"}); 
     118    super("Metamorph STK", new String[] {"stk", "nd", "tif", "tiff"}); 
    119119    domains = new String[] {FormatTools.LM_DOMAIN}; 
     120    suffixSufficient = false; 
    120121  } 
    121122 
    122123  // -- IFormatReader API methods -- 
     124 
     125  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
     126  public boolean isThisType(String name, boolean open) { 
     127    if (checkSuffix(name, "nd")) return true; 
     128    return super.isThisType(name, open); 
     129  } 
     130 
     131  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     132  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     133    TiffParser tp = new TiffParser(stream); 
     134    IFD ifd = tp.getFirstIFD(); 
     135    if (ifd == null) return false; 
     136    if (ifd.containsKey(METAMORPH_ID)) return true; 
     137    String software = ifd.getIFDTextValue(IFD.SOFTWARE); 
     138    return software != null && software.trim().startsWith("Meta"); 
     139  } 
    123140 
    124141  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
Note: See TracChangeset for help on using the changeset viewer.