Changeset 6038


Ignore:
Timestamp:
03/17/10 16:46:16 (10 years ago)
Author:
melissa
Message:

Fixed compile errors in Bio-Formats utils.

Location:
trunk/components/bio-formats/utils
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/utils/CommentSurgery.java

    r6026 r6038  
    33// 
    44 
     5import loci.common.RandomAccessInputStream; 
    56import loci.formats.tiff.TiffParser; 
    67import loci.formats.tiff.TiffSaver; 
     
    3738      else { 
    3839        System.out.println(len + " -> " + xml.length()); 
    39         TiffSaver.overwriteComment(id, xml); 
     40        TiffSaver saver = new TiffSaver(id); 
     41        RandomAccessInputStream in = new RandomAccessInputStream(id); 
     42        saver.overwriteComment(in, xml); 
     43        in.close(); 
    4044      } 
    4145    } 
  • trunk/components/bio-formats/utils/ConvertToOmeTiff.java

    r5598 r6038  
    33// 
    44 
     5import loci.common.services.ServiceFactory; 
    56import loci.formats.ImageReader; 
    6 import loci.formats.MetadataTools; 
    77import loci.formats.meta.IMetadata; 
     8import loci.formats.services.OMEXMLService; 
    89import loci.formats.out.OMETiffWriter; 
    910 
     
    3132 
    3233      // record metadata to OME-XML format 
    33       IMetadata omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
     34      ServiceFactory factory = new ServiceFactory(); 
     35      OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     36      IMetadata omexmlMeta = service.createOMEXMLMetadata(); 
    3437      reader.setMetadataStore(omexmlMeta); 
    3538      reader.setId(id); 
  • trunk/components/bio-formats/utils/EditImageName.java

    r5714 r6038  
    33// 
    44 
     5import loci.common.services.ServiceFactory; 
    56import loci.formats.ImageReader; 
    6 import loci.formats.MetadataTools; 
    77import loci.formats.meta.IMetadata; 
     8import loci.formats.services.OMEXMLService; 
    89 
    910/** 
     
    2324    ImageReader reader = new ImageReader(); 
    2425    // record metadata to OME-XML format 
    25     IMetadata omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
     26    ServiceFactory factory = new ServiceFactory(); 
     27    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     28    IMetadata omexmlMeta = service.createOMEXMLMetadata(); 
    2629    reader.setMetadataStore(omexmlMeta); 
    2730    String id = args[0]; 
     
    4851    // output full OME-XML block 
    4952    System.out.println("Full OME-XML dump:"); 
    50     String xml = MetadataTools.getOMEXML(omexmlMeta); 
     53    String xml = service.getOMEXML(omexmlMeta); 
    5154    System.out.println(xml); 
    5255  } 
  • trunk/components/bio-formats/utils/EditTiffComment.java

    r6026 r6038  
    4141      System.out.print("Saving " + f); 
    4242      // save results back to the TIFF file 
    43       TiffSaver.overwriteComment(f, xml); 
     43      TiffSaver saver = new TiffSaver(f); 
     44      RandomAccessInputStream in = new RandomAccessInputStream(f); 
     45      saver.overwriteComment(in, xml); 
     46      in.close(); 
    4447      System.out.println(" [done]"); 
    4548    } 
  • trunk/components/bio-formats/utils/ExtractFlexMetadata.java

    r5598 r6038  
    3535        TiffParser parser = new TiffParser(in); 
    3636        IFD firstIFD = parser.getIFDs().get(0); 
    37         String xml = 
    38           (String) firstIFD.getIFDValue(FlexReader.FLEX, true, String.class); 
     37        String xml = firstIFD.getIFDTextValue(FlexReader.FLEX); 
    3938        in.close(); 
    4039        FileWriter writer = new FileWriter(new File(outId)); 
  • trunk/components/bio-formats/utils/MakeLZW.java

    r5598 r6038  
    33// 
    44 
    5 import loci.formats.MetadataTools; 
     5import loci.common.services.ServiceFactory; 
    66import loci.formats.ImageReader; 
    77import loci.formats.meta.IMetadata; 
    88import loci.formats.out.TiffWriter; 
     9import loci.formats.services.OMEXMLService; 
    910 
    1011/** 
     
    1920  public static void main(String[] args) throws Exception { 
    2021    ImageReader reader = new ImageReader(); 
    21     IMetadata omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
     22 
     23    ServiceFactory factory = new ServiceFactory(); 
     24    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     25    IMetadata omexmlMeta = service.createOMEXMLMetadata(); 
     26 
    2227    reader.setMetadataStore(omexmlMeta); 
    2328    TiffWriter writer = new TiffWriter(); 
  • trunk/components/bio-formats/utils/MakeTestOmeTiff.java

    r5987 r6038  
    88import java.io.IOException; 
    99import java.util.*; 
     10import loci.common.RandomAccessInputStream; 
    1011import loci.formats.*; 
    1112import loci.formats.out.TiffWriter; 
     
    537538            } 
    538539            out.close(); 
    539             TiffSaver.overwriteComment(filenames[i][p][j], xml); 
     540            TiffSaver saver = new TiffSaver(filenames[i][p][j]); 
     541            RandomAccessInputStream in = 
     542              new RandomAccessInputStream(filenames[i][p][j]); 
     543            saver.overwriteComment(in, xml); 
     544            in.close(); 
    540545          } 
    541546        } 
  • trunk/components/bio-formats/utils/MinimumWriter.java

    r5603 r6038  
    33// 
    44 
     5import loci.common.services.ServiceFactory; 
    56import loci.formats.*; 
    67import loci.formats.meta.IMetadata; 
     8import loci.formats.services.OMEXMLService; 
    79 
    810/** 
     
    3436    // create metadata object with minimum required metadata fields 
    3537    System.out.println("Populating metadata..."); 
    36     IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     38 
     39    ServiceFactory factory = new ServiceFactory(); 
     40    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     41    IMetadata meta = service.createOMEXMLMetadata(); 
     42 
    3743    meta.createRoot(); 
    3844    meta.setPixelsBigEndian(Boolean.TRUE, 0, 0); 
  • trunk/components/bio-formats/utils/ParallelRead.java

    r5722 r6038  
    44 
    55import java.io.File; 
     6import loci.common.services.ServiceFactory; 
    67import loci.formats.ImageReader; 
    7 import loci.formats.MetadataTools; 
    88import loci.formats.meta.IMetadata; 
     9import loci.formats.services.OMEXMLService; 
    910 
    1011/** 
     
    2627    try { 
    2728      ImageReader r = new ImageReader(); 
    28       IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     29      ServiceFactory factory = new ServiceFactory(); 
     30      OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     31      IMetadata meta = service.createOMEXMLMetadata(); 
    2932      r.setMetadataStore(meta); 
    3033      r.setId(id); 
  • trunk/components/bio-formats/utils/PrintLensNA.java

    r5624 r6038  
    55import java.io.IOException; 
    66 
     7import loci.common.services.DependencyException; 
     8import loci.common.services.ServiceException; 
     9import loci.common.services.ServiceFactory; 
    710import loci.formats.FormatException; 
    811import loci.formats.IFormatReader; 
    912import loci.formats.ImageReader; 
    10 import loci.formats.MetadataTools; 
    1113import loci.formats.meta.IMetadata; 
     14import loci.formats.services.OMEXMLService; 
    1215 
    1316/** 
     
    2124public class PrintLensNA { 
    2225 
    23   public static void main(String[] args) throws FormatException, IOException { 
     26  public static void main(String[] args) 
     27    throws DependencyException, FormatException, IOException, ServiceException 
     28  { 
    2429    // parse command line arguments 
    2530    if (args.length < 1) { 
     
    3136    // configure reader 
    3237    IFormatReader reader = new ImageReader(); 
    33     IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     38    ServiceFactory factory = new ServiceFactory(); 
     39    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     40    IMetadata meta = service.createOMEXMLMetadata(); 
    3441    reader.setMetadataStore(meta); 
    3542    System.out.println("Initializing file: " + id); 
  • trunk/components/bio-formats/utils/PrintTimestamps.java

    r5624 r6038  
    66 
    77import loci.common.DateTools; 
     8import loci.common.services.ServiceFactory; 
    89import loci.formats.FormatReader; 
    910import loci.formats.IFormatReader; 
    1011import loci.formats.ImageReader; 
    11 import loci.formats.MetadataTools; 
    1212import loci.formats.meta.IMetadata; 
     13import loci.formats.services.OMEXMLService; 
    1314 
    1415/** 
     
    114115 
    115116    // create OME-XML metadata store of the latest schema version 
    116     IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     117    ServiceFactory factory = new ServiceFactory(); 
     118    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     119    IMetadata meta = service.createOMEXMLMetadata(); 
    117120    // or if you want a specific schema version, you can use: 
    118     //IMetadata meta = MetadataTools.createOMEXMLMetadata(null, "2009-02"); 
     121    //IMetadata meta = service.createOMEXMLMetadata(null, "2009-02"); 
    119122    //meta.createRoot(); 
    120123 
  • trunk/components/bio-formats/utils/ReadWriteInMemory.java

    r5598 r6038  
    44 
    55import java.io.*; 
     6import loci.common.ByteArrayHandle; 
    67import loci.common.Location; 
    7 import loci.common.ByteArrayHandle; 
     8import loci.common.services.DependencyException; 
     9import loci.common.services.ServiceException; 
     10import loci.common.services.ServiceFactory; 
    811import loci.formats.*; 
    912import loci.formats.meta.IMetadata; 
     13import loci.formats.services.OMEXMLService; 
    1014 
    1115/** 
     
    1822public class ReadWriteInMemory { 
    1923 
    20   public static void main(String[] args) throws FormatException, IOException { 
     24  public static void main(String[] args) 
     25    throws DependencyException, FormatException, IOException, ServiceException 
     26  { 
    2127    if (args.length < 1) { 
    2228      System.out.println("Please specify a (small) image file."); 
     
    4652    System.out.println(); 
    4753    System.out.println("Reading image data from memory..."); 
    48     IMetadata omeMeta = MetadataTools.createOMEXMLMetadata(); 
     54 
     55    ServiceFactory factory = new ServiceFactory(); 
     56    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     57    IMetadata omeMeta = service.createOMEXMLMetadata(); 
     58 
    4959    ImageReader reader = new ImageReader(); 
    5060    reader.setMetadataStore(omeMeta); 
  • trunk/components/bio-formats/utils/SewTiffs.java

    r5598 r6038  
    55import loci.common.Location; 
    66import loci.common.RandomAccessInputStream; 
     7import loci.common.services.ServiceFactory; 
    78import loci.formats.FilePattern; 
    8 import loci.formats.MetadataTools; 
    99import loci.formats.in.TiffReader; 
    1010import loci.formats.meta.IMetadata; 
    1111import loci.formats.out.TiffWriter; 
     12import loci.formats.services.OMEXMLService; 
    1213import loci.formats.tiff.IFD; 
    1314import loci.formats.tiff.TiffParser; 
     
    5152    for (int t=0; t<num; t++) { 
    5253      String inId = base + "_C" + c + "_TP" + (t + 1) + ".tiff"; 
    53       IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     54      ServiceFactory factory = new ServiceFactory(); 
     55      OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     56      IMetadata meta = service.createOMEXMLMetadata(); 
    5457      in.setMetadataStore(meta); 
    5558      in.setId(inId); 
  • trunk/components/bio-formats/utils/WriteRGBMovie.java

    r5973 r6038  
    33// 
    44 
     5import loci.common.services.ServiceFactory; 
    56import loci.formats.*; 
    67import loci.formats.meta.IMetadata; 
     8import loci.formats.services.OMEXMLService; 
    79 
    810/** 
     
    4143    // create metadata object with required metadata fields 
    4244    System.out.println("Populating metadata..."); 
    43     IMetadata meta = MetadataTools.createOMEXMLMetadata(); 
     45    ServiceFactory factory = new ServiceFactory(); 
     46    OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     47    IMetadata meta = service.createOMEXMLMetadata(); 
    4448    meta.createRoot(); 
    4549    meta.setPixelsBigEndian(Boolean.TRUE, 0, 0); 
Note: See TracChangeset for help on using the changeset viewer.