Changeset 4862


Ignore:
Timestamp:
02/27/09 17:52:08 (11 years ago)
Author:
curtis
Message:

Progress on DeltavisionReader refactoring.

File:
1 edited

Legend:

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

    r4861 r4862  
    414414    store.setImageDescription(imageDesc, 0); 
    415415 
    416     // ----- The Extended Header data handler begins here ------ 
     416    // --- parse extended header --- 
     417 
     418    // TODO - Refactor this section into those above, to maintain 
     419    // the division between header I/O, core metadata population, 
     420    // original metadata population, and OME metadata population. 
    417421 
    418422    status("Reading extended header"); 
     
    437441      int w = coords[1]; 
    438442      int t = coords[2]; 
     443 
     444      // -- read in the extended header data -- 
     445 
    439446      in.seek(offset + getTotalOffset(z, w, t)); 
    440       extHdrFields[z][w][t] = new DVExtHdrFields(in); 
     447      DVExtHdrFields hdr = new DVExtHdrFields(in); 
     448      extHdrFields[z][w][t] = hdr; 
     449 
     450      // -- record original metadata -- 
     451 
     452      /* NB: Sloooow... 
     453      String prefix = "Extended header Z" + z + " W" + w + " T" + t; 
     454      addMeta(prefix + " - Photosensor reading", hdr.photosensorReading); 
     455      addMeta(prefix + " - Time stamp (in s)", hdr.timeStampSeconds); 
     456      addMeta(prefix + " - X stage coordinates", hdr.stageXCoord); 
     457      addMeta(prefix + " - Y stage coordinates", hdr.stageYCoord); 
     458      addMeta(prefix + " - Z stage coordinates", hdr.stageZCoord); 
     459      addMeta(prefix + " - Minimum intensity", hdr.minInten); 
     460      addMeta(prefix + " - Maximum intensity", hdr.maxInten); 
     461      addMeta(prefix + " - Exposure time (in ms)", hdr.expTime); 
     462      addMeta(prefix + " - Neutral density value", hdr.ndFilter); 
     463      addMeta(prefix + " - Excitation filter wavelength", hdr.exWavelen); 
     464      addMeta(prefix + " - Emission filter wavelength", hdr.emWavelen); 
     465      addMeta(prefix + " - Intensity scaling factor", hdr.intenScaling); 
     466      addMeta(prefix + " - Energy conversion factor", hdr.energyConvFactor); 
     467      */ 
     468 
     469      // -- record OME metadata -- 
    441470 
    442471      // plane timing 
    443472      if (!logFound) { 
    444         store.setPlaneTimingDeltaT( 
    445           new Float(extHdrFields[z][w][t].timeStampSeconds), 0, 0, i); 
     473        store.setPlaneTimingDeltaT(new Float(hdr.timeStampSeconds), 0, 0, i); 
    446474      } 
    447       store.setPlaneTimingExposureTime( 
    448         new Float(extHdrFields[z][w][t].expTime), 0, 0, i); 
     475      store.setPlaneTimingExposureTime(new Float(hdr.expTime), 0, 0, i); 
    449476 
    450477      // stage position 
    451478      if (!logFound) { 
    452         store.setStagePositionPositionX( 
    453           new Float(extHdrFields[z][w][t].stageXCoord), 0, 0, i); 
    454         store.setStagePositionPositionY( 
    455           new Float(extHdrFields[z][w][t].stageYCoord), 0, 0, i); 
    456         store.setStagePositionPositionZ( 
    457           new Float(extHdrFields[z][w][t].stageZCoord), 0, 0, i); 
     479        store.setStagePositionPositionX(new Float(hdr.stageXCoord), 0, 0, i); 
     480        store.setStagePositionPositionY(new Float(hdr.stageYCoord), 0, 0, i); 
     481        store.setStagePositionPositionZ(new Float(hdr.stageZCoord), 0, 0, i); 
    458482      } 
    459483    } 
    460484 
    461485    for (int w=0; w<sizeC; w++) { 
     486      DVExtHdrFields hdrC = extHdrFields[0][w][0]; 
    462487      store.setLogicalChannelEmWave(new Integer(waves[w]), 0, w); 
    463       store.setLogicalChannelExWave( 
    464         new Integer((int) extHdrFields[0][w][0].exWavelen), 0, w); 
    465       if (ndFilters[w] == null) { 
    466         ndFilters[w] = new Float(extHdrFields[0][w][0].ndFilter); 
    467       } 
     488      store.setLogicalChannelExWave(new Integer((int) hdrC.exWavelen), 0, w); 
     489      if (ndFilters[w] == null) ndFilters[w] = new Float(hdrC.ndFilter); 
    468490      store.setLogicalChannelNdFilter(ndFilters[w], 0, w); 
    469491    } 
     
    794816    private float maxInten; 
    795817 
    796     /** Mean intesity. */ 
    797     private float meanInten; 
     818    ///** Mean intesity. */ 
     819    //private float meanInten; 
    798820 
    799821    /** Exposure time in milliseconds. */ 
     
    803825    private float ndFilter; 
    804826 
    805     /** Excitation filter number. */ 
    806     private float exFilter; 
    807  
    808     /** Emiision filter number. */ 
    809     private float emFilter; 
     827    ///** Excitation filter number. */ 
     828    //private float exFilter; 
     829 
     830    ///** Emiision filter number. */ 
     831    //private float emFilter; 
    810832 
    811833    /** Excitation filter wavelength. */ 
     
    841863      sb.append("\nmaxInten: "); 
    842864      sb.append(maxInten); 
    843       sb.append("\nmeanInten: "); 
    844       sb.append(meanInten); 
     865      //sb.append("\nmeanInten: "); 
     866      //sb.append(meanInten); 
    845867      sb.append("\nexpTime: "); 
    846868      sb.append(expTime); 
    847869      sb.append("\nndFilter: "); 
    848870      sb.append(ndFilter); 
    849       sb.append("\nexFilter: "); 
    850       sb.append(exFilter); 
    851       sb.append("\nemFilter: "); 
    852       sb.append(emFilter); 
     871      //sb.append("\nexFilter: "); 
     872      //sb.append(exFilter); 
     873      //sb.append("\nemFilter: "); 
     874      //sb.append(emFilter); 
    853875      sb.append("\nexWavelen: "); 
    854876      sb.append(exWavelen); 
Note: See TracChangeset for help on using the changeset viewer.