Changeset 4122


Ignore:
Timestamp:
06/20/08 17:51:35 (11 years ago)
Author:
melissa
Message:

Populate PhysicalSizeZ and TimeIncrement for FV1000 files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/FV1000Reader.java

    r4105 r4122  
    4949  public static final String[] FV1000_SUFFIXES = {"oib", "oif"}; 
    5050 
     51  private static final int NUM_DIMENSIONS = 9; 
     52 
    5153  // -- Fields -- 
    5254 
     
    6971  private Hashtable oibMapping; 
    7072 
    71   private String[] code, size; 
     73  private String[] code, size, pixelSize; 
    7274  private int imageDepth; 
    7375  private Vector previewNames; 
     
    316318    oif.close(); 
    317319 
    318     code = new String[9]; 
    319     size = new String[9]; 
     320    code = new String[NUM_DIMENSIONS]; 
     321    size = new String[NUM_DIMENSIONS]; 
     322    pixelSize = new String[NUM_DIMENSIONS]; 
    320323 
    321324    StringTokenizer st = new StringTokenizer(s, "\r\n"); 
     
    409412          if (key.equals("AxisCode")) code[ndx] = value; 
    410413          else if (key.equals("MaxSize")) size[ndx] = value; 
    411         } 
     414          else if (key.equals("Interval")) pixelSize[ndx] = value; 
     415        } 
    412416        else if ((prefix + key).equals( 
    413417          "[Reference Image Parameter] - ImageDepth")) 
     
    568572    status("Populating metadata"); 
    569573 
     574    MetadataStore store = 
     575      new FilterMetadata(getMetadataStore(), isMetadataFiltered()); 
     576 
    570577    // calculate axis sizes 
    571578 
     
    573580    for (int i=0; i<9; i++) { 
    574581      int ss = Integer.parseInt(size[i]); 
     582      if (pixelSize[i] == null) pixelSize[i] = "1.0"; 
     583      Float pixel = new Float(pixelSize[i]); 
    575584      code[i] = code[i].substring(1, code[i].length() - 1); 
    576585      if (code[i].equals("X")) core.sizeX[0] = ss; 
    577586      else if (code[i].equals("Y")) core.sizeY[0] = ss; 
    578       else if (code[i].equals("Z")) core.sizeZ[0] = ss; 
    579       else if (code[i].equals("T")) core.sizeT[0] = ss; 
     587      else if (code[i].equals("Z")) { 
     588        core.sizeZ[0] = ss; 
     589        store.setDimensionsPhysicalSizeZ(pixel, 0, 0); 
     590      } 
     591      else if (code[i].equals("T")) { 
     592        core.sizeT[0] = ss; 
     593        store.setDimensionsTimeIncrement(pixel, 0, 0); 
     594      }  
    580595      else if (ss > 0) { 
    581596        if (core.sizeC[0] == 0) core.sizeC[0] = ss; 
     
    661676    // populate MetadataStore 
    662677 
    663     MetadataStore store = 
    664       new FilterMetadata(getMetadataStore(), isMetadataFiltered()); 
    665678    for (int i=0; i<core.sizeX.length; i++) { 
    666679      store.setImageName("Series " + i, i); 
Note: See TracChangeset for help on using the changeset viewer.