Changeset 2182


Ignore:
Timestamp:
01/30/07 09:11:51 (13 years ago)
Author:
melissa
Message:
  • Added new API method to IFormatReader - "void close(boolean)" - if the flag is set, then any open files will be closed but the reader will remain initialized; otherwise, it is equivalent to calling close(). Note that it is currently not safe to call close(true).
  • Added new API methods to IFormatWriter:
    • "int[] getPixelTypes(String)" returns the pixel types that can be written to the given file.
    • "boolean isSupportedType(String, int)" returns true if the given pixel type can be written to the given file.
  • Added "-time <value>" option to ReaderTest. Use this to specify the multiplier (float value) for timing tests.
Location:
trunk/loci/formats
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FileStitcher.java

    r2178 r2182  
    422422 
    423423  /* @see IFormatReader#close(boolean) */ 
    424   /* 
    425424  public void close(boolean fileOnly) throws FormatException, IOException { 
    426425    if (readers != null) { 
     
    434433    } 
    435434  } 
    436   */ 
    437435 
    438436  /* @see IFormatReader#close() */ 
  • trunk/loci/formats/FormatWriter.java

    r2178 r2182  
    9797  } 
    9898 
    99   /* @see FormatWriter#testConvert(String[]) */ 
     99  /* @see IFormatWriter#getPixelTypes(String) */ 
     100  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     101    return new int[] {FormatReader.UINT8, FormatReader.UINT16,  
     102      FormatReader.UINT32, FormatReader.FLOAT}; 
     103  } 
     104 
     105  /* @see IFormatWriter#isSupportedType(String, int) */ 
     106  public boolean isSupportedType(String id, int type)  
     107    throws FormatException, IOException 
     108  { 
     109    int[] types = getPixelTypes(id); 
     110    for (int i=0; i<types.length; i++) { 
     111      if (type == types[i]) return true; 
     112    } 
     113    return false; 
     114  } 
     115 
     116  /* @see IFormatWriter#testConvert(String[]) */ 
    100117  public boolean testConvert(String[] args) 
    101118    throws FormatException, IOException 
  • trunk/loci/formats/IFormatReader.java

    r2178 r2182  
    177177  byte[] openThumbBytes(String id, int no) throws FormatException, IOException; 
    178178 
    179   /** Closes the currently open file. */ 
     179  /**  
     180   * Closes the currently open file. If the flag is set, this is all that 
     181   * happens; if unset, it is equivalent to calling close(). 
     182   */ 
     183  void close(boolean fileOnly) throws FormatException, IOException; 
     184 
     185  /**  
     186   * Closes the currently open file and frees memory  
     187   * allocated by this reader.  
     188   */ 
    180189  void close() throws FormatException, IOException; 
    181190 
  • trunk/loci/formats/IFormatWriter.java

    r2178 r2182  
    6060  String[] getCompressionTypes(); 
    6161 
     62  /** Gets the supported pixel types. */ 
     63  int[] getPixelTypes(String id) throws FormatException, IOException; 
     64 
     65  /** Checks if the given pixel type is supported. */ 
     66  boolean isSupportedType(String id, int type)  
     67    throws FormatException, IOException; 
     68   
    6269  /** Sets the current compression type. */ 
    6370  void setCompression(String compress) throws FormatException; 
  • trunk/loci/formats/ImageReader.java

    r2178 r2182  
    328328  } 
    329329 
     330  /* @see IFormatReader#close(boolean) */ 
     331  public void close(boolean fileOnly) throws FormatException, IOException { 
     332    for (int i=0; i<readers.length; i++) readers[i].close(fileOnly); 
     333  } 
     334 
    330335  /* @see IFormatReader#close() */ 
    331336  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/ImageWriter.java

    r2178 r2182  
    222222      for (int i=0; i<writers.length; i++) { 
    223223        String[] s = writers[i].getCompressionTypes(); 
    224         for (int j=0; j<s.length; j++) set.add(s[j]); 
     224        if (s != null) { 
     225          for (int j=0; j<s.length; j++) set.add(s[j]); 
     226        } 
    225227      } 
    226228      compressionTypes = new String[set.size()]; 
     
    229231    } 
    230232    return compressionTypes; 
     233  } 
     234 
     235  /* @see IFormatWriter#getPixelTypes(String) */ 
     236  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     237    return getWriter(id).getPixelTypes(id); 
     238  } 
     239 
     240  /* @see IFormatWriter#isSupportedType(String, int) */ 
     241  public boolean isSupportedType(String id, int type)  
     242    throws FormatException, IOException  
     243  { 
     244    return getWriter(id).isSupportedType(id, type); 
    231245  } 
    232246 
  • trunk/loci/formats/LegacyQTTools.java

    r2178 r2182  
    147147      } 
    148148    } 
    149     catch (Throwable t) { noQT = true; } 
     149    catch (Throwable t) {  
     150      noQT = true;  
     151    } 
    150152    finally { 
    151153      if (needClose) { 
  • trunk/loci/formats/ReaderWrapper.java

    r2178 r2182  
    178178  } 
    179179 
     180  public void close(boolean fileOnly) throws FormatException, IOException { 
     181    reader.close(fileOnly); 
     182  } 
     183 
    180184  public void close() throws FormatException, IOException { 
    181185    reader.close(); 
  • trunk/loci/formats/TiffTools.java

    r2178 r2182  
    21602160      putIFDValue(ifd, SOFTWARE, "LOCI Bio-Formats"); 
    21612161    } 
     2162    if (getIFDValue(ifd, IMAGE_DESCRIPTION) == null) { 
     2163      putIFDValue(ifd, IMAGE_DESCRIPTION, ""); 
     2164    } 
    21622165 
    21632166    // create pixel output buffers 
  • trunk/loci/formats/in/AVIReader.java

    r2178 r2182  
    173173    return ImageTools.makeImage(openBytes(id, no), dwWidth, bmpHeight, 
    174174      !isRGB(id) ? 1 : 3, true); 
     175  } 
     176 
     177  /* @see IFormatReader#close(boolean) */ 
     178  public void close(boolean fileOnly) throws FormatException, IOException { 
     179    if (fileOnly) { 
     180      if (in != null) in.close(); 
     181    } 
     182    else close();  
    175183  } 
    176184 
  • trunk/loci/formats/in/AliconaReader.java

    r2178 r2182  
    141141    return ImageTools.makeImage(openBytes(id, no), width, height, 1, false, 
    142142      numBytes, true); 
     143  } 
     144 
     145  /* @see IFormatReader#close(boolean) */ 
     146  public void close(boolean fileOnly) throws FormatException, IOException { 
     147    if (fileOnly && in != null) in.close(); 
     148    else if (!fileOnly) close(); 
    143149  } 
    144150 
  • trunk/loci/formats/in/BMPReader.java

    r2178 r2182  
    230230  } 
    231231 
     232  /* @see IFormatReader#close(boolean) */ 
     233  public void close(boolean fileOnly) throws FormatException, IOException { 
     234    if (fileOnly && in != null) in.close(); 
     235    else if (!fileOnly) close(); 
     236  } 
     237 
    232238  /** Closes any open files. */ 
    233239  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/in/BaseTiffReader.java

    r2178 r2182  
    799799  } 
    800800 
    801 /** Obtains the specified image from the given TIFF file. */ 
     801  /** Obtains the specified image from the given TIFF file. */ 
    802802  public BufferedImage openImage(String id, int no) 
    803803    throws FormatException, IOException 
     
    812812 
    813813    return TiffTools.getImage(ifds[no], in, ignoreColorTable); 
     814  } 
     815 
     816  /* @see IFormatReader#close(boolean) */ 
     817  public void close(boolean fileOnly) throws FormatException, IOException { 
     818    if (fileOnly && in != null) in.close(); 
     819    else if (!fileOnly) close(); 
    814820  } 
    815821 
  • trunk/loci/formats/in/BioRadReader.java

    r2178 r2182  
    156156    return ImageTools.makeImage(openBytes(id, no), nx, ny, 1, false, 
    157157      byteFormat ? 1 : 2, LITTLE_ENDIAN); 
     158  } 
     159 
     160  /* @see IFormatReader#close(boolean) */ 
     161  public void close(boolean fileOnly) throws FormatException, IOException { 
     162    if (fileOnly && in != null) in.close(); 
     163    else if (!fileOnly) close(); 
    158164  } 
    159165 
  • trunk/loci/formats/in/DeltavisionReader.java

    r2178 r2182  
    213213    return ImageTools.makeImage(openBytes(id, no), width, height, 1, 
    214214      false, bytesPerPixel, little); 
     215  } 
     216  
     217  /* @see IFormatReader#close(boolean) */ 
     218  public void close(boolean fileOnly) throws FormatException, IOException { 
     219    if (fileOnly && in != null) in.close(); 
     220    else if (!fileOnly) close(); 
    215221  } 
    216222 
  • trunk/loci/formats/in/DicomReader.java

    r2178 r2182  
    232232    return ImageTools.makeImage(openBytes(id, no), width, height, 1, false, 
    233233      bitsPerPixel / 8, little); 
     234  } 
     235 
     236  /* @see IFormatReader#close(boolean) */ 
     237  public void close(boolean fileOnly) throws FormatException, IOException { 
     238    if (fileOnly && in != null) in.close(); 
     239    else if (!fileOnly) close(); 
    234240  } 
    235241 
  • trunk/loci/formats/in/EPSReader.java

    r2178 r2182  
    159159    return ImageTools.makeImage(openBytes(id, no), width, height, 
    160160      !isRGB(id) ? 1 : 3, true); 
     161  } 
     162 
     163  /* @see IFormatReader#close(boolean) */ 
     164  public void close(boolean fileOnly) throws FormatException, IOException { 
     165    if (fileOnly && in != null) in.close(); 
     166    else if (!fileOnly) close(); 
    161167  } 
    162168 
  • trunk/loci/formats/in/GIFReader.java

    r2178 r2182  
    208208    return ImageTools.makeImage(b, width, height, b.length / (width * height), 
    209209      false, 1, true); 
     210  } 
     211 
     212  /* @see IFormatReader#close(boolean) */ 
     213  public void close(boolean fileOnly) throws FormatException, IOException { 
     214    if (fileOnly && in != null) in.close(); 
     215    else if (!fileOnly) close(); 
    210216  } 
    211217 
  • trunk/loci/formats/in/GatanReader.java

    r2178 r2182  
    147147    return ImageTools.makeImage(pixelData, width, height, channels, 
    148148      false, dims[2], littleEndian); 
     149  } 
     150 
     151  /* @see IFormatReader#close(boolean) */ 
     152  public void close(boolean fileOnly) throws FormatException, IOException { 
     153    if (fileOnly && in != null) in.close(); 
     154    else if (!fileOnly) close(); 
    149155  } 
    150156 
  • trunk/loci/formats/in/ICSReader.java

    r2178 r2182  
    184184    if (versionTwo) return new String[] {currentIdsId}; 
    185185    return new String[] {currentIdsId, currentIcsId}; 
     186  } 
     187 
     188  /* @see IFormatReader#close(boolean) */ 
     189  public void close(boolean fileOnly) throws FormatException, IOException { 
     190    if (fileOnly && idsIn != null) idsIn.close(); 
     191    else if (!fileOnly) close(); 
    186192  } 
    187193 
  • trunk/loci/formats/in/IPLabReader.java

    r2178 r2182  
    152152  } 
    153153 
     154  /* @see IFormatReader#close(boolean) */ 
     155  public void close(boolean fileOnly) throws FormatException, IOException { 
     156    if (fileOnly && in != null) in.close(); 
     157    else if (!fileOnly) close(); 
     158  } 
     159 
    154160  /** Closes any open files. */ 
    155161  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/in/IPWReader.java

    r2181 r2182  
    174174    return ImageTools.makeImage(b, sizeX[0], sizeY[0], bytes == 3 ? 3 : 1, 
    175175      false, bytes == 3 ? 1 : bytes, little); 
     176  } 
     177 
     178  /* @see IFormatReader#close(boolean) */ 
     179  public void close(boolean fileOnly) throws FormatException, IOException { 
     180    if (fileOnly && in != null) in.close(); 
     181    else if (!fileOnly) close(); 
    176182  } 
    177183 
  • trunk/loci/formats/in/ImageIOReader.java

    r2178 r2182  
    109109  } 
    110110 
     111  /* @see IFormatReader#close(boolean) */ 
     112  public void close(boolean fileOnly) throws FormatException, IOException { } 
     113 
    111114  /** Closes any open files. */ 
    112115  public void close() throws FormatException, IOException { } 
  • trunk/loci/formats/in/ImageJReader.java

    r2178 r2182  
    166166    pixelType[0] = FormatReader.INT8; 
    167167    currentOrder[0] = "XYCZT"; 
     168  } 
     169 
     170  /* @see IFormatReader#close(boolean) */ 
     171  public void close(boolean fileOnly) throws FormatException, IOException { 
     172    if (!fileOnly) close(); 
    168173  } 
    169174 
  • trunk/loci/formats/in/ImarisReader.java

    r2178 r2182  
    222222    return ImageTools.makeImage(openBytes(id, no), dims[0], dims[1], 1, false); 
    223223  } 
     224  
     225  /* @see IFormatReader#close(boolean) */ 
     226  public void close(boolean fileOnly) throws FormatException, IOException { 
     227    if (fileOnly && in != null) in.close(); 
     228    else if (!fileOnly) close(); 
     229  } 
    224230 
    225231  /** Closes any open files. */ 
  • trunk/loci/formats/in/LIFReader.java

    r2178 r2182  
    178178    return ImageTools.makeImage(openBytes(id, no), width, height, 
    179179      !isRGB(id) ? 1 : c, false, bpp / 8, littleEndian, validBits[series]); 
     180  } 
     181 
     182  /* @see IFormatReader#close(boolean) */ 
     183  public void close(boolean fileOnly) throws FormatException, IOException { 
     184    if (fileOnly && in != null) in.close(); 
     185    else if (!fileOnly) close(); 
    180186  } 
    181187 
  • trunk/loci/formats/in/LegacyPictReader.java

    r2178 r2182  
    117117  } 
    118118 
     119  /* @see IFormatReader#close(boolean) */ 
     120  public void close(boolean fileOnly) throws FormatException, IOException { } 
     121 
    119122  /** Closes any open files. */ 
    120123  public void close() throws FormatException, IOException { } 
  • trunk/loci/formats/in/LegacyQTReader.java

    r2178 r2182  
    135135 
    136136    return ImageTools.makeBuffered(image); 
     137  } 
     138 
     139  /* @see IFormatReader#close(boolean) */ 
     140  public void close(boolean fileOnly) throws FormatException, IOException { 
     141    if (fileOnly) { 
     142      try { 
     143        r.exec("openMovieFile.close()"); 
     144      } 
     145      catch (ReflectException e) { 
     146        throw new FormatException("Close movie failed", e); 
     147      } 
     148    } 
     149    else close(); 
    137150  } 
    138151 
  • trunk/loci/formats/in/LegacyZVIReader.java

    r2178 r2182  
    142142 
    143143    return zviBlock.readImage(in); 
     144  } 
     145 
     146  /* @see IFormatReader#close(boolean) */ 
     147  public void close(boolean fileOnly) throws FormatException, IOException { 
     148    if (fileOnly && in != null) in.close(); 
     149    else if (!fileOnly) close(); 
    144150  } 
    145151 
  • trunk/loci/formats/in/LeicaReader.java

    r2178 r2182  
    212212  
    213213  /* @see IFormatReader#close(boolean) */ 
    214   /* 
    215214  public void close(boolean fileOnly) throws FormatException, IOException { 
    216215    if (fileOnly) { 
     
    228227    else close(); 
    229228  } 
    230   */ 
    231229 
    232230  /** Closes any open files. */ 
  • trunk/loci/formats/in/MNGReader.java

    r2178 r2182  
    133133  } 
    134134 
     135  /* @see IFormatReader#close(boolean) */ 
     136  public void close(boolean fileOnly) throws FormatException, IOException { 
     137    if (fileOnly && in != null) in.close(); 
     138    else if (!fileOnly) close(); 
     139  } 
     140 
    135141  /** Closes any open files. */ 
    136142  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/in/MRCReader.java

    r2178 r2182  
    113113    return ImageTools.makeImage(openBytes(id, no), sizeX[0], sizeY[0], 1, 
    114114      true, bpp, little); 
     115  } 
     116 
     117  /* @see IFormatReader#close(boolean) */ 
     118  public void close(boolean fileOnly) throws FormatException, IOException { 
     119    if (fileOnly && in != null) in.close(); 
     120    else if (!fileOnly) close(); 
    115121  } 
    116122 
  • trunk/loci/formats/in/ND2Reader.java

    r2181 r2182  
    210210  } 
    211211 
     212  /* @see IFormatReader#close(boolean) */ 
     213  public void close(boolean fileOnly) throws FormatException, IOException { 
     214    close(); 
     215  } 
     216 
    212217  /** Closes any open files. */ 
    213218  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/in/OIBReader.java

    r2181 r2182  
    242242 
    243243  /* @see IFormatReader#close(boolean) */ 
    244   /* 
    245244  public void close(boolean fileOnly) throws FormatException, IOException { 
    246245    if (!fileOnly) close(); 
    247246  } 
    248   */ 
    249247 
    250248  /** Closes any open files. */ 
  • trunk/loci/formats/in/OIFReader.java

    r2178 r2182  
    208208 
    209209  /* @see IFormatReader#close(boolean) */ 
    210   /* 
    211210  public void close(boolean fileOnly) throws FormatException, IOException { 
    212211    if (fileOnly) { 
     
    221220    else close(); 
    222221  } 
    223   */ 
    224222 
    225223  /** Closes any open files. */ 
  • trunk/loci/formats/in/OMEReader.java

    r2178 r2182  
    181181    } 
    182182    return thumb; 
     183  } 
     184 
     185  /* @see IFormatReader#close(boolean) */ 
     186  public void close(boolean fileOnly) throws FormatException, IOException { 
     187    if (fileOnly && rc != null) rc.logout(); 
     188    else close(); 
    183189  } 
    184190 
  • trunk/loci/formats/in/OMEXMLReader.java

    r2178 r2182  
    192192    return ImageTools.makeImage(openBytes(id, no), width[series], 
    193193      height[series], 1, false, bpp[series], littleEndian[series]); 
     194  } 
     195 
     196  /* @see IFormatReader#close(boolean) */ 
     197  public void close(boolean fileOnly) throws FormatException, IOException { 
     198    if (fileOnly && in != null) in.close(); 
     199    else close(); 
    194200  } 
    195201 
  • trunk/loci/formats/in/OpenlabRawReader.java

    r2178 r2182  
    128128    return ImageTools.makeImage(openBytes(id, no), width, height, 
    129129      !isRGB(id) ? 1 : channels, false, bytesPerPixel, false); 
     130  } 
     131 
     132  /* @see IFormatReader#close(boolean) */ 
     133  public void close(boolean fileOnly) throws FormatException, IOException { 
     134    if (fileOnly && in != null) in.close(); 
     135    else if (!fileOnly) close(); 
    130136  } 
    131137 
  • trunk/loci/formats/in/OpenlabReader.java

    r2178 r2182  
    372372      bytesPerPixel == 3 ? 3 : 1, false, 
    373373      bytesPerPixel == 3 ? 1 : bytesPerPixel, false); 
     374  } 
     375 
     376  /* @see IFormatReader#close(boolean) */ 
     377  public void close(boolean fileOnly) throws FormatException, IOException { 
     378    if (fileOnly) { 
     379      if (in != null) in.close(); 
     380      if (pict != null) pict.close(fileOnly); 
     381    } 
     382    else close(); 
    374383  } 
    375384 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r2178 r2182  
    150150    if (!id.equals(currentId)) initFile(id); 
    151151    return (String[]) allFiles.toArray(new String[0]); 
     152  } 
     153 
     154  /* @see IFormatReader#close(boolean) */ 
     155  public void close(boolean fileOnly) throws FormatException, IOException { 
     156    if (fileOnly) { 
     157      if (tiff != null) { 
     158        for (int i=0; i<tiff.length; i++) { 
     159          if (tiff[i] != null) tiff[i].close(fileOnly); 
     160        } 
     161      } 
     162    } 
     163    else close(); 
    152164  } 
    153165 
  • trunk/loci/formats/in/PictReader.java

    r2178 r2182  
    169169 
    170170    return open(bytes); 
     171  } 
     172 
     173  /* @see IFormatReader#close(boolean) */ 
     174  public void close(boolean fileOnly) throws FormatException, IOException { 
     175    if (fileOnly && in != null) in.close(); 
     176    else if (!fileOnly) close(); 
    171177  } 
    172178 
  • trunk/loci/formats/in/PrairieReader.java

    r2178 r2182  
    187187  } 
    188188 
     189  /* @see IFormatReader#close(boolean) */ 
     190  public void close(boolean fileOnly) throws FormatException, IOException { 
     191    if (fileOnly && tiff != null) tiff.close(fileOnly); 
     192    else if (!fileOnly) close(); 
     193  } 
     194 
    189195  /* @see IFormatReader#close() */ 
    190196  public void close() throws FormatException, IOException { 
     
    219225      byte[] b = new byte[(int) is.length()]; 
    220226      is.read(b); 
     227      is.close(); 
    221228      String s = new String(b); 
    222229 
  • trunk/loci/formats/in/QTReader.java

    r2178 r2182  
    545545  } 
    546546 
     547  /* @see IFormatReader#close(boolean) */ 
     548  public void close(boolean fileOnly) throws FormatException, IOException { 
     549    if (fileOnly && in != null) in.close(); 
     550    else if (!fileOnly) close(); 
     551  } 
     552 
    547553  /** Closes any open files. */ 
    548554  public void close() throws FormatException, IOException { 
     
    583589    sizeX[0] = flip ? height : width; 
    584590    sizeY[0] = flip ? width : height; 
    585     sizeZ[0] = numImages; 
     591    sizeZ[0] = 1; 
    586592    sizeC[0] = bitsPerPixel < 40 ? 3 : 1; 
    587     sizeT[0] = 1; 
     593    sizeT[0] = numImages; 
    588594    currentOrder[0] = "XYCZT"; 
    589595 
  • trunk/loci/formats/in/SDTReader.java

    r2178 r2182  
    188188  } 
    189189 
     190  /* @see IFormatReader#close(boolean) */ 
     191  public void close(boolean fileOnly) throws FormatException, IOException { 
     192    if (fileOnly && in != null) in.close(); 
     193    else if (!fileOnly) close(); 
     194  } 
     195 
    190196  /** Closes any open files. */ 
    191197  public void close() throws FormatException, IOException { 
  • trunk/loci/formats/in/SlidebookReader.java

    r2178 r2182  
    120120    return ImageTools.makeImage(openBytes(id, no), width, height, 1, true, 
    121121      bpp, true); 
     122  } 
     123 
     124  /* @see IFormatReader#close(boolean) */ 
     125  public void close(boolean fileOnly) throws FormatException, IOException { 
     126    if (fileOnly && in != null) in.close(); 
     127    else if (!fileOnly) close(); 
    122128  } 
    123129 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r2181 r2182  
    303303    return ImageTools.makeImage(openBytes(id, no), width, height, 
    304304      isRGB(id) ? 3 : 1, true, bpp == 3 ? 1 : bpp, true, validBits); 
     305  } 
     306 
     307  /* @see IFormatReader#close(boolean) */ 
     308  public void close(boolean fileOnly) throws FormatException, IOException { 
     309    if (fileOnly) { 
     310      if (ras != null) ras.close(); 
     311      if (legacy != null) legacy.close(fileOnly); 
     312    } 
     313    else close(); 
    305314  } 
    306315 
  • trunk/loci/formats/out/AVIWriter.java

    r2178 r2182  
    523523  public boolean canDoStacks(String id) { return true; } 
    524524 
     525  /* @see IFormatWriter#getPixelTypes(String) */ 
     526  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     527    return new int[] {FormatReader.UINT8}; 
     528  } 
     529 
    525530  // -- Main method -- 
    526531 
  • trunk/loci/formats/out/EPSWriter.java

    r2178 r2182  
    154154  public boolean canDoStacks(String id) { return false; } 
    155155 
     156  /* @see IFormatWriter#getPixelTypes(String) */ 
     157  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     158    return new int[] {FormatReader.UINT8}; 
     159  } 
     160 
    156161  // -- Main method -- 
    157162 
  • trunk/loci/formats/out/ImageIOWriter.java

    r2178 r2182  
    9595  public boolean canDoStacks(String id) { return false; } 
    9696 
     97  /* @see IFormatWriter#getPixelTypes(String) */ 
     98  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     99    return new int[] {FormatReader.UINT8, FormatReader.UINT16}; 
     100  } 
     101 
    97102} 
  • trunk/loci/formats/out/JPEGWriter.java

    r2178 r2182  
    5555  } 
    5656 
     57  /* @see IFormatWriter#getPixelTypes(String) */ 
     58  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     59    return new int[] {FormatReader.UINT8}; 
     60  } 
     61 
    5762  // -- Main method -- 
    5863 
  • trunk/loci/formats/out/QTWriter.java

    r2178 r2182  
    593593  public boolean canDoStacks(String id) { return true; } 
    594594 
     595  /* @see IFormatWriter#getPixelTypes(String) */ 
     596  public int[] getPixelTypes(String id) throws FormatException, IOException { 
     597    return new int[] {FormatReader.UINT8, FormatReader.UINT16}; 
     598  } 
     599 
     600 
    595601  // -- Helper method -- 
    596602 
  • trunk/loci/formats/test/ReaderTest.java

    r2178 r2182  
    6666 
    6767  public static boolean writeConfigFiles = false; 
     68  public static float timeMultiplier = 1f; 
     69   
    6870  private static StringBuffer configLine; 
    6971  private static Vector configFiles = new Vector(); 
     
    475477  public void testAccessTime() { 
    476478    boolean success = true; 
    477     if (averagePlaneAccess - config.getTimePerPlane(id) > 10.0) { 
     479    if (averagePlaneAccess - timeMultiplier*config.getTimePerPlane(id) > 20.0) { 
    478480      success = false; 
    479481      writeLog(id + " failed consistent access time test (got " + 
     
    617619        if (args[i].equals("-config")) ReaderTest.writeConfigFiles = true; 
    618620        else if (args[i].equals("-debug")) FormatReader.setDebug(true); 
     621        else if (args[i].equals("-time")) { 
     622          ReaderTest.timeMultiplier = Float.parseFloat(args[i+1]); 
     623        } 
    619624      } 
    620625    } 
Note: See TracChangeset for help on using the changeset viewer.