Changeset 6358


Ignore:
Timestamp:
05/21/10 09:25:21 (9 years ago)
Author:
melissa
Message:

Added missing implementations of isSingleFile(String), fileGroupOption(String), and getSeriesUsedFiles(boolean).

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/BDReader.java

    r6230 r6358  
    156156  } 
    157157 
    158   /* @see IFormatReader#fileGroupOption(String) */ 
     158  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
    159159  public int fileGroupOption(String id) throws FormatException, IOException { 
    160160    return FormatTools.MUST_GROUP; 
     161  } 
     162 
     163  /* see loci.formats.IFormatReader#isSingleFile(String) */ 
     164  public boolean isSingleFile(String id) throws FormatException, IOException { 
     165    return false; 
    161166  } 
    162167 
  • branches/4.2/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r6354 r6358  
    5151import ome.xml.r201004.enums.DetectorType; 
    5252import ome.xml.r201004.enums.EnumerationException; 
    53 import ome.xml.r201004.enums.LaserMedium; 
    54 import ome.xml.r201004.enums.LaserType; 
    55 import ome.xml.r201004.primitives.PositiveInteger; 
    56  
    57 /** 
    58  * Reader is the file format reader for Metamorph STK files. 
    59  * 
    60  * <dl><dt><b>Source code:</b></dt> 
    61  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java">Trac</a>, 
    62  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java">SVN</a></dd></dl> 
    6353import ome.xml.r201004.enums.LaserMedium; 
    6454import ome.xml.r201004.enums.LaserType; 
  • branches/4.2/components/bio-formats/src/loci/formats/in/OMETiffReader.java

    r6301 r6358  
    9696    RandomAccessInputStream ras = new RandomAccessInputStream(fileName); 
    9797    TiffParser tp = new TiffParser(ras); 
    98     IFDList ifds = tp.getIFDs(); 
     98    IFD ifd = tp.getFirstIFD(); 
     99    long[] ifdOffsets = tp.getIFDOffsets(); 
    99100    ras.close(); 
    100     String xml = ifds.get(0).getComment(); 
     101    String xml = ifd.getComment(); 
    101102 
    102103    OMEXMLMetadata meta; 
     
    125126      nImages += z * t * nChannels; 
    126127    } 
    127     return nImages <= ifds.size(); 
     128    return nImages <= ifdOffsets.length; 
    128129  } 
    129130 
  • branches/4.2/components/bio-formats/src/loci/formats/in/ScanrReader.java

    r6349 r6358  
    9090 
    9191  // -- IFormatReader API methods -- 
     92 
     93  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     94  public boolean isSingleFile(String id) throws FormatException, IOException { 
     95    Location file = new Location(id).getAbsoluteFile(); 
     96    String name = file.getName(); 
     97    if (name.equals(XML_FILE) || name.equals(EXPERIMENT_FILE) || 
     98      name.equals(ACQUISITION_FILE)) 
     99    { 
     100      return true; 
     101    } 
     102    Location parent = file.getParentFile(); 
     103    if (parent != null) { 
     104      parent = parent.getParentFile(); 
     105    } 
     106    return new Location(parent, XML_FILE).exists(); 
     107  } 
    92108 
    93109  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
  • branches/4.2/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r6230 r6358  
    7171  // -- Fields -- 
    7272 
     73  private String[] pixelsFiles; 
    7374  private RandomAccessInputStream[] pixelsStream; 
    7475  private Hashtable<Integer, Double> exposureTimes; 
     
    121122      } 
    122123      pixelsStream = null; 
     124      pixelsFiles = null; 
    123125      embeddedOffset = 0; 
    124126      embeddedImages = false; 
     
    128130      dates.clear(); 
    129131    } 
     132  } 
     133 
     134  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     135  public boolean isSingleFile(String id) throws FormatException, IOException { 
     136    return !new Location(id.replaceAll(".vws", ".pst")).exists(); 
     137  } 
     138 
     139  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */ 
     140  public String[] getSeriesUsedFiles(boolean noPixels) { 
     141    FormatTools.assertId(currentId, true, 1); 
     142 
     143    Vector<String> files = new Vector<String>(); 
     144    files.add(currentId); 
     145    if (!noPixels) { 
     146      for (String file : pixelsFiles) { 
     147        if (file != null) files.add(file); 
     148      } 
     149    } 
     150    return files.toArray(new String[files.size()]); 
     151  } 
     152 
     153  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
     154  public int fileGroupOption(String id) throws FormatException, IOException { 
     155    return FormatTools.MUST_GROUP; 
    130156  } 
    131157 
     
    310336 
    311337    pixelsStream = new RandomAccessInputStream[getSeriesCount()]; 
     338    pixelsFiles = new String[getSeriesCount()]; 
    312339 
    313340    Object[] metadataKeys = tmpSeriesMetadata.keySet().toArray(); 
     
    339366        file = f.getAbsolutePath(); 
    340367        pixelsStream[i] = new RandomAccessInputStream(file); 
     368        pixelsFiles[i] = file; 
    341369 
    342370        // read key/value pairs from .inf files 
  • trunk/components/bio-formats/src/loci/formats/in/BDReader.java

    r6230 r6358  
    156156  } 
    157157 
    158   /* @see IFormatReader#fileGroupOption(String) */ 
     158  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
    159159  public int fileGroupOption(String id) throws FormatException, IOException { 
    160160    return FormatTools.MUST_GROUP; 
     161  } 
     162 
     163  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     164  public boolean isSingleFile(String id) throws FormatException, IOException { 
     165    return false; 
    161166  } 
    162167 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r6354 r6358  
    5151import ome.xml.r201004.enums.DetectorType; 
    5252import ome.xml.r201004.enums.EnumerationException; 
    53 import ome.xml.r201004.enums.LaserMedium; 
    54 import ome.xml.r201004.enums.LaserType; 
    55 import ome.xml.r201004.primitives.PositiveInteger; 
    56  
    57 /** 
    58  * Reader is the file format reader for Metamorph STK files. 
    59  * 
    60  * <dl><dt><b>Source code:</b></dt> 
    61  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java">Trac</a>, 
    62  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java">SVN</a></dd></dl> 
    6353import ome.xml.r201004.enums.LaserMedium; 
    6454import ome.xml.r201004.enums.LaserType; 
  • trunk/components/bio-formats/src/loci/formats/in/OMETiffReader.java

    r6301 r6358  
    9696    RandomAccessInputStream ras = new RandomAccessInputStream(fileName); 
    9797    TiffParser tp = new TiffParser(ras); 
    98     IFDList ifds = tp.getIFDs(); 
     98    IFD ifd = tp.getFirstIFD(); 
     99    long[] ifdOffsets = tp.getIFDOffsets(); 
    99100    ras.close(); 
    100     String xml = ifds.get(0).getComment(); 
     101    String xml = ifd.getComment(); 
    101102 
    102103    OMEXMLMetadata meta; 
     
    125126      nImages += z * t * nChannels; 
    126127    } 
    127     return nImages <= ifds.size(); 
     128    return nImages <= ifdOffsets.length; 
    128129  } 
    129130 
  • trunk/components/bio-formats/src/loci/formats/in/ScanrReader.java

    r6349 r6358  
    9090 
    9191  // -- IFormatReader API methods -- 
     92 
     93  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     94  public boolean isSingleFile(String id) throws FormatException, IOException { 
     95    Location file = new Location(id).getAbsoluteFile(); 
     96    String name = file.getName(); 
     97    if (name.equals(XML_FILE) || name.equals(EXPERIMENT_FILE) || 
     98      name.equals(ACQUISITION_FILE)) 
     99    { 
     100      return true; 
     101    } 
     102    Location parent = file.getParentFile(); 
     103    if (parent != null) { 
     104      parent = parent.getParentFile(); 
     105    } 
     106    return new Location(parent, XML_FILE).exists(); 
     107  } 
    92108 
    93109  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
  • trunk/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r6230 r6358  
    7171  // -- Fields -- 
    7272 
     73  private String[] pixelsFiles; 
    7374  private RandomAccessInputStream[] pixelsStream; 
    7475  private Hashtable<Integer, Double> exposureTimes; 
     
    120121        } 
    121122      } 
     123      pixelsFiles = null; 
    122124      pixelsStream = null; 
    123125      embeddedOffset = 0; 
     
    128130      dates.clear(); 
    129131    } 
     132  } 
     133 
     134  /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     135  public boolean isSingleFile(String id) throws FormatException, IOException { 
     136    return !new Location(id.replaceAll(".vws", ".pst")).exists(); 
     137  } 
     138 
     139  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */ 
     140  public String[] getSeriesUsedFiles(boolean noPixels) { 
     141    FormatTools.assertId(currentId, true, 1); 
     142 
     143    Vector<String> files = new Vector<String>(); 
     144    files.add(currentId); 
     145    if (!noPixels) { 
     146      for (String file : pixelsFiles) { 
     147        if (file != null) files.add(file); 
     148      } 
     149    } 
     150    return files.toArray(new String[files.size()]); 
     151  } 
     152 
     153  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
     154  public int fileGroupOption(String id) throws FormatException, IOException { 
     155    return FormatTools.MUST_GROUP; 
    130156  } 
    131157 
     
    310336 
    311337    pixelsStream = new RandomAccessInputStream[getSeriesCount()]; 
     338    pixelsFiles = new String[getSeriesCount()]; 
    312339 
    313340    Object[] metadataKeys = tmpSeriesMetadata.keySet().toArray(); 
     
    339366        file = f.getAbsolutePath(); 
    340367        pixelsStream[i] = new RandomAccessInputStream(file); 
     368        pixelsFiles[i] = file; 
    341369 
    342370        // read key/value pairs from .inf files 
Note: See TracChangeset for help on using the changeset viewer.