Changeset 6241


Ignore:
Timestamp:
05/05/10 16:40:05 (10 years ago)
Author:
melissa
Message:

Updated Bio-Formats utils to use new MetadataStore/MetadataRetrieve.

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

Legend:

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

    r6038 r6241  
    77import loci.formats.meta.IMetadata; 
    88import loci.formats.services.OMEXMLService; 
     9 
     10import ome.xml.r201004.enums.DimensionOrder; 
     11import ome.xml.r201004.enums.EnumerationException; 
     12import ome.xml.r201004.enums.PixelType; 
     13import ome.xml.r201004.primitives.PositiveInteger; 
    914 
    1015/** 
     
    4247 
    4348    meta.createRoot(); 
    44     meta.setPixelsBigEndian(Boolean.TRUE, 0, 0); 
    45     meta.setPixelsDimensionOrder("XYZCT", 0, 0); 
    46     meta.setPixelsPixelType(FormatTools.getPixelTypeString(pixelType), 0, 0); 
    47     meta.setPixelsSizeX(w, 0, 0); 
    48     meta.setPixelsSizeY(h, 0, 0); 
    49     meta.setPixelsSizeZ(1, 0, 0); 
    50     meta.setPixelsSizeC(1, 0, 0); 
    51     meta.setPixelsSizeT(1, 0, 0); 
    52     meta.setLogicalChannelSamplesPerPixel(1, 0, 0); 
     49    meta.setPixelsBinDataBigEndian(Boolean.TRUE, 0, 0); 
     50    meta.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0); 
     51    meta.setPixelsType( 
     52      PixelType.fromString(FormatTools.getPixelTypeString(pixelType)), 0); 
     53    meta.setPixelsSizeX(new PositiveInteger(w), 0); 
     54    meta.setPixelsSizeY(new PositiveInteger(h), 0); 
     55    meta.setPixelsSizeZ(new PositiveInteger(1), 0); 
     56    meta.setPixelsSizeC(new PositiveInteger(1), 0); 
     57    meta.setPixelsSizeT(new PositiveInteger(1), 0); 
     58    meta.setChannelSamplesPerPixel(1, 0, 0); 
    5359 
    5460    // write image plane to disk 
  • trunk/components/bio-formats/utils/PrintTimestamps.java

    r6038 r6241  
    4545  public static void printGlobalTiming(IMetadata meta, int series) { 
    4646    String imageName = meta.getImageName(series); 
    47     String creationDate = meta.getImageCreationDate(series); 
    48     Double timeInc = meta.getDimensionsTimeIncrement(series, 0); 
     47    String creationDate = meta.getImageAcquiredDate(series); 
     48    Double timeInc = meta.getPixelsTimeIncrement(series); 
    4949    System.out.println(); 
    5050    System.out.println("Global timing information:"); 
     
    6363    System.out.println( 
    6464      "Timing information per timepoint (from beginning of experiment):"); 
    65     int planeCount = meta.getPlaneCount(series, 0); 
     65    int planeCount = meta.getPlaneCount(series); 
    6666    for (int i = 0; i < planeCount; i++) { 
    67       Double deltaT = meta.getPlaneTimingDeltaT(series, 0, i); 
     67      Double deltaT = meta.getPlaneDeltaT(series, i); 
    6868      if (deltaT == null) continue; 
    6969      // convert plane ZCT coordinates into image plane index 
    70       int z = meta.getPlaneTheZ(series, 0, i).intValue(); 
    71       int c = meta.getPlaneTheC(series, 0, i).intValue(); 
    72       int t = meta.getPlaneTheT(series, 0, i).intValue(); 
     70      int z = meta.getPlaneTheZ(series, i).intValue(); 
     71      int c = meta.getPlaneTheC(series, i).intValue(); 
     72      int t = meta.getPlaneTheT(series, i).intValue(); 
    7373      if (z == 0 && c == 0) { 
    7474        System.out.println("\tTimepoint #" + t + " = " + deltaT + " s"); 
     
    8989    System.out.println( 
    9090      "Timing information per plane (from beginning of experiment):"); 
    91     int planeCount = meta.getPlaneCount(series, 0); 
     91    int planeCount = meta.getPlaneCount(series); 
    9292    for (int i = 0; i < planeCount; i++) { 
    93       Double deltaT = meta.getPlaneTimingDeltaT(series, 0, i); 
     93      Double deltaT = meta.getPlaneDeltaT(series, i); 
    9494      if (deltaT == null) continue; 
    9595      // convert plane ZCT coordinates into image plane index 
    96       int z = meta.getPlaneTheZ(series, 0, i).intValue(); 
    97       int c = meta.getPlaneTheC(series, 0, i).intValue(); 
    98       int t = meta.getPlaneTheT(series, 0, i).intValue(); 
     96      int z = meta.getPlaneTheZ(series, i).intValue(); 
     97      int c = meta.getPlaneTheC(series, i).intValue(); 
     98      int t = meta.getPlaneTheT(series, i).intValue(); 
    9999      System.out.println("\tZ " + z + ", C " + c + ", T " + t + " = " + 
    100100        deltaT + " s"); 
  • trunk/components/bio-formats/utils/WriteRGBMovie.java

    r6038 r6241  
    77import loci.formats.meta.IMetadata; 
    88import loci.formats.services.OMEXMLService; 
     9 
     10import ome.xml.r201004.enums.DimensionOrder; 
     11import ome.xml.r201004.enums.EnumerationException; 
     12import ome.xml.r201004.enums.PixelType; 
     13import ome.xml.r201004.primitives.PositiveInteger; 
    914 
    1015/** 
     
    4752    IMetadata meta = service.createOMEXMLMetadata(); 
    4853    meta.createRoot(); 
    49     meta.setPixelsBigEndian(Boolean.TRUE, 0, 0); 
    50     meta.setPixelsDimensionOrder("XYZCT", 0, 0); 
    51     meta.setPixelsPixelType(FormatTools.getPixelTypeString(pixelType), 0, 0); 
    52     meta.setPixelsSizeX(w, 0, 0); 
    53     meta.setPixelsSizeY(h, 0, 0); 
    54     meta.setPixelsSizeZ(1, 0, 0); 
    55     meta.setPixelsSizeC(numChannels, 0, 0); 
    56     meta.setPixelsSizeT(numFrames, 0, 0); 
    57     meta.setLogicalChannelSamplesPerPixel(numChannels, 0, 0); 
     54    meta.setPixelsBinDataBigEndian(Boolean.TRUE, 0, 0); 
     55    meta.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0); 
     56    meta.setPixelsType( 
     57      PixelType.fromString(FormatTools.getPixelTypeString(pixelType)), 0); 
     58    meta.setPixelsSizeX(new PositiveInteger(w), 0); 
     59    meta.setPixelsSizeY(new PositiveInteger(h), 0); 
     60    meta.setPixelsSizeZ(new PositiveInteger(1), 0); 
     61    meta.setPixelsSizeC(new PositiveInteger(numChannels), 0); 
     62    meta.setPixelsSizeT(new PositiveInteger(numFrames), 0); 
     63    meta.setChannelSamplesPerPixel(numChannels, 0, 0); 
    5864 
    5965    // write image planes to disk 
Note: See TracChangeset for help on using the changeset viewer.