Changeset 4183


Ignore:
Timestamp:
07/10/08 13:37:29 (12 years ago)
Author:
melissa
Message:

Fixed the WellSampleIndex values.

File:
1 edited

Legend:

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

    r4161 r4183  
    2424package loci.formats.in; 
    2525 
     26import java.awt.Point; 
    2627import java.io.*; 
    2728import java.util.*; 
     
    6263 
    6364  private int wellRows, wellCols; 
    64   private Vector rows, cols; 
     65  private Vector wellCoordinates; 
    6566 
    6667  // -- Constructor -- 
     
    134135    seriesCount = 0; 
    135136    totalImages = 0; 
     137 
     138    emWaves = exWaves = null; 
     139    wellCoordinates = null; 
     140    timings = null; 
     141    creationDate = null; 
     142    wellRows = wellCols = 0; 
    136143  } 
    137144 
     
    149156    timings = new Vector(); 
    150157 
    151     rows = new Vector(); 
    152     cols = new Vector(); 
     158    wellCoordinates = new Vector(); 
    153159 
    154160    byte[] b = new byte[(int) in.length()]; 
     
    214220        store.setPlaneTimingExposureTime(new Float(0), i, 0, q); 
    215221      } 
    216       store.setWellSampleIndex(new Integer(i), 0, i, 0); 
     222      int row = (int) ((Point) wellCoordinates.get(i)).x; 
     223      int col = (int) ((Point) wellCoordinates.get(i)).y; 
     224      store.setWellSampleIndex(new Integer(i), 0, row*wellCols + col, 0); 
    217225    } 
    218226 
     
    229237    private MetadataStore store; 
    230238    private int nextPlate = 0; 
     239    private int currentRow = -1, currentCol = -1; 
    231240 
    232241    public InCellHandler(MetadataStore store) { 
     
    238247      if (currentQName.equals("UserComment")) { 
    239248        store.setImageDescription(value, 0); 
     249      } 
     250    } 
     251 
     252    public void endElement(String uri, String localName, String qName) { 
     253      if (qName.equals("Image")) { 
     254        Point p = new Point(currentRow, currentCol); 
     255        if (!wellCoordinates.contains(p)) wellCoordinates.add(p); 
    240256      } 
    241257    } 
     
    306322      } 
    307323      else if (qName.equals("Row")) { 
    308         rows.add(new Integer(attributes.getValue("number"))); 
     324        currentRow = Integer.parseInt(attributes.getValue("number")); 
    309325      } 
    310326      else if (qName.equals("Column")) { 
    311         cols.add(new Integer(attributes.getValue("number"))); 
     327        currentCol = Integer.parseInt(attributes.getValue("number")); 
    312328      } 
    313329    } 
Note: See TracChangeset for help on using the changeset viewer.