Changeset 5617 for branches/4.1


Ignore:
Timestamp:
10/19/09 06:43:23 (11 years ago)
Author:
melissa
Message:

Fixed compile errors, for real this time.

Location:
branches/4.1
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/build.properties

    r5551 r5617  
    66# Download Apache Ant from http://ant.apache.org/. 
    77# Type "ant -p" for a list of targets. 
     8 
     9# directory containing source code for extra utilities 
     10toplevel-utils.dir    = ${root.dir}/utils 
    811 
    912### Javadoc generation ### 
  • branches/4.1/build.xml

    r5551 r5617  
    455455    <delete dir="${artifact.dir}"/> 
    456456    <delete dir="build"/> 
     457  </target> 
     458 
     459  <target name="utils" 
     460    depends="jars, utils-common, utils-formats, utils-loci-plugins" 
     461    description="compile all extra utilities"> 
     462    <delete> 
     463      <fileset dir="${toplevel-utils.dir}" includes="*.class"/> 
     464    </delete> 
     465    <javac debug="true" deprecation="true" source="1.5" target="1.5" 
     466      srcdir="${toplevel-utils.dir}" includes="*.java"> 
     467      <classpath> 
     468        <fileset dir="${artifact.dir}"> 
     469          <include name="*.jar"/> 
     470        </fileset> 
     471      </classpath> 
     472    </javac> 
    457473  </target> 
    458474 
     
    509525  </target> 
    510526 
     527  <target name="utils-common" depends="jar-common" 
     528    description="compile extra utilities for LOCI common library"> 
     529    <ant dir="components/common" target="common.utils"/> 
     530  </target> 
     531 
    511532  <!-- JAI Image I/O Tools library --> 
    512533 
     
    625646  </target> 
    626647 
     648  <target name="utils-formats" depends="jar-formats" 
     649    description="compile extra utilities for LOCI Plugins for ImageJ"> 
     650    <ant dir="components/bio-formats" target="formats.utils"/> 
     651  </target> 
     652 
    627653  <!-- LOCI autogen --> 
    628654 
     
    698724    description="remove build files for LOCI Plugins for ImageJ"> 
    699725    <ant dir="components/loci-plugins" target="loci-plugins.clean"/> 
     726  </target> 
     727 
     728  <target name="utils-loci-plugins" depends="jar-loci-plugins" 
     729    description="compile extra utilities for LOCI Plugins for ImageJ"> 
     730    <ant dir="components/loci-plugins" target="loci-plugins.utils"/> 
    700731  </target> 
    701732 
     
    752783 
    753784  <!-- VisBio --> 
    754  
    755785 
    756786  <target name="compile-visbio" 
  • branches/4.1/components/bf-ice/src/loci/ice/formats/IFormatWriterI.java

    r5490 r5617  
    2525 
    2626import Ice.Current; 
    27 import java.awt.Image; 
    2827import java.awt.image.ColorModel; 
    2928import java.io.IOException; 
     
    7271      exc.printStackTrace(); 
    7372    } 
    74   } 
    75  
    76   public void saveImage(Image image, boolean last, Current current) 
    77     throws FormatException, IOException 
    78   { 
    79     writer.saveImage(image, last); 
    80   } 
    81  
    82   public void saveImage(Image image, int series, boolean lastInSeries, 
    83     boolean last, Current current) throws FormatException, IOException 
    84   { 
    85     writer.saveImage(image, series, lastInSeries, last); 
    8673  } 
    8774 
  • branches/4.1/components/bio-formats/utils/ConvertToOmeTiff.java

    r5325 r5617  
    33// 
    44 
    5 import java.awt.image.BufferedImage; 
     5import loci.formats.ImageReader; 
    66import loci.formats.MetadataTools; 
    7 import loci.formats.gui.BufferedImageReader; 
    8 import loci.formats.meta.MetadataRetrieve; 
    9 import loci.formats.meta.MetadataStore; 
     7import loci.formats.meta.IMetadata; 
    108import loci.formats.out.OMETiffWriter; 
    119 
    12 /** Converts the given files to OME-TIFF format. */ 
     10/** 
     11 * Converts the given files to OME-TIFF format. 
     12 * 
     13 * <dl><dt><b>Source code:</b></dt> 
     14 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/ConvertToOmeTiff.java">Trac</a>, 
     15 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/ConvertToOmeTiff.java">SVN</a></dd></dl> 
     16 */ 
    1317public class ConvertToOmeTiff { 
    1418 
     
    1822      return; 
    1923    } 
    20     BufferedImageReader reader = new BufferedImageReader(); 
     24    ImageReader reader = new ImageReader(); 
    2125    OMETiffWriter writer = new OMETiffWriter(); 
    2226    for (int i=0; i<args.length; i++) { 
     
    2731 
    2832      // record metadata to OME-XML format 
    29       MetadataStore omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
     33      IMetadata omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
    3034      reader.setMetadataStore(omexmlMeta); 
    3135      reader.setId(id); 
    3236 
    3337      // configure OME-TIFF writer 
    34       writer.setMetadataRetrieve((MetadataRetrieve) omexmlMeta); 
     38      writer.setMetadataRetrieve(omexmlMeta); 
    3539      writer.setId(outId); 
    3640      //writer.setCompression("J2K"); 
     
    3842      // write out image planes 
    3943      int seriesCount = reader.getSeriesCount(); 
    40       for (int series=0; series<seriesCount; series++) { 
    41         reader.setSeries(series); 
    42         int imageCount = reader.getImageCount(); 
    43         for (int image=0; image<imageCount; image++) { 
    44           BufferedImage plane = reader.openImage(image); 
     44      for (int s=0; s<seriesCount; s++) { 
     45        reader.setSeries(s); 
     46        int planeCount = reader.getImageCount(); 
     47        for (int p=0; p<planeCount; p++) { 
     48          byte[] plane = reader.openBytes(p); 
    4549          // write plane to output file 
    46           writer.saveImage(plane, series, image == imageCount - 1, 
    47             (image == imageCount - 1) && (series == seriesCount - 1)); 
     50          writer.saveBytes(plane, s, p == planeCount - 1, 
     51            (p == planeCount - 1) && (s == seriesCount - 1)); 
    4852          System.out.print("."); 
    4953        } 
  • branches/4.1/components/bio-formats/utils/EditImageName.java

    r5325 r5617  
    88import loci.formats.meta.MetadataStore; 
    99 
    10 /** Edits the given file's image name (but does not save back to disk). */ 
     10/** 
     11 * Edits the given file's image name (but does not save back to disk). 
     12 * 
     13 * <dl><dt><b>Source code:</b></dt> 
     14 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/EditImageName.java">Trac</a>, 
     15 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/EditImageName.java">SVN</a></dd></dl> 
     16 */ 
    1117public class EditImageName { 
    1218 
  • branches/4.1/components/bio-formats/utils/ExtractFlexMetadata.java

    r5325 r5617  
    1414 * Convenience method to extract the metadata from 
    1515 * all the Flex files present in a directory. 
     16 * 
     17 * <dl><dt><b>Source code:</b></dt> 
     18 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/ExtractFlexMetadata.java">Trac</a>, 
     19 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/ExtractFlexMetadata.java">SVN</a></dd></dl> 
    1620 */ 
    1721public class ExtractFlexMetadata { 
  • branches/4.1/components/bio-formats/utils/ExtractSDTData.java

    r5325 r5617  
    66import loci.formats.in.SDTReader; 
    77 
    8 /** Reads SDT files and creates text files containing histogram data. */ 
     8/** 
     9 * Reads SDT files and creates text files containing histogram data. 
     10 * 
     11 * <dl><dt><b>Source code:</b></dt> 
     12 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/ExtractSDTData.java">Trac</a>, 
     13 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/ExtractSDTData.java">SVN</a></dd></dl> 
     14 */ 
    915public class ExtractSDTData { 
    1016 
  • branches/4.1/components/bio-formats/utils/MakeLZW.java

    r5325 r5617  
    33// 
    44 
    5 import java.awt.image.BufferedImage; 
    6 import java.util.Hashtable; 
    75import loci.formats.MetadataTools; 
    8 import loci.formats.gui.BufferedImageReader; 
    9 import loci.formats.meta.MetadataRetrieve; 
    10 import loci.formats.meta.MetadataStore; 
     6import loci.formats.ImageReader; 
     7import loci.formats.meta.IMetadata; 
    118import loci.formats.out.TiffWriter; 
    12 import loci.formats.tiff.IFD; 
    13 import loci.formats.tiff.TiffCompression; 
    149 
    15 /** Converts the given image file to an LZW-compressed TIFF. */ 
     10/** 
     11 * Converts the given image file to an LZW-compressed TIFF. 
     12 * 
     13 * <dl><dt><b>Source code:</b></dt> 
     14 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/MakeLZW.java">Trac</a>, 
     15 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/MakeLZW.java">SVN</a></dd></dl> 
     16 */ 
    1617public class MakeLZW { 
    1718 
    1819  public static void main(String[] args) throws Exception { 
    19     BufferedImageReader reader = new BufferedImageReader(); 
    20     MetadataStore omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
     20    ImageReader reader = new ImageReader(); 
     21    IMetadata omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
    2122    reader.setMetadataStore(omexmlMeta); 
    2223    TiffWriter writer = new TiffWriter(); 
     
    2627      System.out.print("Converting " + inFile + " to " + outFile); 
    2728      reader.setId(inFile); 
     29      writer.setMetadataRetrieve(omexmlMeta); 
     30      writer.setCompression("LZW"); 
    2831      writer.setId(outFile); 
    29       int blocks = reader.getImageCount(); 
    30       String xml = MetadataTools.getOMEXML((MetadataRetrieve) omexmlMeta); 
    31       for (int b=0; b<blocks; b++) { 
     32      int planeCount = reader.getImageCount(); 
     33      for (int p=0; p<planeCount; p++) { 
    3234        System.out.print("."); 
    33         BufferedImage img = reader.openImage(b); 
    34  
    35         IFD ifd = new IFD(); 
    36         if (b == 0) { 
    37           // preserve OME-XML block 
    38           ifd.putIFDValue(IFD.IMAGE_DESCRIPTION, xml); 
    39         } 
    40  
    41         // save with LZW 
    42         ifd.putIFDValue(IFD.COMPRESSION, TiffCompression.LZW); 
    43         ifd.putIFDValue(IFD.PREDICTOR, 2); 
    44  
    45         // write file to disk 
    46         writer.saveImage(img, ifd, b == blocks - 1); 
     35        byte[] plane = reader.openBytes(p); 
     36        writer.saveBytes(plane, p == planeCount - 1); 
    4737      } 
    4838      System.out.println(" [done]"); 
  • branches/4.1/components/bio-formats/utils/MakeTestOmeTiff.java

    r5336 r5617  
    1313import loci.formats.tiff.TiffSaver; 
    1414 
    15 /** Creates a sample OME-TIFF dataset according to the given parameters. */ 
     15/** 
     16 * Creates a sample OME-TIFF dataset according to the given parameters. 
     17 * 
     18 * <dl><dt><b>Source code:</b></dt> 
     19 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/MakeTestOmeTiff.java">Trac</a>, 
     20 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/MakeTestOmeTiff.java">SVN</a></dd></dl> 
     21 */ 
    1622public class MakeTestOmeTiff { 
    1723 
     
    223229    boolean allT = dist.indexOf("t") >= 0; 
    224230 
    225     BufferedImage[][][] images = new BufferedImage[numImages][][]; 
     231    BufferedImage[][][] planes = new BufferedImage[numImages][][]; 
    226232    int[][] globalOffsets = new int[numImages][]; // IFD offsets across Images 
    227233    int[][] localOffsets = new int[numImages][]; // IFD offsets per Image 
    228234    int globalOffset = 0, localOffset = 0; 
    229235    for (int i=0; i<numImages; i++) { 
    230       images[i] = new BufferedImage[numPixels[i]][]; 
     236      planes[i] = new BufferedImage[numPixels[i]][]; 
    231237      globalOffsets[i] = new int[numPixels[i]]; 
    232238      localOffsets[i] = new int[numPixels[i]]; 
     
    234240      for (int p=0; p<numPixels[i]; p++) { 
    235241        int len = sizeZ[i][p] * sizeC[i][p] * sizeT[i][p]; 
    236         images[i][p] = new BufferedImage[len]; 
     242        planes[i][p] = new BufferedImage[len]; 
    237243        globalOffsets[i][p] = globalOffset; 
    238244        globalOffset += len; 
     
    249255          sizeX[i][p] + " x " + sizeY[i][p] + ", " + 
    250256          sizeZ[i][p] + "Z " + sizeC[i][p] + "C " + sizeT[i][p] + "T"); 
    251         int len = images[i][p].length; 
     257        int len = planes[i][p].length; 
    252258        for (int j=0; j<len; j++) { 
    253259          int[] zct = FormatTools.getZCTCoords(dimOrder[i][p], 
     
    255261 
    256262          System.out.print("."); 
    257           images[i][p][j] = new BufferedImage( 
     263          planes[i][p][j] = new BufferedImage( 
    258264            sizeX[i][p], sizeY[i][p], BufferedImage.TYPE_BYTE_GRAY); 
    259           Graphics2D g = images[i][p][j].createGraphics(); 
     265          Graphics2D g = planes[i][p][j].createGraphics(); 
    260266          // draw gradient 
    261267          boolean even = ipNum % 2 == 0; 
     
    346352      last[i] = new boolean[numPixels[i]][]; 
    347353      for (int p=0; p<numPixels[i]; p++) { 
    348         int len = images[i][p].length; 
     354        int len = planes[i][p].length; 
    349355        filenames[i][p] = new String[len]; 
    350356        last[i][p] = new boolean[len]; 
     
    422428 
    423429    sb.setLength(0); 
     430    String schemaVersion = "2008-09"; 
     431    String schemaPrefix = "http://www.openmicroscopy.org/Schemas/OME/"; 
     432    String schemaPath = schemaPrefix + schemaVersion; 
    424433    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + 
    425434      "<!-- Warning: this comment is an OME-XML metadata block, which " + 
     
    427436      "Please edit cautiously (if at all), and back up the original data " + 
    428437      "before doing so. For more information, see the OME-TIFF web site: " + 
    429       "http://loci.wisc.edu/ome/ome-tiff.html. --><OME " + 
    430       "xmlns=\"http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd\" " + 
     438      "http://loci.wisc.edu/ome/ome-tiff.html. -->\n" + 
     439      "<OME xmlns=\"" + schemaPath + "\" " + 
     440      "xmlns:bf=\"http://www.openmicroscopy.org/Schemas/BinaryFile/2008-09\" " + 
    431441      "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + 
    432442      "xsi:schemaLocation=\"" + 
    433       "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd " + 
    434       "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd\">"); 
     443      schemaPath + " " + schemaPath + "/ome.xsd\">"); 
    435444    for (int i=0; i<numImages; i++) { 
    436445      sb.append("<Image " + 
    437         "ID=\"openmicroscopy.org:Image:" + (i + 1) + "\" " + 
     446        "ID=\"Image:" + (i + 1) + "\" " + 
    438447        "Name=\"" + name + "\" " + 
    439         "DefaultPixels=\"openmicroscopy.org:Pixels:" + (i + 1) + "-1\">" + 
     448        "DefaultPixels=\"Pixels:" + (i + 1) + "\">" + 
    440449        "<CreationDate>" + creationDate + "</CreationDate>"); 
    441450      for (int p=0; p<numPixels[i]; p++) { 
    442451        sb.append("<Pixels " + 
    443           "ID=\"openmicroscopy.org:Pixels:" + (i + 1) + "-" + (p + 1) + "\" " + 
     452          "ID=\"Pixels:" + (i + 1) + "-" + (p + 1) + "\" " + 
    444453          "DimensionOrder=\"" + dimOrder[i][p] + "\" " + 
    445454          "PixelType=\"Uint8\" " + 
     
    465474          sizeX[i][p] + " x " + sizeY[i][p] + ", " + 
    466475          sizeZ[i][p] + "Z " + sizeC[i][p] + "C " + sizeT[i][p] + "T:"); 
    467         int len = images[i][p].length; 
     476        int len = planes[i][p].length; 
    468477        for (int j=0; j<len; j++) { 
    469478          int[] zct = FormatTools.getZCTCoords(dimOrder[i][p], 
     
    476485          IFD ifdHash = new IFD(); 
    477486          ifdHash.putIFDValue(IFD.IMAGE_DESCRIPTION, ""); 
    478           out.saveImage(images[i][p][j], ifdHash, last[i][p][j]); 
     487          // CTR FIXME NOW 
     488          //out.saveImage(planes[i][p][j], ifdHash, last[i][p][j]); 
    479489          if (last[i][p][j]) { 
    480490            // inject OME-XML block 
     
    509519                    ifd = localOffsets[ii][pp]; 
    510520                  } 
    511                   int num = images[ii][pp].length; 
     521                  int num = planes[ii][pp].length; 
    512522                  if ((!allI || numImages == 1) && numPixels[i] == 1) { 
    513523                    // only one Pixels in this file; don't need IFD/NumPlanes 
  • branches/4.1/components/bio-formats/utils/MinimumWriter.java

    r5325 r5617  
    99 * Demonstrates the minimum amount of metadata 
    1010 * necessary to write out an image plane. 
     11 * 
     12 * <dl><dt><b>Source code:</b></dt> 
     13 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/MinimumWriter.java">Trac</a>, 
     14 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/MinimumWriter.java">SVN</a></dd></dl> 
    1115 */ 
    1216public class MinimumWriter { 
     
    2933 
    3034    // create metadata object with minimum required metadata fields 
     35    System.out.println("Populating metadata..."); 
    3136    IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
    3237    meta.createRoot(); 
  • branches/4.1/components/bio-formats/utils/MultiFileExample.java

    r5325 r5617  
    88 
    99/** 
    10  * Simple example of how to open multiple files. 
     10 * Simple example of how to open multiple files simultaneously. 
    1111 * 
    1212 * <dl><dt><b>Source code:</b></dt> 
    13  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/MultiFileExample.java">Trac</a>, 
    14  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/MultiFileExample.java">SVN</a></dd></dl> 
     13 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/MultiFileExample.java">Trac</a>, 
     14 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/MultiFileExample.java">SVN</a></dd></dl> 
    1515 */ 
    1616public class MultiFileExample { 
  • branches/4.1/components/bio-formats/utils/PrintLensNA.java

    r5325 r5617  
    1414 * Uses Bio-Formats to extract lens numerical aperture 
    1515 * in a format-independent manner from a dataset. 
     16 * 
     17 * <dl><dt><b>Source code:</b></dt> 
     18 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/PrintLensNA.java">Trac</a>, 
     19 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/PrintLensNA.java">SVN</a></dd></dl> 
    1620 */ 
    1721public class PrintLensNA { 
  • branches/4.1/components/bio-formats/utils/PrintTimestamps.java

    r5325 r5617  
    1515 * Uses Bio-Formats to extract timestamp information 
    1616 * in a format-independent manner from a dataset. 
     17 * 
     18 * <dl><dt><b>Source code:</b></dt> 
     19 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/PrintTimestamps.java">Trac</a>, 
     20 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/PrintTimestamps.java">SVN</a></dd></dl> 
    1721 */ 
    1822public class PrintTimestamps { 
  • branches/4.1/components/bio-formats/utils/ReadWriteInMemory.java

    r5325 r5617  
    99import loci.formats.meta.IMetadata; 
    1010 
    11 /** Tests the Bio-Formats I/O logic to and from byte arrays in memory. */ 
     11/** 
     12 * Tests the Bio-Formats I/O logic to and from byte arrays in memory. 
     13 * 
     14 * <dl><dt><b>Source code:</b></dt> 
     15 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/ReadWriteInMemory.java">Trac</a>, 
     16 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/ReadWriteInMemory.java">SVN</a></dd></dl> 
     17 */ 
    1218public class ReadWriteInMemory { 
    1319 
  • branches/4.1/components/bio-formats/utils/SewTiffs.java

    r5325 r5617  
    33// 
    44 
    5 import java.awt.image.BufferedImage; 
    6 import java.util.Hashtable; 
    75import loci.common.Location; 
    86import loci.common.RandomAccessInputStream; 
    97import loci.formats.FilePattern; 
    10 import loci.formats.gui.BufferedImageReader; 
     8import loci.formats.MetadataTools; 
    119import loci.formats.in.TiffReader; 
     10import loci.formats.meta.IMetadata; 
    1211import loci.formats.out.TiffWriter; 
    1312import loci.formats.tiff.IFD; 
    1413import loci.formats.tiff.TiffParser; 
    1514 
    16 /** Stitches the first plane from a collection of TIFFs into a single file. */ 
     15/** 
     16 * Stitches the first plane from a collection of TIFFs into a single file. 
     17 * 
     18 * <dl><dt><b>Source code:</b></dt> 
     19 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/SewTiffs.java">Trac</a>, 
     20 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/SewTiffs.java">SVN</a></dd></dl> 
     21 */ 
    1722public class SewTiffs { 
    1823 
     
    3641    else num = Integer.parseInt(args[2]); 
    3742    System.out.println("Fixing " + base + "_C" + c + "_TP<1-" + num + ">.tiff"); 
    38     BufferedImageReader in = new BufferedImageReader(new TiffReader()); 
     43    TiffReader in = new TiffReader(); 
    3944    TiffWriter out = new TiffWriter(); 
    4045    String outId = base + "_C" + c + ".tiff"; 
     
    4651    for (int t=0; t<num; t++) { 
    4752      String inId = base + "_C" + c + "_TP" + (t + 1) + ".tiff"; 
     53      IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     54      in.setMetadataStore(meta); 
    4855      in.setId(inId); 
     56      out.setMetadataRetrieve(meta); 
    4957 
    5058      // read first image plane 
    51       BufferedImage image = in.openImage(0); 
     59      byte[] image = in.openBytes(0); 
    5260      in.close(); 
    5361 
     
    6371 
    6472        if (desc != null) { 
    65           //ifd = new Hashtable(); 
    6673          ifd = new IFD(); 
    6774          ifd.putIFDValue(IFD.IMAGE_DESCRIPTION, desc); 
    6875          comment = true; 
    69           out.saveImage(image, ifd, t == num - 1); 
     76          out.saveBytes(image, ifd, t == num - 1); 
    7077          System.out.print("."); 
    7178          continue; 
     
    7481 
    7582      // write image plane 
    76       out.saveImage(image, t == num - 1); 
     83      out.saveBytes(image, t == num - 1); 
    7784 
    7885      // update status 
  • branches/4.1/components/bio-formats/utils/TiffDumper.java

    r5456 r5617  
    99import loci.formats.tiff.*; 
    1010 
    11 /** Parses and outputs all IFDs for the given TIFF file(s). */ 
     11/** 
     12 * Parses and outputs all IFDs for the given TIFF file(s). 
     13 * 
     14 * <dl><dt><b>Source code:</b></dt> 
     15 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/TiffDumper.java">Trac</a>, 
     16 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/utils/TiffDumper.java">SVN</a></dd></dl> 
     17 */ 
    1218public class TiffDumper { 
    1319 
  • branches/4.1/components/common.properties

    r5551 r5617  
    1111# directory containing program source code 
    1212src.dir      = ${basedir}/src 
     13 
     14# directory containing source code for extra utilities 
     15utils.dir    = ${basedir}/utils 
    1316 
    1417# working directory to use for transient build files 
  • branches/4.1/components/java.xml

    r5551 r5617  
    8585      </manifest> 
    8686    </bundle> 
     87  </target> 
     88 
     89  <target name="utils" depends="jar" 
     90    description="compile extra utilities"> 
     91    <delete> 
     92      <fileset dir="${utils.dir}" includes="*.class"/> 
     93    </delete> 
     94    <javac debug="true" deprecation="true" source="1.5" target="1.5" 
     95      srcdir="${utils.dir}" includes="*.java" 
     96      classpath="${artifact.dir}/${component.jar}"/> 
    8797  </target> 
    8898 
  • branches/4.1/components/legacy/ome-editor/src/loci/ome/editor/MetadataPane.java

    r5334 r5617  
    7474import loci.formats.FormatException; 
    7575import loci.formats.ImageReader; 
     76import loci.formats.MetadataTools; 
    7677import loci.formats.gui.AWTImageTools; 
    7778import loci.formats.gui.BufferedImageReader; 
    7879import loci.formats.in.OMEXMLReader; 
    7980import loci.formats.in.TiffReader; 
     81import loci.formats.meta.IMetadata; 
    8082import loci.formats.ome.OMEXML2003FCMetadata; 
    8183import loci.formats.ome.OMEXMLMetadata; 
     
    458460      } 
    459461 
     462      try { 
     463        IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     464        writer.setMetadataRetrieve(meta); 
     465        meta.setPixelsBigEndian(new Boolean(!reader.isLittleEndian()), 0, 0); 
     466        meta.setPixelsDimensionOrder(reader.getDimensionOrder(), 0, 0); 
     467        meta.setPixelsSizeX(new Integer(reader.getSizeX()), 0, 0); 
     468        meta.setPixelsSizeY(new Integer(reader.getSizeY()), 0, 0); 
     469        meta.setPixelsSizeZ(new Integer(reader.getSizeZ()), 0, 0); 
     470        meta.setPixelsSizeC(new Integer(reader.getSizeC()), 0, 0); 
     471        meta.setPixelsSizeT(new Integer(reader.getSizeT()), 0, 0); 
     472        writer.setId(outId); 
     473      } 
     474      catch (Exception exc) { 
     475        if (exc instanceof RuntimeException) throw (RuntimeException) exc; 
     476        else exc.printStackTrace(); 
     477      } 
     478 
    460479      for(int i = 0; i < imageCount; i++) { 
    461         BufferedImage plane = null; 
     480        byte[] plane = null; 
    462481 
    463482        try { 
    464           plane = reader.openImage(i); 
     483          plane = reader.openBytes(i); 
    465484        } 
    466485        catch (Exception exc) { 
     
    476495        } 
    477496        // write plane to output file 
    478  
    479497        try { 
    480           writer.setId(outId); 
    481           writer.saveImage(plane, ifd, i == imageCount - 1); 
     498          writer.saveBytes(plane, ifd, i == imageCount - 1); 
    482499        } 
    483500        catch (Exception exc) { 
     
    516533 
    517534    for(int i = 0; i < imageCount; i++) { 
    518       BufferedImage plane = null; 
     535      byte[] plane = null; 
    519536 
    520537      try { 
    521         plane = reader.openImage(i); 
     538        plane = reader.openBytes(i); 
    522539      } 
    523540      catch (Exception exc) { 
     
    536553      try { 
    537554        writer.setId(outId); 
    538         writer.saveImage(plane, ifd, i == imageCount - 1); 
     555        writer.saveBytes(plane, ifd, i == imageCount - 1); 
    539556      } 
    540557      catch (Exception exc) { 
     
    561578        read.setId(id); 
    562579        int imageCount = read.getImageCount(); 
    563 //        BufferedImage whatever = reader.openImage(id, imageCount/2); 
    564580      } 
    565581      catch (Exception exc) { 
  • branches/4.1/components/loci-plugins/src/loci/plugins/Updater.java

    r5523 r5617  
    4141import java.net.URLEncoder; 
    4242 
    43 import loci.common.RandomAccessInputStream; 
    4443import loci.formats.FormatTools; 
    4544import loci.plugins.util.WindowTools; 
  • branches/4.1/components/loci-plugins/src/loci/plugins/exporter/Exporter.java

    r5579 r5617  
    4242import java.awt.Image; 
    4343import java.awt.image.BufferedImage; 
    44 import java.io.ByteArrayOutputStream; 
    4544import java.io.File; 
    4645import java.io.IOException; 
    47 import java.io.PrintStream; 
    4846 
    4947import javax.swing.JFileChooser; 
  • branches/4.1/components/native/bf-cpp/CMakeLists.txt

    r5588 r5617  
    6262target_link_libraries(showinf bfcpp jace "${JAVA_JVM_LIBRARY}") 
    6363 
    64 #add_executable(minimum_writer source/minimum_writer.cpp) 
     64add_executable(minimum_writer source/minimum_writer.cpp) 
    6565 
    66 #target_link_libraries(minimum_writer bfcpp jace "${JAVA_JVM_LIBRARY}") 
     66target_link_libraries(minimum_writer bfcpp jace "${JAVA_JVM_LIBRARY}") 
  • branches/4.1/components/native/bf-cpp/readme-macosx.txt

    r5156 r5617  
    44install the relevant binaries for Ant, CMake and Subversion. 
    55 
    6 To install the Boost Thread library, follow these steps: 
     6To install the Boost Thread library, we advise using MacPorts (macports.org): 
     7 
     8  sudo port install boost 
     9 
     10This will install Boost into /opt/local; e.g.: 
     11 
     12  /opt/local/include/boost 
     13 
     14Depending on your version of Boost, you may need to edit bf-cpp's 
     15CMakeLists.txt to tweak the Boost_ADDITIONAL_VERSIONS variable to include 
     16your version. 
     17 
     18Alternately, you can compile Boost yourself: 
    719 
    8201) Visit www.boost.org in your web browser. 
     
    2032  sudo make install 
    2133 
    22 This will install Boost into a subdirectory of /usr/local; e.g.: 
     34This will install Boost into /usr/local; e.g.: 
    2335 
    2436  /usr/local/include/boost-1_38 
    25  
    26 7) Depending on your version of Boost, you may need to edit bf-cpp's 
    27    CMakeLists.txt to tweak the Boost_ADDITIONAL_VERSIONS variable to include 
    28    your version. 
    29  
    30 Alternately, you can use MacPorts (http://www.macports.org/): 
    31  
    32   sudo port install boost 
  • branches/4.1/components/native/bf-cpp/source/minimum_writer.cpp

    r5588 r5617  
    4141#include <stdlib.h> 
    4242 
    43 // Demonstrates the minimum amount of metadata 
    44 // necessary to write out an image plane. 
     43#if defined (_WIN32) 
     44#define PATHSEP string(";") 
     45#else 
     46#define PATHSEP string(":") 
     47#endif 
    4548 
    46 int main(int argc, const char *argv[]) { 
    47   if (argc < 1) { 
     49// -- Methods -- 
     50 
     51/* Initializes the Java virtual machine. */ 
     52void createJVM() { 
     53  cout << "Creating JVM... "; 
     54  StaticVmLoader loader(JNI_VERSION_1_4); 
     55  OptionList list; 
     56  list.push_back(jace::ClassPath( 
     57    "jace-runtime.jar" + PATHSEP + 
     58    "bio-formats.jar" + PATHSEP + 
     59    "loci_tools.jar")); 
     60  list.push_back(jace::CustomOption("-Xcheck:jni")); 
     61  list.push_back(jace::CustomOption("-Xmx256m")); 
     62  list.push_back(jace::CustomOption("-Djava.awt.headless=true")); 
     63  //list.push_back(jace::CustomOption("-verbose:jni")); 
     64  jace::helper::createVm(loader, list, false); 
     65  cout << "JVM created." << endl; 
     66} 
     67 
     68/* 
     69 * Demonstrates the minimum amount of metadata 
     70 * necessary to write out an image plane. 
     71 */ 
     72bool minWrite(int argc, const char *argv[]) { 
     73  if (argc < 2) { 
    4874    cout << "Please specify an output file name." << endl; 
    4975    return -1; 
    5076  } 
    51   string id = argv[0]; 
     77  string id = argv[1]; 
    5278 
    5379  // create blank 512x512 image 
    5480  cout << "Creating random image..." << endl; 
    5581  int w = 512, h = 512; 
    56   int pixelType = FormatTools::UINT16; 
    57   bool bigEndian = Boolean::TRUE_Jace; 
     82  int pixelType = FormatTools::UINT16(); 
    5883 
    5984  //byte[] img = new byte[w * h * FormatTools.getBytesPerPixel(pixelType)]; 
     
    6590 
    6691  // create metadata object with minimum required metadata fields 
     92  cout << "Populating metadata..." << endl; 
    6793  IMetadata meta = MetadataTools::createOMEXMLMetadata(); 
    6894  meta.createRoot(); 
    69   meta.setPixelsBigEndian(Boolean(bigEndian), 0, 0); 
     95  meta.setPixelsBigEndian(Boolean(1), 0, 0); 
    7096  meta.setPixelsDimensionOrder("XYZCT", 0, 0); 
    7197  meta.setPixelsPixelType(FormatTools::getPixelTypeString(pixelType), 0, 0); 
    7298  meta.setPixelsSizeX(Integer(w), 0, 0); 
    73   meta.setPixelsSizeY(Integer(ih), 0, 0); 
     99  meta.setPixelsSizeY(Integer(h), 0, 0); 
    74100  meta.setPixelsSizeZ(Integer(1), 0, 0); 
    75101  meta.setPixelsSizeC(Integer(1), 0, 0); 
     
    87113  cout << "Done." << endl; 
    88114} 
     115 
     116int main(int argc, const char *argv[]) { 
     117  try { 
     118    createJVM(); 
     119    minWrite(argc, argv); 
     120  } 
     121  catch (FormatException& fe) { 
     122    fe.printStackTrace(); 
     123    return -2; 
     124  } 
     125  catch (IOException& ioe) { 
     126    ioe.printStackTrace(); 
     127    return -3; 
     128  } 
     129  catch (JNIException& jniException) { 
     130    cout << "An unexpected JNI error occurred. " << jniException.what() << endl; 
     131    return -4; 
     132  } 
     133  catch (std::exception& e) { 
     134    cout << "An unexpected C++ error occurred. " << e.what() << endl; 
     135    return -5; 
     136  } 
     137} 
  • branches/4.1/components/native/bf-cpp/source/showinf.cpp

    r5333 r5617  
    7070bool omexml = false; 
    7171bool normalize = false; 
    72 bool preload = false; 
    7372String* omexmlVersion = NULL; 
    7473int start = 0; 
     
    102101  list.push_back(jace::CustomOption("-Xcheck:jni")); 
    103102  list.push_back(jace::CustomOption("-Xmx256m")); 
     103  list.push_back(jace::CustomOption("-Djava.awt.headless=true")); 
    104104  //list.push_back(jace::CustomOption("-verbose:jni")); 
    105105  jace::helper::createVm(loader, list, false); 
     
    123123      else if (arg.compare("-omexml") == 0) omexml = true; 
    124124      else if (arg.compare("-normalize") == 0) normalize = true; 
    125       else if (arg.compare("-preload") == 0) preload = true; 
    126125      else if (arg.compare("-xmlversion") == 0) { 
    127126        omexmlVersion = new String(argv[++i]); 
     
    162161    "    [-merge] [-stitch] [-separate] [-expand] [-omexml]" << endl << 
    163162    "    [-normalize] [-range start end] [-series num]" << endl << 
    164     "    [-swap inputOrder] [-shuffle outputOrder] [-preload]" << endl << 
     163    "    [-swap inputOrder] [-shuffle outputOrder]" << endl << 
    165164    "    [-xmlversion v] [-crop x,y,w,h]" << endl << 
    166165    "" << endl << 
     
    182181    "     -swap: override the default input dimension order" << endl << 
    183182    "  -shuffle: override the default output dimension order" << endl << 
    184     "  -preload: pre-read entire file into a buffer; significantly" << endl << 
    185     "            reduces the time required to read the images, but" << endl << 
    186     "            requires more memory" << endl << 
    187183    "  -xmlversion: specify which OME-XML version to generate" << endl << 
    188184  //  "     -crop: crop images before displaying; argument is 'x,y,w,h'" << endl << 
     
    194190void configureReaderPreInit() { 
    195191  if (omexml) { 
     192    jobject null = NULL; 
     193    String xml(null); 
     194    if (omexmlVersion == NULL) omexmlVersion = new String(null); 
     195    MetadataStore store = 
     196      MetadataTools::createOMEXMLMetadata(xml, *omexmlVersion); 
     197 
    196198    reader->setOriginalMetadataPopulated(true); 
    197     MetadataStore store = MetadataTools::createOMEXMLMetadata(); 
    198199    if (!store.isNull()) reader->setMetadataStore(store); 
    199200  } 
     
    577578    return -5; 
    578579  } 
    579  
    580 } 
     580} 
  • branches/4.1/components/ome-io/src/loci/ome/io/OmeroReader.java

    r5534 r5617  
    3131import loci.formats.MetadataTools; 
    3232import loci.formats.meta.MetadataStore; 
    33  
    34 import ome.api.RawPixelsStore; // omero-common-4.0.3 
    35 import ome.system.Login; // omero-common-4.0.3 
    36 import ome.system.Server; // omero-common-4.0.3 
    37 import ome.system.ServiceFactory; // omero-common-4.0.3 
    38 import omero.api.RawPixelsStorePrx; // omero-common-4.0.3 
    39 import omero.model.Image; // omero-client-4.0.3 
    40 import omero.model.Pixels; // omero-client-4.0.3 
    41 //import omero.sys.Parameters; // omero-client-4.0.3 
     33import ome.api.RawPixelsStore; 
     34import ome.system.Login; 
     35import ome.system.Server; 
     36import ome.system.ServiceFactory; 
     37import omero.api.RawPixelsStorePrx; 
     38import omero.model.Image; 
     39import omero.model.Pixels; 
    4240 
    4341/** 
  • branches/4.1/components/ome-plugins/src/loci/plugins/ome/OMEPlugin.java

    r5501 r5617  
    5252import loci.formats.gui.BufferedImageReader; 
    5353import loci.ome.io.OMECredentials; 
     54import loci.ome.io.OMEUtils; 
    5455import loci.ome.io.OmeroReader; 
    55 import loci.ome.io.OMEUtils; 
    5656import loci.plugins.util.LibraryChecker; 
    5757import loci.plugins.util.WindowTools; 
  • branches/4.1/components/test-suite/src/loci/tests/testng/FormatReaderTestFactory.java

    r5531 r5617  
    3333 
    3434import java.io.File; 
    35 import java.io.FileOutputStream; 
    36 import java.io.IOException; 
    37 import java.io.PrintStream; 
    38 import java.text.FieldPosition; 
    39 import java.text.SimpleDateFormat; 
    40 import java.util.Arrays; 
    41 import java.util.Date; 
    42 import java.util.List; 
    4335import java.util.Vector; 
    4436 
    45 import loci.common.Location; 
    4637import loci.common.LogTools; 
    47 import loci.formats.ImageReader; 
    4838 
    4939/** 
  • branches/4.1/components/test-suite/src/loci/tests/testng/FormatWriterTest.java

    r5615 r5617  
    3333 
    3434import java.io.File; 
    35 import java.io.FileOutputStream; 
    3635import java.io.IOException; 
    37 import java.io.PrintStream; 
    38 import java.text.FieldPosition; 
    39 import java.text.SimpleDateFormat; 
    40 import java.util.Date; 
    4136import java.util.LinkedList; 
    4237import java.util.List; 
     
    5348import loci.formats.meta.IMetadata; 
    5449import loci.formats.meta.MetadataRetrieve; 
    55 import loci.formats.meta.MetadataStore; 
    5650import loci.formats.out.JPEG2000Writer; 
    5751import loci.formats.out.JPEGWriter; 
     
    204198        for (int image=0; image<imageCount; image++) { 
    205199          boolean lastImage = image == imageCount - 1; 
    206           writer.saveImage(reader.openImage(image), series, 
     200          writer.saveBytes(reader.openBytes(image), series, 
    207201            lastImage, lastImage && lastSeries); 
    208202        } 
  • branches/4.1/components/test-suite/src/loci/tests/testng/FormatWriterTestFactory.java

    r5531 r5617  
    3333 
    3434import java.io.File; 
    35 import java.io.FileOutputStream; 
    36 import java.io.IOException; 
    37 import java.io.PrintStream; 
    38 import java.text.FieldPosition; 
    39 import java.text.SimpleDateFormat; 
    40 import java.util.Arrays; 
    41 import java.util.Date; 
    42 import java.util.List; 
    4335import java.util.Vector; 
    4436 
    45 import loci.common.Location; 
    4637import loci.common.LogTools; 
    47 import loci.formats.ImageWriter; 
    4838 
    4939/** 
  • branches/4.1/components/visbio/src/loci/visbio/data/ExportPane.java

    r5272 r5617  
    4242import loci.formats.FormatException; 
    4343import loci.formats.FormatTools; 
    44 import loci.formats.ImageWriter; 
    45 import loci.formats.out.TiffWriter; 
    46 import loci.formats.tiff.IFD; 
    47 import loci.formats.tiff.TiffCompression; 
     44import loci.formats.gui.AWTImageTools; 
     45import loci.formats.gui.BufferedImageWriter; 
    4846import loci.visbio.BioTask; 
    4947import loci.visbio.TaskManager; 
    50 import loci.visbio.VisBio; 
    5148import loci.visbio.VisBioFrame; 
    5249import loci.visbio.util.BioComboBox; 
     
    116113 
    117114  /** Writer for saving images to disk. */ 
    118   private ImageWriter saver; 
     115  private BufferedImageWriter saver; 
    119116 
    120117  /** Data object from which exportable data will be derived. */ 
     
    142139    super("Export data"); 
    143140    this.bio = bio; 
    144     saver = new ImageWriter(); 
     141    saver = new BufferedImageWriter(); 
    145142 
    146143    // -- Page 1 -- 
     
    228225      public void run() { 
    229226        try { 
    230           TiffWriter tiffSaver = null; 
    231           if (format.equals("TIFF")) { 
    232             tiffSaver = (TiffWriter) saver.getWriter(TiffWriter.class); 
    233           } 
    234227          int count = 0; 
    235228          int max = 2 * numTotal; 
     
    270263              task.setStatus(count++, max, 
    271264                "Writing #" + (i + 1) + "/" + numTotal); 
    272               if (tiffSaver == null) { 
    273                 saver.setId(filename); 
    274                 saver.saveImage(image, true); 
    275               } 
    276               else { 
    277                 // save image to TIFF file 
    278                 IFD ifd = new IFD(); 
    279                 ifd.putIFDValue(IFD.SOFTWARE, 
    280                   VisBio.TITLE + " " + VisBio.VERSION); 
    281                 if (doLZW) { 
    282                   ifd.putIFDValue(IFD.COMPRESSION, TiffCompression.LZW); 
    283                   // do horizontal differencing 
    284                   ifd.putIFDValue(IFD.PREDICTOR, 2); 
    285                 } 
    286                 tiffSaver.setId(filename); 
    287                 tiffSaver.saveImage(image, ifd, true); 
    288               } 
     265              saver.setId(filename); 
     266              if (doLZW) saver.setCompression("LZW"); 
     267              saver.saveImage(AWTImageTools.makeBuffered(image), true); 
    289268            } 
    290269            else { 
     
    301280                  "Writing #" + img + "/" + numTotal); 
    302281                boolean last = j == lengths[excl] - 1; 
    303                 if (tiffSaver == null) { 
    304                   saver.setId(filename); 
    305                   saver.saveImage(image, last); 
    306                 } 
    307                 else { 
    308                   // save image to TIFF file 
    309                   IFD ifd = new IFD(); 
    310                   ifd.putIFDValue(IFD.SOFTWARE, 
    311                     VisBio.TITLE + " " + VisBio.VERSION); 
    312                   if (doLZW) { 
    313                     ifd.putIFDValue(IFD.COMPRESSION, TiffCompression.LZW); 
    314                     // do horizontal differencing 
    315                     ifd.putIFDValue(IFD.PREDICTOR, 2); 
    316                   } 
    317                   tiffSaver.setId(filename); 
    318                   tiffSaver.saveImage(image, ifd, last); 
    319                 } 
     282                saver.setId(filename); 
     283                if (doLZW) saver.setCompression("LZW"); 
     284                saver.saveImage(AWTImageTools.makeBuffered(image), last); 
    320285              } 
    321286            } 
  • branches/4.1/components/visbio/src/loci/visbio/ome/ImageUploader.java

    r5093 r5617  
    3030import loci.formats.StatusEvent; 
    3131import loci.formats.StatusListener; 
     32import loci.formats.gui.BufferedImageWriter; 
    3233import loci.formats.meta.MetadataRetrieve; 
    3334import loci.formats.meta.MetadataStore; 
     
    6566    try { 
    6667      OMEWriter writer = new OMEWriter(); 
     68      BufferedImageWriter biWriter = new BufferedImageWriter(writer); 
    6769      MetadataStore store = MetadataTools.createOMEXMLMetadata(); 
    6870      store.setRoot(data.getOMEXMLRoot()); 
     
    9193        pos[1] = zct[0]; 
    9294        System.arraycopy(cPos, 0, pos, 2, cPos.length); 
    93         writer.saveImage(data.getImage(pos), i == total - 1); 
     95        biWriter.saveImage(data.getImage(pos), i == total - 1); 
    9496      } 
    9597 
  • branches/4.1/components/visbio/src/loci/visbio/view/CaptureHandler.java

    r5093 r5617  
    3434 
    3535import loci.formats.FormatException; 
    36 import loci.formats.ImageWriter; 
     36import loci.formats.gui.BufferedImageWriter; 
    3737import loci.formats.gui.ExtensionFileFilter; 
    3838import loci.visbio.SystemManager; 
     
    162162    new Thread("VisBio-SnapshotThread-" + window.getName()) { 
    163163      public void run() { 
    164         ImageWriter writer = new ImageWriter(); 
     164        BufferedImageWriter writer = new BufferedImageWriter(); 
    165165        try { 
    166166          writer.setId(id); 
     
    253253        // step incrementally from position to position, grabbing images 
    254254        int count = 1; 
    255         ImageWriter writer = new ImageWriter(); 
     255        BufferedImageWriter writer = new BufferedImageWriter(); 
    256256        double[] mxStart = (double[]) pos.elementAt(0); 
    257257        for (int i=1; i<size; i++) { 
  • branches/4.1/utils/.classpath

    r5442 r5617  
    33        <classpathentry excluding="mipav/**" kind="src" path=""/> 
    44        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
    5         <classpathentry combineaccessrules="false" kind="src" path="/bio-formats"/> 
    6         <classpathentry combineaccessrules="false" kind="src" path="/common"/> 
    7         <classpathentry combineaccessrules="false" kind="src" path="/ome-xml"/> 
    8         <classpathentry combineaccessrules="false" kind="src" path="/External libraries"/> 
    95        <classpathentry kind="output" path=""/> 
    106</classpath> 
  • branches/4.1/utils/Ascii.java

    r1237 r5617  
    33// 
    44 
    5 /** Outputs the readable ASCII table from 32 to 127. */ 
     5/** 
     6 * Outputs the readable ASCII table from 32 to 127. 
     7 * 
     8 * <dl><dt><b>Source code:</b></dt> 
     9 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/Ascii.java">Trac</a>, 
     10 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/Ascii.java">SVN</a></dd></dl> 
     11 */ 
    612public class Ascii { 
    713 
  • branches/4.1/utils/Binary.java

    r2776 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.File; 
     7import java.io.FileReader; 
    68 
    79/** 
    810 * Attempts to convert a string of zeroes and ones into readable text. 
    911 * Try 'java Binary bits.txt' for an example. 
     12 * 
     13 * <dl><dt><b>Source code:</b></dt> 
     14 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/Binary.java">Trac</a>, 
     15 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/Binary.java">SVN</a></dd></dl> 
    1016 */ 
    1117public class Binary { 
  • branches/4.1/utils/BinaryDiff.java

    r2490 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.DataInputStream; 
     6import java.io.File; 
     7import java.io.FileInputStream; 
     8import java.io.IOException; 
    69 
    710/** 
     
    912 * form. It is not as smart as diff in that it does not identify added or 
    1013 * missing bytes, just changes. 
     14 * 
     15 * <dl><dt><b>Source code:</b></dt> 
     16 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/BinaryDiff.java">Trac</a>, 
     17 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/BinaryDiff.java">SVN</a></dd></dl> 
    1118 */ 
    1219public class BinaryDiff { 
  • branches/4.1/utils/CompareTrees.java

    r1181 r5617  
    1212 * have matching file sizes, but does not check byte-for-byte equality when 
    1313 * the file sizes match. 
     14 * 
     15 * <dl><dt><b>Source code:</b></dt> 
     16 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/CompareTrees.java">Trac</a>, 
     17 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/CompareTrees.java">SVN</a></dd></dl> 
    1418 */ 
    1519public class CompareTrees { 
  • branches/4.1/utils/DownloadURL.java

    r3882 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.FileOutputStream; 
     6import java.io.InputStream; 
    67import java.net.URL; 
    78 
     9/** 
     10 * A poor, barebones impression of wget. :-) 
     11 * 
     12 * <dl><dt><b>Source code:</b></dt> 
     13 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/DownloadURL.java">Trac</a>, 
     14 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/DownloadURL.java">SVN</a></dd></dl> 
     15 */ 
    816public class DownloadURL { 
    917 
  • branches/4.1/utils/DumpClass.java

    r5443 r5617  
    33// 
    44 
    5 import java.lang.reflect.*; 
     5import java.lang.reflect.Constructor; 
     6import java.lang.reflect.Field; 
     7import java.lang.reflect.Method; 
    68 
    7 /** Uses reflection to print a bunch of information about a class. */ 
     9/** 
     10 * Uses reflection to print a bunch of information about a class. 
     11 * 
     12 * <dl><dt><b>Source code:</b></dt> 
     13 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/DumpClass.java">Trac</a>, 
     14 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/DumpClass.java">SVN</a></dd></dl> 
     15 */ 
    816public class DumpClass { 
    917 
  • branches/4.1/utils/EditDistance.java

    r1220 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.IOException; 
     7import java.io.InputStreamReader; 
    68 
    7 /** Computes minimum edit distance between two strings. */ 
     9/** 
     10 * Computes minimum edit distance between two strings. 
     11 * 
     12 * <dl><dt><b>Source code:</b></dt> 
     13 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/EditDistance.java">Trac</a>, 
     14 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/EditDistance.java">SVN</a></dd></dl> 
     15 */ 
    816public class EditDistance { 
    917 
  • branches/4.1/utils/FileOpsTest.java

    r3878 r5617  
    55import java.io.File; 
    66 
    7 /** Tests performance of File.exists() vs File.listFiles(). */ 
     7/** 
     8 * Tests performance of File.exists() vs File.listFiles(). 
     9 * 
     10 * <dl><dt><b>Source code:</b></dt> 
     11 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/FileOpsTest.java">Trac</a>, 
     12 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/FileOpsTest.java">SVN</a></dd></dl> 
     13 */ 
    814public class FileOpsTest { 
    915  public static void main(String[] args) { 
  • branches/4.1/utils/FixEOLSpaces.java

    r1628 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.File; 
     7import java.io.FileReader; 
     8import java.io.FileWriter; 
     9import java.io.IOException; 
     10import java.io.PrintWriter; 
    611 
    712/** 
    813 * Scans text files for end-of-line spaces or tabs, and 
    914 * multiple consecutive blank lines, and removes them. 
     15 * 
     16 * <dl><dt><b>Source code:</b></dt> 
     17 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/FixEOLSpaces.java">Trac</a>, 
     18 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/FixEOLSpaces.java">SVN</a></dd></dl> 
    1019 */ 
    1120public class FixEOLSpaces { 
  • branches/4.1/utils/LineLength.java

    r5443 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.File; 
     7import java.io.FileFilter; 
     8import java.io.FileReader; 
     9import java.io.IOException; 
    610import java.util.ArrayList; 
    711import java.util.Arrays; 
     
    1014 * Scans text files for lines longer than a specified length. 
    1115 * Also checks for tabs and end-of-line spaces. 
     16 * 
     17 * <dl><dt><b>Source code:</b></dt> 
     18 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/LineLength.java">Trac</a>, 
     19 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/LineLength.java">SVN</a></dd></dl> 
    1220 */ 
    1321public class LineLength implements FileFilter { 
  • branches/4.1/utils/RandomPass.java

    r5391 r5617  
    33// 
    44 
    5 /** Generates a random 8-character password. */ 
     5/** 
     6 * Generates random passwords. 
     7 * 
     8 * <dl><dt><b>Source code:</b></dt> 
     9 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/RandomPass.java">Trac</a>, 
     10 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/RandomPass.java">SVN</a></dd></dl> 
     11 */ 
    612public class RandomPass { 
    713 
  • branches/4.1/utils/SortList.java

    r5443 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.File; 
     7import java.io.FileReader; 
     8import java.io.FileWriter; 
     9import java.io.PrintWriter; 
    610import java.util.ArrayList; 
    711import java.util.Arrays; 
    812 
    9 /** Sorts a text file alphabetically, removing duplicates. */ 
     13/** 
     14 * Sorts a text file alphabetically, removing duplicates. 
     15 * 
     16 * <dl><dt><b>Source code:</b></dt> 
     17 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/SortList.java">Trac</a>, 
     18 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/SortList.java">SVN</a></dd></dl> 
     19 */ 
    1020public class SortList { 
    1121 
  • branches/4.1/utils/TestMem.java

    r5443 r5617  
    33// 
    44 
    5 import java.awt.event.*; 
    6 import javax.swing.*; 
     5import java.awt.event.ActionEvent; 
     6import java.awt.event.ActionListener; 
     7 
     8import javax.swing.Box; 
     9import javax.swing.BoxLayout; 
     10import javax.swing.JButton; 
     11import javax.swing.JFrame; 
     12import javax.swing.JLabel; 
     13import javax.swing.JPanel; 
     14import javax.swing.Timer; 
    715import javax.swing.border.EmptyBorder; 
    816 
    9 /** A little GUI for testing Java memory behavior. */ 
     17/** 
     18 * A little GUI for testing Java memory behavior. 
     19 * 
     20 * <dl><dt><b>Source code:</b></dt> 
     21 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/TestMem.java">Trac</a>, 
     22 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/TestMem.java">SVN</a></dd></dl> 
     23 */ 
    1024@SuppressWarnings("serial") 
    1125public class TestMem extends JFrame implements ActionListener { 
  • branches/4.1/utils/UniqueTraces.java

    r5443 r5617  
    33// 
    44 
    5 import java.io.*; 
     5import java.io.BufferedReader; 
     6import java.io.IOException; 
     7import java.io.InputStreamReader; 
    68import java.util.ArrayList; 
    79 
     
    911 * Reads in a bunch of stack traces from standard input, 
    1012 * filters out duplicates and outputs what's left. 
     13 * 
     14 * <dl><dt><b>Source code:</b></dt> 
     15 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/UniqueTraces.java">Trac</a>, 
     16 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/UniqueTraces.java">SVN</a></dd></dl> 
    1117 */ 
    1218public class UniqueTraces { 
  • branches/4.1/utils/UnusedImports.java

    r5445 r5617  
    11// 
    22// UnusedImports.java 
     3// 
    34 
    45import java.io.BufferedReader; 
    56import java.io.FileInputStream; 
     7import java.io.IOException; 
    68import java.io.InputStreamReader; 
    7 import java.io.IOException; 
    89import java.util.Vector; 
    910 
    10 /** Scans Java source files for unused and package imports. */ 
     11/** 
     12 * Scans Java source files for unused and package imports. 
     13 * 
     14 * <dl><dt><b>Source code:</b></dt> 
     15 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/UnusedImports.java">Trac</a>, 
     16 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/UnusedImports.java">SVN</a></dd></dl> 
     17 */ 
    1118public class UnusedImports { 
    1219  public static void checkFile(String filename) throws IOException { 
Note: See TracChangeset for help on using the changeset viewer.