Changeset 3985


Ignore:
Timestamp:
04/25/08 16:42:09 (12 years ago)
Author:
curtis
Message:

Update OME uploader to work with new Dataset implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/ome/ImageUploader.java

    r3818 r3985  
    6565      OMEWriter writer = new OMEWriter(); 
    6666      MetadataStore store = MetadataTools.createOMEXMLMetadata(); 
    67       store.setRoot(data.getOMENode()); 
     67      store.setRoot(data.getOMEXMLRoot()); 
    6868      MetadataRetrieve retrieve = (MetadataRetrieve) store; 
    6969      writer.setMetadataRetrieve(retrieve); 
     
    7272      writer.setId(id); 
    7373 
    74       int numFiles = data.getFilenames().length; 
    75       int numImages = data.getImagesPerSource(); 
     74      String order = retrieve.getPixelsDimensionOrder(0, 0); 
     75      int sizeZ = retrieve.getPixelsSizeZ(0, 0).intValue(); 
     76      int sizeC = retrieve.getPixelsSizeZ(0, 0).intValue(); 
     77      int sizeT = retrieve.getPixelsSizeZ(0, 0).intValue(); 
    7678 
    77       for (int i=0; i<numFiles; i++) { 
    78         for (int j=0; j<numImages; j++) { 
    79           int[] coords = FormatTools.getZCTCoords( 
    80             retrieve.getPixelsDimensionOrder(0, 0), 
    81             retrieve.getPixelsSizeZ(0, 0).intValue(), 
    82             retrieve.getPixelsSizeC(0, 0).intValue(), 
    83             retrieve.getPixelsSizeT(0, 0).intValue(), 
    84             numImages*numFiles, numImages*i + j); 
    85           writer.saveImage( 
    86             data.getImage(new int[] {coords[0], coords[1], coords[2], j}), 
    87             i == numFiles - 1 && j == numImages - 1); 
    88         } 
     79      int[] len = data.getLengths(); 
     80      int total = FormatTools.getRasterLength(len); 
     81      int[] cLen = new int[len.length - 2]; 
     82      System.arraycopy(len, 2, cLen, 0, cLen.length); 
     83 
     84      for (int i=0; i<total; i++) { 
     85        int[] zct = FormatTools.getZCTCoords(order, 
     86          sizeZ, sizeC, sizeT, total, i); 
     87        int[] cPos = FormatTools.rasterToPosition(cLen, zct[1]); 
     88        int[] pos = new int[2 + cPos.length]; 
     89        pos[0] = zct[2]; 
     90        pos[1] = zct[0]; 
     91        System.arraycopy(cPos, 0, pos, 2, cPos.length); 
     92        writer.saveImage(data.getImage(pos), i == total - 1); 
    8993      } 
    9094 
Note: See TracChangeset for help on using the changeset viewer.