Changeset 5971 for branches/cleanup


Ignore:
Timestamp:
02/26/10 14:33:49 (10 years ago)
Author:
melissa
Message:

Added missing isThisType(RandomAccessInputStream) implementations to several TIFF-based readers.

Location:
branches/cleanup/components/bio-formats/src/loci/formats/in
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/components/bio-formats/src/loci/formats/in/GelReader.java

    r5624 r5971  
    2828import loci.common.DataTools; 
    2929import loci.common.DateTools; 
     30import loci.common.RandomAccessInputStream; 
    3031import loci.formats.FormatException; 
    3132import loci.formats.FormatTools; 
     
    3536import loci.formats.tiff.IFD; 
    3637import loci.formats.tiff.IFDList; 
     38import loci.formats.tiff.TiffParser; 
    3739import loci.formats.tiff.TiffRational; 
    3840 
     
    8082 
    8183  // -- IFormatReader API methods -- 
     84 
     85  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     86  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     87    TiffParser parser = new TiffParser(stream); 
     88    IFD ifd = parser.getFirstIFD(); 
     89    if (ifd == null) return false; 
     90    return ifd.containsKey(MD_FILETAG); 
     91  } 
    8292 
    8393  /** 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/ImaconReader.java

    r5969 r5971  
    4040import loci.formats.tiff.IFDList; 
    4141import loci.formats.tiff.PhotoInterp; 
     42import loci.formats.tiff.TiffParser; 
    4243 
    4344import org.xml.sax.Attributes; 
     
    7677  // -- IFormatReader API methods -- 
    7778 
     79  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     80  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     81    TiffParser parser = new TiffParser(stream); 
     82    IFD ifd = parser.getFirstIFD(); 
     83    if (ifd == null) return false; 
     84    return ifd.containsKey(XML_TAG); 
     85  } 
     86 
    7887  /* @see loci.formats.IFormatReader#close(boolean) */ 
    7988  public void close(boolean fileOnly) throws IOException { 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/ImarisTiffReader.java

    r5852 r5971  
    5454    super("Bitplane Imaris 3 (TIFF)", "ims"); 
    5555    suffixSufficient = false; 
     56    suffixNecessary = true; 
    5657    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    5758  } 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/LEOReader.java

    r5830 r5971  
    2828 
    2929import loci.common.DateTools; 
     30import loci.common.RandomAccessInputStream; 
    3031import loci.formats.FormatException; 
    3132import loci.formats.FormatTools; 
     
    3334import loci.formats.meta.MetadataStore; 
    3435import loci.formats.tiff.IFD; 
     36import loci.formats.tiff.TiffParser; 
    3537 
    3638/** 
     
    6163    super("LEO", "sxm"); 
    6264    domains = new String[] {FormatTools.EM_DOMAIN}; 
     65  } 
     66 
     67  // -- IFormatReader API methods -- 
     68 
     69  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     70  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     71    TiffParser parser = new TiffParser(stream); 
     72    IFD ifd = parser.getFirstIFD(); 
     73    if (ifd == null) return false; 
     74    return ifd.containsKey(LEO_TAG); 
    6375  } 
    6476 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r5969 r5971  
    121121 
    122122  // -- IFormatReader API methods -- 
     123 
     124  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     125  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     126    TiffParser tp = new TiffParser(stream); 
     127    IFD ifd = tp.getFirstIFD(); 
     128    if (ifd == null) return false; 
     129    return ifd.containsKey(METAMORPH_ID); 
     130  } 
    123131 
    124132  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/SEQReader.java

    r5517 r5971  
    2727import java.util.StringTokenizer; 
    2828 
     29import loci.common.RandomAccessInputStream; 
    2930import loci.formats.FormatException; 
    3031import loci.formats.FormatTools; 
    3132import loci.formats.tiff.IFD; 
     33import loci.formats.tiff.TiffParser; 
    3234 
    3335/** 
     
    5961    super("Image-Pro Sequence", "seq"); 
    6062    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     63  } 
     64 
     65  // -- IFormatReader API methods -- 
     66 
     67  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     68  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     69    TiffParser parser = new TiffParser(stream); 
     70    IFD ifd = parser.getFirstIFD(); 
     71    if (ifd == null) return false; 
     72    return ifd.containsKey(IMAGE_PRO_TAG_1); 
    6173  } 
    6274 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/SVSReader.java

    r5969 r5971  
    5353    super("Aperio SVS", new String[] {"svs"}); 
    5454    domains = new String[] {FormatTools.HISTOLOGY_DOMAIN}; 
     55    suffixNecessary = true; 
    5556  } 
    5657 
Note: See TracChangeset for help on using the changeset viewer.