Changeset 7152


Ignore:
Timestamp:
11/04/10 10:26:12 (9 years ago)
Author:
melissa
Message:

Allow .rec extension for MRC files. isThisType(RandomAccessInputStream) is now overridden, so that Perkin Elmer .rec files are not accidentally picked up.

Files:
3 edited

Legend:

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

    r5517 r7152  
    5050    new String[] {"mono", "tilt", "tilts", "lina", "lins"}; 
    5151 
     52  private static final String[] MRC_SUFFIXES = 
     53    {"mrc", "st", "ali", "map", "rec"}; 
     54 
     55  private static final int HEADER_SIZE = 1024; 
     56 
    5257  // -- Fields -- 
    5358 
     
    6570  /** Constructs a new MRC reader. */ 
    6671  public MRCReader() { 
    67     super("Medical Research Council", "mrc"); 
     72    super("Medical Research Council", MRC_SUFFIXES); 
    6873    domains = new String[] {FormatTools.MEDICAL_DOMAIN, FormatTools.LM_DOMAIN}; 
     74    suffixSufficient = false; 
    6975  } 
    7076 
    7177  // -- IFormatReader API methods -- 
     78 
     79  /** @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     80  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     81    return FormatTools.validStream(stream, HEADER_SIZE, false); 
     82  } 
    7283 
    7384  /** 
  • branches/4.2/components/bio-formats/src/loci/formats/in/MRCReader.java

    r7007 r7152  
    5353  // there, according to: http://bio3d.colorado.edu/imod/doc/mrc_format.txt 
    5454 
    55   private static final String[] MRC_SUFFIXES = {"mrc", "st", "ali", "map"}; 
     55  private static final String[] MRC_SUFFIXES = 
     56    {"mrc", "st", "ali", "map", "rec"}; 
    5657 
    5758  private static final int HEADER_SIZE = 1024; 
     
    6970    super("Medical Research Council", MRC_SUFFIXES); 
    7071    domains = new String[] {FormatTools.MEDICAL_DOMAIN, FormatTools.LM_DOMAIN}; 
     72    suffixSufficient = false; 
    7173  } 
    7274 
    7375  // -- IFormatReader API methods -- 
     76 
     77  /** @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     78  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     79    return FormatTools.validStream(stream, HEADER_SIZE, false); 
     80  } 
    7481 
    7582  /** 
  • trunk/components/bio-formats/src/loci/formats/in/MRCReader.java

    r6881 r7152  
    5353  // there, according to: http://bio3d.colorado.edu/imod/doc/mrc_format.txt 
    5454 
    55   private static final String[] MRC_SUFFIXES = {"mrc", "st", "ali", "map"}; 
     55  private static final String[] MRC_SUFFIXES = 
     56    {"mrc", "st", "ali", "map", "rec"}; 
    5657 
    5758  private static final int HEADER_SIZE = 1024; 
     
    6970    super("Medical Research Council", MRC_SUFFIXES); 
    7071    domains = new String[] {FormatTools.MEDICAL_DOMAIN, FormatTools.LM_DOMAIN}; 
     72    suffixSufficient = false; 
    7173  } 
    7274 
    7375  // -- IFormatReader API methods -- 
     76 
     77  /** @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
     78  public boolean isThisType(RandomAccessInputStream stream) throws IOException { 
     79    return FormatTools.validStream(stream, HEADER_SIZE, false); 
     80  } 
    7481 
    7582  /** 
Note: See TracChangeset for help on using the changeset viewer.