Changeset 4807


Ignore:
Timestamp:
02/16/09 10:05:12 (11 years ago)
Author:
melissa
Message:

Added SPW population for Flex files. Some metadata is still missing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/FlexReader.java

    r4805 r4807  
    6464  private Vector channelNames; 
    6565 
     66  private Vector xPositions; 
     67  private Vector yPositions; 
     68 
    6669  // -- Constructor -- 
    6770 
     
    136139 
    137140    channelNames = new Vector(); 
     141    xPositions = new Vector(); 
     142    yPositions = new Vector(); 
    138143 
    139144    // parse factors from XML 
     
    150155    MetadataStore store = 
    151156      new FilterMetadata(getMetadataStore(), isMetadataFiltered()); 
    152     store.setInstrumentID("Instrument:0", 0); 
    153157 
    154158    Vector n = new Vector(); 
     
    234238 
    235239    MetadataTools.populatePixels(store, this); 
     240    store.setInstrumentID("Instrument:0", 0); 
     241 
     242    int[] lengths = new int[] {plateCount, wellCount, fieldCount}; 
     243 
     244    for (int i=0; i<getSeriesCount(); i++) { 
     245      int[] pos = FormatTools.rasterToPosition(lengths, i); 
     246 
     247      store.setImageID("Image:" + i, i); 
     248      store.setImageInstrumentRef("Instrument:0", i); 
     249      store.setWellSampleIndex(new Integer(i), pos[0], pos[1], pos[2]); 
     250      store.setWellSampleImageRef("Image:" + i, pos[0], pos[1], pos[2]); 
     251      if (pos[2] < xPositions.size()) { 
     252        store.setWellSamplePosX((Float) xPositions.get(pos[2]), pos[0], 
     253          pos[1], pos[2]); 
     254      } 
     255      if (pos[2] < yPositions.size()) { 
     256        store.setWellSamplePosY((Float) yPositions.get(pos[2]), pos[0], 
     257          pos[1], pos[2]); 
     258      } 
     259    } 
     260 
    236261  } 
    237262 
     
    305330        addMeta("Sublayout " + (nextSublayout - 1) + " Field " + 
    306331          (nextField - 1) + " " + currentQName, value); 
     332        Float offset = new Float(value); 
     333        if (currentQName.equals("OffsetX")) xPositions.add(offset); 
     334        else yPositions.add(offset); 
    307335      } 
    308336      else if (currentQName.equals("OffsetZ")) { 
Note: See TracChangeset for help on using the changeset viewer.