Changeset 5517


Ignore:
Timestamp:
09/26/09 11:54:02 (10 years ago)
Author:
melissa
Message:

Added two new methods to IFormatReader:

boolean isSingleFile(String) throws FormatException, IOException
String[] getDomains(String) throws FormatException, IOException

Location:
trunk/components
Files:
1 added
84 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/FileStitcher.java

    r5416 r5517  
    840840  } 
    841841 
     842  /* @see IFormatReader#isSingleFile(String) */ 
     843  public boolean isSingleFile(String id) throws FormatException, IOException { 
     844    return reader.isSingleFile(id); 
     845  } 
     846 
     847  /* @see IFormatReader#getDomains(String) */ 
     848  public String[] getDomains(String id) throws FormatException, IOException { 
     849    return reader.getDomains(id); 
     850  } 
     851 
     852  /* @see IFormatReader# 
     853 
    842854  // -- IFormatHandler API methods -- 
    843855 
  • trunk/components/bio-formats/src/loci/formats/FormatReader.java

    r5437 r5517  
    9494  /** Whether or not to group multi-file formats. */ 
    9595  protected boolean group = true; 
     96 
     97  /** List of domains in which this format is used. */ 
     98  protected String[] domains = new String[0]; 
    9699 
    97100  /** 
     
    879882  } 
    880883 
     884  /* @see IFormatReader#isSingleFile(String) */ 
     885  public boolean isSingleFile(String id) throws FormatException, IOException { 
     886    return true; 
     887  } 
     888 
     889  /* @see IFormatReader#getDomains(String) */ 
     890  public String[] getDomains(String id) throws FormatException, IOException { 
     891    return domains; 
     892  } 
     893 
    881894  // -- IFormatHandler API methods -- 
    882895 
  • trunk/components/bio-formats/src/loci/formats/FormatTools.java

    r5499 r5517  
    140140  /** Version number of this release. */ 
    141141  public static final String VERSION = "4.0.1"; 
     142 
     143  /** Identifies the high content screening domain. */ 
     144  public static final String HCS_DOMAIN = "High-Content Screening (HCS)"; 
     145 
     146  /** Identifies the light microscopy domain. */ 
     147  public static final String LM_DOMAIN = "Light Microscopy"; 
     148 
     149  /** Identifies the electron microscopy domain. */ 
     150  public static final String EM_DOMAIN = "Electron Microscopy (EM)"; 
     151 
     152  /** Identifies the scanning probe microscopy domain. */ 
     153  public static final String SPM_DOMAIN = "Scanning Probe Microscopy (SPM)"; 
     154 
     155  /** Identifies the scanning electron microscopy domain. */ 
     156  public static final String SEM_DOMAIN = "Scanning Electron Microscopy (SEM)"; 
     157 
     158  /** Identifies the fluorescence-lifetime domain. */ 
     159  public static final String FLIM_DOMAIN = "Fluorescence-Lifetime Imaging"; 
     160 
     161  /** Identifies the medical imaging domain. */ 
     162  public static final String MEDICAL_DOMAIN = "Medical Imaging"; 
     163 
     164  /** Identifies the histology domain. */ 
     165  public static final String HISTOLOGY_DOMAIN = "Histology"; 
     166 
     167  /** Identifies the gel and blot imaging domain. */ 
     168  public static final String GEL_DOMAIN = "Gel/Blot Imaging"; 
     169 
     170  /** Identifies the astronomy domain. */ 
     171  public static final String ASTRONOMY_DOMAIN = "Astronomy"; 
     172 
     173  /** 
     174   * Identifies the graphics domain. 
     175   * This includes formats used exclusively by analysis software. 
     176   */ 
     177  public static final String GRAPHICS_DOMAIN = "Graphics"; 
     178 
     179  /** List of all supported domains. */ 
     180  public static final String[] ALL_DOMAINS = new String[] { 
     181    HCS_DOMAIN, LM_DOMAIN, EM_DOMAIN, SPM_DOMAIN, SEM_DOMAIN, FLIM_DOMAIN, 
     182    MEDICAL_DOMAIN, HISTOLOGY_DOMAIN, GEL_DOMAIN, ASTRONOMY_DOMAIN, 
     183    GRAPHICS_DOMAIN 
     184  }; 
    142185 
    143186  // -- Constructor -- 
  • trunk/components/bio-formats/src/loci/formats/IFormatReader.java

    r5416 r5517  
    447447  IFormatReader[] getUnderlyingReaders(); 
    448448 
     449  /** 
     450   * Returns true if this is a single-file format. 
     451   */ 
     452  boolean isSingleFile(String id) throws FormatException, IOException; 
     453 
     454  /** Returns a list of scientific domains in which this format is used. */ 
     455  String[] getDomains(String id) throws FormatException, IOException; 
     456 
    449457} 
  • trunk/components/bio-formats/src/loci/formats/ImageReader.java

    r5416 r5517  
    538538  } 
    539539 
     540  /* @see IFormatReader#isSingleFile(String) */ 
     541  public boolean isSingleFile(String id) throws FormatException, IOException { 
     542    return getReader(id).isSingleFile(id); 
     543  } 
     544 
     545  /* @see IFormatReader#getDomains(String) */ 
     546  public String[] getDomains(String id) throws FormatException, IOException { 
     547    return getReader(id).getDomains(id); 
     548  } 
     549 
    540550  // -- IFormatHandler API methods -- 
    541551 
  • trunk/components/bio-formats/src/loci/formats/ReaderWrapper.java

    r5416 r5517  
    419419  public IFormatReader[] getUnderlyingReaders() { 
    420420    return new IFormatReader[] {reader}; 
     421  } 
     422 
     423  public boolean isSingleFile(String id) throws FormatException, IOException { 
     424    return reader.isSingleFile(id); 
     425  } 
     426 
     427  public String[] getDomains(String id) throws FormatException, IOException { 
     428    return reader.getDomains(id); 
    421429  } 
    422430 
  • trunk/components/bio-formats/src/loci/formats/in/APLReader.java

    r5473 r5517  
    5959  public APLReader() { 
    6060    super("Olympus APL", new String[] {"apl", "tnb", "mtb"}); 
     61    domains = new String[] {FormatTools.LM_DOMAIN}; 
    6162  } 
    6263 
    6364  // -- IFormatReader API methods -- 
     65 
     66  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     67  public boolean isSingleFile(String id) throws FormatException, IOException { 
     68    return false; 
     69  } 
    6470 
    6571  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/APNGReader.java

    r5447 r5517  
    8181  public APNGReader() { 
    8282    super("Animated PNG", "png"); 
     83    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    8384  } 
    8485 
  • trunk/components/bio-formats/src/loci/formats/in/ARFReader.java

    r5301 r5517  
    5353  public ARFReader() { 
    5454    super("ARF", "arf"); 
     55    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    5556  } 
    5657 
  • trunk/components/bio-formats/src/loci/formats/in/AVIReader.java

    r5447 r5517  
    9191    super("Audio Video Interleave", "avi"); 
    9292    suffixNecessary = false; 
     93    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    9394  } 
    9495 
  • trunk/components/bio-formats/src/loci/formats/in/AliconaReader.java

    r5473 r5517  
    6060  public AliconaReader() { 
    6161    super("Alicona AL3D", "al3d"); 
     62    domains = new String[] {FormatTools.SEM_DOMAIN}; 
    6263  } 
    6364 
  • trunk/components/bio-formats/src/loci/formats/in/AmiraReader.java

    r5471 r5517  
    6666  public AmiraReader() { 
    6767    super("Amira", new String[] {"am", "amiramesh", "grey", "hx", "labels"}); 
     68    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6869  } 
    6970 
  • trunk/components/bio-formats/src/loci/formats/in/AnalyzeReader.java

    r5416 r5517  
    6161  public AnalyzeReader() { 
    6262    super("Analyze 7.5", new String[] {"img", "hdr"}); 
     63    domains = new String[] {FormatTools.MEDICAL_DOMAIN}; 
    6364  } 
    6465 
    6566  // -- IFormatReader API methods -- 
     67 
     68  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     69  public boolean isSingleFile(String id) throws FormatException, IOException { 
     70    return false; 
     71  } 
    6672 
    6773  /** 
  • trunk/components/bio-formats/src/loci/formats/in/BMPReader.java

    r5403 r5517  
    8181  public BMPReader() { 
    8282    super("Windows Bitmap", "bmp"); 
     83    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    8384  } 
    8485 
  • trunk/components/bio-formats/src/loci/formats/in/BioRadReader.java

    r5447 r5517  
    114114  public BioRadReader() { 
    115115    super("Bio-Rad PIC", new String[] {"pic", "xml", "raw"}); 
     116    domains = new String[] {FormatTools.LM_DOMAIN}; 
    116117  } 
    117118 
    118119  // -- IFormatReader API methods -- 
     120 
     121  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     122  public boolean isSingleFile(String id) throws FormatException, IOException { 
     123    return false; 
     124  } 
    119125 
    120126  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/CellomicsReader.java

    r5477 r5517  
    5353  public CellomicsReader() { 
    5454    super("Cellomics C01", new String[] {"c01", "dib"}); 
     55    domains = new String[] {FormatTools.LM_DOMAIN, FormatTools.HCS_DOMAIN}; 
    5556  } 
    5657 
  • trunk/components/bio-formats/src/loci/formats/in/DeltavisionReader.java

    r5473 r5517  
    100100    super("Deltavision", new String[] {"dv", "r3d", "r3d_d3d"}); 
    101101    suffixSufficient = false; 
     102    domains = new String[] {FormatTools.LM_DOMAIN}; 
    102103  } 
    103104 
    104105  // -- IFormatReader API methods -- 
     106 
     107  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     108  public boolean isSingleFile(String id) throws FormatException, IOException { 
     109    return false; 
     110  } 
    105111 
    106112  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
  • trunk/components/bio-formats/src/loci/formats/in/DicomReader.java

    r5487 r5517  
    141141    suffixNecessary = false; 
    142142    suffixSufficient = false; 
     143    domains = new String[] {FormatTools.MEDICAL_DOMAIN}; 
    143144  } 
    144145 
  • trunk/components/bio-formats/src/loci/formats/in/EPSReader.java

    r5403 r5517  
    6969  public EPSReader() { 
    7070    super("Encapsulated PostScript", new String[] {"eps", "epsi", "ps"}); 
     71    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    7172  } 
    7273 
  • trunk/components/bio-formats/src/loci/formats/in/FEIReader.java

    r5403 r5517  
    5757    super("FEI", "img"); 
    5858    suffixSufficient = false; 
     59    domains = new String[] {FormatTools.SEM_DOMAIN}; 
    5960  } 
    6061 
  • trunk/components/bio-formats/src/loci/formats/in/FV1000Reader.java

    r5510 r5517  
    131131  public FV1000Reader() { 
    132132    super("Olympus FV1000", new String[] {"oib", "oif", "pty", "lut"}); 
     133    domains = new String[] {FormatTools.LM_DOMAIN}; 
    133134  } 
    134135 
    135136  // -- IFormatReader API methods -- 
     137 
     138  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     139  public boolean isSingleFile(String id) throws FormatException, IOException { 
     140    return checkSuffix(id, "oib"); 
     141  } 
    136142 
    137143  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/FitsReader.java

    r5403 r5517  
    5454 
    5555  /** Constructs a new FitsReader. */ 
    56   public FitsReader() { super("Flexible Image Transport System", "fits"); } 
     56  public FitsReader() { 
     57    super("Flexible Image Transport System", "fits"); 
     58    domains = 
     59      new String[] {FormatTools.ASTRONOMY_DOMAIN, FormatTools.GRAPHICS_DOMAIN}; 
     60  } 
    5761 
    5862  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/FlexReader.java

    r5487 r5517  
    127127 
    128128  /** Constructs a new Flex reader. */ 
    129   public FlexReader() { super("Evotec Flex", SUFFIXES); } 
     129  public FlexReader() { 
     130    super("Evotec Flex", SUFFIXES); 
     131    domains = new String[] {FormatTools.HCS_DOMAIN}; 
     132  } 
    130133 
    131134  // -- IFormatReader API methods -- 
     135 
     136  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     137  public boolean isSingleFile(String id) throws FormatException, IOException { 
     138    if (!checkSuffix(id, FLEX_SUFFIX)) return false; 
     139    return serverMap.size() == 0 || !isGroupFiles(); 
     140  } 
    132141 
    133142  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/FluoviewReader.java

    r5403 r5517  
    7878    super("Olympus Fluoview/ABD TIFF", new String[] {"tif", "tiff"}); 
    7979    suffixSufficient = false; 
     80    domains = new String[] {FormatTools.LM_DOMAIN}; 
    8081  } 
    8182 
  • trunk/components/bio-formats/src/loci/formats/in/GIFReader.java

    r5447 r5517  
    112112  public GIFReader() { 
    113113    super("Graphics Interchange Format", "gif"); 
     114    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    114115  } 
    115116 
  • trunk/components/bio-formats/src/loci/formats/in/GatanReader.java

    r5447 r5517  
    8989 
    9090  /** Constructs a new Gatan reader. */ 
    91   public GatanReader() { super("Gatan Digital Micrograph", "dm3"); } 
     91  public GatanReader() { 
     92    super("Gatan Digital Micrograph", "dm3"); 
     93    domains = new String[] {FormatTools.EM_DOMAIN}; 
     94  } 
    9295 
    9396  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/GelReader.java

    r5487 r5517  
    7676  public GelReader() { 
    7777    super("Amersham Biosciences GEL", new String[] {"gel"}); 
     78    domains = new String[] {FormatTools.GEL_DOMAIN}; 
    7879  } 
    7980 
  • trunk/components/bio-formats/src/loci/formats/in/ICSReader.java

    r5515 r5517  
    146146  public ICSReader() { 
    147147    super("Image Cytometry Standard", new String[] {"ics", "ids"}); 
     148    domains = new String[] {FormatTools.LM_DOMAIN, FormatTools.FLIM_DOMAIN, 
     149      FormatTools.GRAPHICS_DOMAIN}; 
    148150  } 
    149151 
    150152  // -- IFormatReader API methods -- 
     153 
     154  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     155  public boolean isSingleFile(String id) throws FormatException, IOException { 
     156    // check if we have a v2 ICS file - means there is no companion IDS file 
     157    RandomAccessInputStream f = new RandomAccessInputStream(id); 
     158    boolean singleFile = f.readString(17).trim().equals("ics_version\t2.0"); 
     159    f.close(); 
     160    return singleFile; 
     161  } 
    151162 
    152163  /* @see loci.formats.IFormatReader#getChannelDimLengths() */ 
  • trunk/components/bio-formats/src/loci/formats/in/IPLabReader.java

    r5403 r5517  
    6262    super("IPLab", "ipl"); 
    6363    suffixNecessary = false; // allow extensionless IPLab files 
     64    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6465  } 
    6566 
  • trunk/components/bio-formats/src/loci/formats/in/IPWReader.java

    r5447 r5517  
    7878 
    7979  /** Constructs a new IPW reader. */ 
    80   public IPWReader() { super("Image-Pro Workspace", "ipw"); } 
     80  public IPWReader() { 
     81    super("Image-Pro Workspace", "ipw"); 
     82    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     83  } 
    8184 
    8285  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/ImageIOReader.java

    r5465 r5517  
    5555 
    5656  /** Constructs a new ImageIOReader. */ 
    57   public ImageIOReader(String name, String suffix) { super(name, suffix); } 
     57  public ImageIOReader(String name, String suffix) { 
     58    super(name, suffix); 
     59    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     60  } 
    5861 
    5962  /** Constructs a new ImageIOReader. */ 
    6063  public ImageIOReader(String name, String[] suffixes) { 
    6164    super(name, suffixes); 
     65    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6266  } 
    6367 
  • trunk/components/bio-formats/src/loci/formats/in/ImarisHDFReader.java

    r5447 r5517  
    6868    super("Bitplane Imaris 5.5 (HDF)", "ims"); 
    6969    suffixSufficient = false; 
     70    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    7071  } 
    7172 
  • trunk/components/bio-formats/src/loci/formats/in/ImarisReader.java

    r5403 r5517  
    6666    super("Bitplane Imaris", "ims"); 
    6767    suffixSufficient = false; 
     68    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6869  } 
    6970 
  • trunk/components/bio-formats/src/loci/formats/in/ImarisTiffReader.java

    r5334 r5517  
    2929 
    3030import loci.formats.FormatException; 
     31import loci.formats.FormatTools; 
    3132import loci.formats.MetadataTools; 
    3233import loci.formats.meta.FilterMetadata; 
     
    5354    super("Bitplane Imaris 3 (TIFF)", "ims"); 
    5455    suffixSufficient = false; 
     56    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    5557  } 
    5658 
  • trunk/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r5403 r5517  
    2929import loci.common.RandomAccessInputStream; 
    3030import loci.formats.FormatException; 
     31import loci.formats.FormatTools; 
    3132import loci.formats.MetadataTools; 
    3233import loci.formats.meta.FilterMetadata; 
     
    5960    super("Improvision TIFF", new String[] {"tif", "tiff"}); 
    6061    suffixSufficient = false; 
     62    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6163  } 
    6264 
  • trunk/components/bio-formats/src/loci/formats/in/InCellReader.java

    r5469 r5517  
    9595    super("InCell 1000", new String[] {"xdce", "xml"}); 
    9696    suffixSufficient = false; 
     97    domains = new String[] {FormatTools.HCS_DOMAIN}; 
    9798  } 
    9899 
    99100  // -- IFormatReader API methods -- 
     101 
     102  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     103  public boolean isSingleFile(String id) throws FormatException, IOException { 
     104    return false; 
     105  } 
    100106 
    101107  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
  • trunk/components/bio-formats/src/loci/formats/in/IvisionReader.java

    r5403 r5517  
    7474  public IvisionReader() { 
    7575    super("IVision", "ipm"); 
     76    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    7677  } 
    7778 
  • trunk/components/bio-formats/src/loci/formats/in/JPEG2000Reader.java

    r5301 r5517  
    5151    super("JPEG-2000", new String[] {"jp2", "j2k"}); 
    5252    suffixSufficient = false; 
     53    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    5354  } 
    5455 
  • trunk/components/bio-formats/src/loci/formats/in/KhorosReader.java

    r5403 r5517  
    5858 
    5959  /** Constructs a new Khoros reader. */ 
    60   public KhorosReader() { super("Khoros XV", "xv"); } 
     60  public KhorosReader() { 
     61    super("Khoros XV", "xv"); 
     62    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     63  } 
    6164 
    6265  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/L2DReader.java

    r5447 r5517  
    6767  public L2DReader() { 
    6868    super("Li-Cor L2D", new String[] {"l2d", "scn"}); 
     69    domains = new String[] {FormatTools.GEL_DOMAIN}; 
    6970  } 
    7071 
    7172  // -- IFormatReader API methods -- 
     73 
     74  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     75  public boolean isSingleFile(String id) throws FormatException, IOException { 
     76    return false; 
     77  } 
    7278 
    7379  /** 
  • trunk/components/bio-formats/src/loci/formats/in/LIFReader.java

    r5447 r5517  
    164164 
    165165  /** Constructs a new Leica LIF reader. */ 
    166   public LIFReader() { super("Leica Image File Format", "lif"); } 
     166  public LIFReader() { 
     167    super("Leica Image File Format", "lif"); 
     168    domains = new String[] {FormatTools.LM_DOMAIN}; 
     169  } 
    167170 
    168171  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/LIMReader.java

    r5403 r5517  
    5050 
    5151  /** Constructs a new LIM reader. */ 
    52   public LIMReader() { super("Laboratory Imaging", "lim"); } 
     52  public LIMReader() { 
     53    super("Laboratory Imaging", "lim"); 
     54    domains = new String[] {FormatTools.LM_DOMAIN, FormatTools.GRAPHICS_DOMAIN}; 
     55  } 
    5356 
    5457  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/LegacyND2Reader.java

    r5416 r5517  
    7777  public LegacyND2Reader() { 
    7878    super("Nikon ND2 (Legacy)", new String[] {"jp2", "nd2"}); 
     79    domains = new String[] {FormatTools.LM_DOMAIN}; 
    7980  } 
    8081 
  • trunk/components/bio-formats/src/loci/formats/in/LegacyQTReader.java

    r5447 r5517  
    7474 
    7575  /** Constructs a new QT reader. */ 
    76   public LegacyQTReader() { super("QuickTime", "mov"); } 
     76  public LegacyQTReader() { 
     77    super("QuickTime", "mov"); 
     78    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     79  } 
    7780 
    7881  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/LeicaReader.java

    r5511 r5517  
    139139  public LeicaReader() { 
    140140    super("Leica", new String[] {"lei", "tif", "tiff"}); 
     141    domains = new String[] {FormatTools.LM_DOMAIN}; 
    141142  } 
    142143 
    143144  // -- IFormatReader API methods -- 
     145 
     146  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     147  public boolean isSingleFile(String id) throws FormatException, IOException { 
     148    return false; 
     149  } 
    144150 
    145151  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/LiFlimReader.java

    r5472 r5517  
    154154  public LiFlimReader() { 
    155155    super("LI-FLIM", "fli"); 
     156    domains = new String[] {FormatTools.FLIM_DOMAIN}; 
    156157  } 
    157158 
  • trunk/components/bio-formats/src/loci/formats/in/MIASReader.java

    r5489 r5517  
    9393    super("MIAS", new String[] {"tif", "tiff"}); 
    9494    suffixSufficient = false; 
     95    domains = new String[] {FormatTools.HCS_DOMAIN}; 
    9596  } 
    9697 
    9798  // -- IFormatReader API methods -- 
     99 
     100  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     101  public boolean isSingleFile(String id) throws FormatException, IOException { 
     102    return false; 
     103  } 
    98104 
    99105  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/MINCReader.java

    r5403 r5517  
    5656  public MINCReader() { 
    5757    super("MINC MRI", "mnc"); 
     58    domains = new String[] {FormatTools.MEDICAL_DOMAIN}; 
    5859  } 
    5960 
  • trunk/components/bio-formats/src/loci/formats/in/MNGReader.java

    r5447 r5517  
    6868 
    6969  /** Constructs a new MNG reader. */ 
    70   public MNGReader() { super("Multiple Network Graphics", "mng"); } 
     70  public MNGReader() { 
     71    super("Multiple Network Graphics", "mng"); 
     72    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     73  } 
    7174 
    7275  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/MRCReader.java

    r5403 r5517  
    6666  public MRCReader() { 
    6767    super("Medical Research Council", "mrc"); 
     68    domains = new String[] {FormatTools.MEDICAL_DOMAIN, FormatTools.LM_DOMAIN}; 
    6869  } 
    6970 
  • trunk/components/bio-formats/src/loci/formats/in/MRWReader.java

    r5403 r5517  
    6969  public MRWReader() { 
    7070    super("Minolta MRW", "mrw"); 
     71    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    7172  } 
    7273 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r5447 r5517  
    117117  public MetamorphReader() { 
    118118    super("Metamorph STK", new String[] {"stk", "nd"}); 
     119    domains = new String[] {FormatTools.LM_DOMAIN}; 
    119120  } 
    120121 
    121122  // -- IFormatReader API methods -- 
     123 
     124  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     125  public boolean isSingleFile(String id) throws FormatException, IOException { 
     126    return !checkSuffix(id, ND_SUFFIX); 
     127  } 
    122128 
    123129  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphTiffReader.java

    r5447 r5517  
    3131import loci.common.XMLTools; 
    3232import loci.formats.FormatException; 
     33import loci.formats.FormatTools; 
    3334import loci.formats.MetadataTools; 
    3435import loci.formats.meta.FilterMetadata; 
     
    5556    super("Metamorph TIFF", new String[] {"tif", "tiff"}); 
    5657    suffixSufficient = false; 
     58    domains = new String[] {FormatTools.LM_DOMAIN}; 
    5759  } 
    5860 
  • trunk/components/bio-formats/src/loci/formats/in/MicromanagerReader.java

    r5447 r5517  
    8484  public MicromanagerReader() { 
    8585    super("Micro-Manager", new String[] {"tif", "tiff", "txt"}); 
     86    domains = new String[] {FormatTools.LM_DOMAIN}; 
    8687  } 
    8788 
    8889  // -- IFormatReader API methods -- 
     90 
     91  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     92  public boolean isSingleFile(String id) throws FormatException, IOException { 
     93    return false; 
     94  } 
    8995 
    9096  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/MinimalTiffReader.java

    r5403 r5517  
    6464  public MinimalTiffReader() { 
    6565    super("Minimal TIFF", new String[] {"tif", "tiff"}); 
     66    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6667  } 
    6768 
  • trunk/components/bio-formats/src/loci/formats/in/NAFReader.java

    r5403 r5517  
    5858 
    5959  /** Constructs a new NAF reader. */ 
    60   public NAFReader() { super("Hamamatsu Aquacosmos", "naf"); } 
     60  public NAFReader() { 
     61    super("Hamamatsu Aquacosmos", "naf"); 
     62    domains = new String[] {FormatTools.LM_DOMAIN}; 
     63  } 
    6164 
    6265  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/ND2Reader.java

    r5093 r5517  
    2525 
    2626import loci.formats.DelegateReader; 
     27import loci.formats.FormatTools; 
    2728 
    2829/** 
     
    4950    nativeReaderInitialized = false; 
    5051    legacyReaderInitialized = false; 
     52    domains = new String[] {FormatTools.LM_DOMAIN}; 
    5153  } 
    5254 
  • trunk/components/bio-formats/src/loci/formats/in/NRRDReader.java

    r5416 r5517  
    7171  public NRRDReader() { 
    7272    super("NRRD", new String[] {"nrrd", "nhdr"}); 
     73    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    7374  } 
    7475 
    7576  // -- IFormatReader API methods -- 
     77 
     78  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     79  public boolean isSingleFile(String id) throws FormatException, IOException { 
     80    return checkSuffix(id, "nrrd"); 
     81  } 
    7682 
    7783  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
  • trunk/components/bio-formats/src/loci/formats/in/NativeND2Reader.java

    r5473 r5517  
    102102    super("Nikon ND2", new String[] {"nd2", "jp2"}); 
    103103    suffixSufficient = false; 
     104    domains = new String[] {FormatTools.LM_DOMAIN}; 
    104105  } 
    105106 
  • trunk/components/bio-formats/src/loci/formats/in/NativeQTReader.java

    r5403 r5517  
    123123    super("QuickTime", "mov"); 
    124124    suffixNecessary = false; 
     125    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    125126  } 
    126127 
  • trunk/components/bio-formats/src/loci/formats/in/NiftiReader.java

    r5416 r5517  
    7777    super("NIfTI", new String[] {"nii", "img", "hdr"}); 
    7878    suffixSufficient = false; 
     79    domains = new String[] {FormatTools.MEDICAL_DOMAIN, FormatTools.LM_DOMAIN, 
     80      FormatTools.GRAPHICS_DOMAIN}; 
    7981  } 
    8082 
    8183  // -- IFormatReader API methods -- 
     84 
     85  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     86  public boolean isSingleFile(String id) throws FormatException, IOException { 
     87    return checkSuffix(id, "nii"); 
     88  } 
    8289 
    8390  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/NikonReader.java

    r5403 r5517  
    142142    super("Nikon NEF", new String[] {"nef", "tif", "tiff"}); 
    143143    suffixSufficient = false; 
     144    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    144145  } 
    145146 
  • trunk/components/bio-formats/src/loci/formats/in/NikonTiffReader.java

    r5403 r5517  
    2929import loci.common.RandomAccessInputStream; 
    3030import loci.formats.FormatException; 
     31import loci.formats.FormatTools; 
    3132import loci.formats.MetadataTools; 
    3233import loci.formats.meta.FilterMetadata; 
     
    6768    super("Nikon TIFF", new String[] {"tif", "tiff"}); 
    6869    suffixSufficient = false; 
     70    domains = new String[] {FormatTools.LM_DOMAIN}; 
    6971  } 
    7072 
  • trunk/components/bio-formats/src/loci/formats/in/OMETiffReader.java

    r5516 r5517  
    4242import loci.formats.meta.IMetadata; 
    4343import loci.formats.tiff.IFD; 
     44import loci.formats.tiff.IFDList; 
    4445import loci.formats.tiff.PhotoInterp; 
    4546import loci.formats.tiff.TiffParser; 
     
    7374    suffixNecessary = false; 
    7475    suffixSufficient = false; 
     76    domains = FormatTools.ALL_DOMAINS; 
    7577  } 
    7678 
    7779  // -- IFormatReader API methods -- 
     80 
     81  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     82  public boolean isSingleFile(String id) throws FormatException, IOException { 
     83    // parse and populate OME-XML metadata 
     84    String fileName = new Location(id).getAbsoluteFile().getAbsolutePath(); 
     85    RandomAccessInputStream ras = new RandomAccessInputStream(fileName); 
     86    TiffParser tp = new TiffParser(ras); 
     87    IFDList ifds = tp.getIFDs(); 
     88    ras.close(); 
     89    String xml = ifds.get(0).getComment(); 
     90    IMetadata meta = MetadataTools.createOMEXMLMetadata(xml); 
     91 
     92    if (meta == null) { 
     93      throw new FormatException("ome-xml.jar is required to read OME-TIFF " + 
     94        "files.  Please download it from " + 
     95        "http://loci.wisc.edu/ome/formats-library.html"); 
     96    } 
     97 
     98    if (meta.getRoot() == null) { 
     99      throw new FormatException("Could not parse OME-XML from TIFF comment"); 
     100    } 
     101 
     102    int nImages = 0; 
     103    for (int i=0; i<meta.getImageCount(); i++) { 
     104      int nChannels = meta.getLogicalChannelCount(i); 
     105      if (nChannels == 0) nChannels = 1; 
     106      for (int p=0; p<meta.getPixelsCount(i); p++) { 
     107        int z = meta.getPixelsSizeZ(i, p).intValue(); 
     108        int t = meta.getPixelsSizeT(i, p).intValue(); 
     109        nImages += z * t * nChannels; 
     110      } 
     111    } 
     112    return nImages <= ifds.size(); 
     113  } 
    78114 
    79115  /* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */ 
  • trunk/components/bio-formats/src/loci/formats/in/OMEXMLReader.java

    r5447 r5517  
    9494  public OMEXMLReader() { 
    9595    super("OME-XML", "ome"); 
     96    domains = FormatTools.ALL_DOMAINS; 
    9697  } 
    9798 
  • trunk/components/bio-formats/src/loci/formats/in/OpenlabRawReader.java

    r5403 r5517  
    6666    super("Openlab RAW", "raw"); 
    6767    suffixSufficient = false; 
     68    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6869  } 
    6970 
  • trunk/components/bio-formats/src/loci/formats/in/OpenlabReader.java

    r5447 r5517  
    116116    super("Openlab LIFF", "liff"); 
    117117    suffixNecessary = false; 
     118    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    118119  } 
    119120 
  • trunk/components/bio-formats/src/loci/formats/in/PCIReader.java

    r5447 r5517  
    7171  public PCIReader() { 
    7272    super("Compix Simple-PCI", "cxd"); 
     73    domains = new String[] {FormatTools.LM_DOMAIN}; 
    7374  } 
    7475 
  • trunk/components/bio-formats/src/loci/formats/in/PCXReader.java

    r5403 r5517  
    6464  public PCXReader() { 
    6565    super("PCX", "pcx"); 
     66    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6667  } 
    6768 
  • trunk/components/bio-formats/src/loci/formats/in/PGMReader.java

    r5403 r5517  
    6363  public PGMReader() { 
    6464    super("Portable Gray Map", "pgm"); 
     65    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6566  } 
    6667 
  • trunk/components/bio-formats/src/loci/formats/in/PSDReader.java

    r5403 r5517  
    6464  public PSDReader() { 
    6565    super("Adobe Photoshop", "psd"); 
     66    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    6667  } 
    6768 
  • trunk/components/bio-formats/src/loci/formats/in/PerkinElmerReader.java

    r5478 r5517  
    9595    super("PerkinElmer", new String[] { 
    9696      "ano", "cfg", "csv", "htm", "rec", "tim", "zpo"}); 
     97    domains = new String[] {FormatTools.LM_DOMAIN}; 
    9798  } 
    9899 
    99100  // -- IFormatReader API methods -- 
     101 
     102  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     103  public boolean isSingleFile(String id) throws FormatException, IOException { 
     104    return false; 
     105  } 
    100106 
    101107  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/PictReader.java

    r5403 r5517  
    100100  public PictReader() { 
    101101    super("PICT", new String[] {"pict", "pct"}); 
     102    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    102103  } 
    103104 
  • trunk/components/bio-formats/src/loci/formats/in/PrairieReader.java

    r5447 r5517  
    9393  public PrairieReader() { 
    9494    super("Prairie TIFF", new String[] {"tif", "tiff", "cfg", "xml"}); 
     95    domains = new String[] {FormatTools.LM_DOMAIN}; 
    9596  } 
    9697 
    9798  // -- IFormatReader API methods -- 
     99 
     100  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     101  public boolean isSingleFile(String id) throws FormatException, IOException { 
     102    return false; 
     103  } 
    98104 
    99105  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/QTReader.java

    r5093 r5517  
    2525 
    2626import loci.formats.DelegateReader; 
     27import loci.formats.FormatTools; 
    2728 
    2829/** 
     
    4950    nativeReaderInitialized = false; 
    5051    legacyReaderInitialized = false; 
     52    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
    5153  } 
    5254 
  • trunk/components/bio-formats/src/loci/formats/in/SDTReader.java

    r5403 r5517  
    6969  public SDTReader() { 
    7070    super("SPCImage Data", "sdt"); 
     71    domains = new String[] {FormatTools.FLIM_DOMAIN}; 
    7172  } 
    7273 
  • trunk/components/bio-formats/src/loci/formats/in/SEQReader.java

    r5271 r5517  
    2828 
    2929import loci.formats.FormatException; 
     30import loci.formats.FormatTools; 
    3031import loci.formats.tiff.IFD; 
    3132 
     
    5556 
    5657  /** Constructs a new Image-Pro SEQ reader. */ 
    57   public SEQReader() { super("Image-Pro Sequence", "seq"); } 
     58  public SEQReader() { 
     59    super("Image-Pro Sequence", "seq"); 
     60    domains = new String[] {FormatTools.GRAPHICS_DOMAIN}; 
     61  } 
    5862 
    5963  // -- Internal BaseTiffReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/SVSReader.java

    r5403 r5517  
    5252 
    5353  /** Constructs a new SVS reader. */ 
    54   public SVSReader() { super("Aperio SVS", new String[] {"svs"}); } 
     54  public SVSReader() { 
     55    super("Aperio SVS", new String[] {"svs"}); 
     56    domains = new String[] {FormatTools.HISTOLOGY_DOMAIN}; 
     57  } 
    5558 
    5659  // -- IFormatReader API methods -- 
  • trunk/components/bio-formats/src/loci/formats/in/SlidebookReader.java

    r5447 r5517  
    6666  public SlidebookReader() { 
    6767    super("Olympus Slidebook", "sld"); 
     68    domains = new String[] {FormatTools.LM_DOMAIN}; 
    6869  } 
    6970 
  • trunk/components/bio-formats/src/loci/formats/in/TCSReader.java

    r5473 r5517  
    8686  public TCSReader() { 
    8787    super("Leica TCS TIFF", new String[] {"tif", "tiff", "xml"}); 
     88    domains = new String[] {FormatTools.LM_DOMAIN}; 
    8889  } 
    8990 
    9091  // -- IFormatReader API methods -- 
     92 
     93  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     94  public boolean isSingleFile(String id) throws FormatException, IOException { 
     95    if (checkSuffix(id, "xml")) return false; 
     96    Location file = new Location(id); 
     97    String[] list = file.getParentFile().list(); 
     98    for (String f : list) { 
     99      if (checkSuffix(f, "xml") && DataTools.samePrefix(file.getName(), f)) { 
     100        return false; 
     101      } 
     102    } 
     103    return true; 
     104  } 
    91105 
    92106  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r5473 r5517  
    7474  public TillVisionReader() { 
    7575    super("TillVision", "vws"); 
     76    domains = new String[] {FormatTools.LM_DOMAIN}; 
    7677  } 
    7778 
  • trunk/components/bio-formats/src/loci/formats/in/VisitechReader.java

    r5473 r5517  
    6363    super("Visitech XYS", new String[] {"xys", "html"}); 
    6464    suffixSufficient = false; 
     65    domains = new String[] {FormatTools.LM_DOMAIN}; 
    6566  } 
    6667 
    6768  // -- IFormatReader API methods -- 
     69 
     70  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     71  public boolean isSingleFile(String id) throws FormatException, IOException { 
     72    return false; 
     73  } 
    6874 
    6975  /* @see loci.formats.IFormatReader#isThisType(String, boolean) */ 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r5494 r5517  
    167167  public ZeissLSMReader() { 
    168168    super("Zeiss Laser-Scanning Microscopy", new String[] {"lsm", "mdb"}); 
     169    domains = new String[] {FormatTools.LM_DOMAIN}; 
    169170  } 
    170171 
    171172  // -- IFormatReader API methods -- 
     173 
     174  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     175  public boolean isSingleFile(String id) throws FormatException, IOException { 
     176    if (checkSuffix(id, MDB_SUFFIX)) return false; 
     177    if (isGroupFiles()) { 
     178      // look for an .mdb file 
     179      Location parentFile = new Location(id).getAbsoluteFile().getParentFile(); 
     180      String[] fileList = parentFile.list(); 
     181      for (int i=0; i<fileList.length; i++) { 
     182        if (fileList[i].startsWith(".")) continue; 
     183        if (checkSuffix(fileList[i], MDB_SUFFIX)) { 
     184          Location file = 
     185            new Location(parentFile, fileList[i]).getAbsoluteFile(); 
     186          if (file.isDirectory()) continue; 
     187          // make sure that the .mdb references this .lsm 
     188          String[] lsms = parseMDB(file.getAbsolutePath()); 
     189          for (String lsm : lsms) { 
     190            if (id.endsWith(lsm) || lsm.endsWith(id)) { 
     191              return false; 
     192            } 
     193          } 
     194        } 
     195      } 
     196    } 
     197    return true; 
     198  } 
    172199 
    173200  /* @see loci.formats.IFormatReader#close(boolean) */ 
     
    12451272        for (int col=0; col<tableRow.length; col++) { 
    12461273          String key = tableName + " " + columnNames[col + 1] + " " + row; 
    1247           addGlobalMeta(key, tableRow[col]); 
     1274          if (currentId != null) { 
     1275            addGlobalMeta(key, tableRow[col]); 
     1276          } 
    12481277 
    12491278          if (tableName.equals("Recordings") && columnNames[col + 1] != null && 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r5473 r5517  
    108108    super("Zeiss Vision Image (ZVI)", "zvi"); 
    109109    suffixNecessary = false; 
     110    domains = new String[] {FormatTools.LM_DOMAIN}; 
    110111  } 
    111112 
Note: See TracChangeset for help on using the changeset viewer.