Changeset 4861


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

Remove unnecessary getters for nested private class.

File:
1 edited

Legend:

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

    r4860 r4861  
    173173 
    174174    int type = in.readShort(); 
     175 
     176    int lensID = in.readShort(); 
     177 
     178    in.seek(180); 
     179 
     180    int rawSizeT = in.readShort(); 
     181    int sizeT = rawSizeT == 0 ? 1 : rawSizeT; 
     182 
     183    int sequence = in.readShort(); 
     184 
     185    float xTiltAngle = in.readFloat(); 
     186    float yTiltAngle = in.readFloat(); 
     187    float zTiltAngle = in.readFloat(); 
     188 
     189    int rawSizeC = in.readShort(); 
     190    int sizeC = rawSizeC == 0 ? 1 : rawSizeC; 
     191 
     192    short[] waves = new short[5]; 
     193    for (int i=0; i<waves.length; i++) { 
     194      waves[i] = in.readShort(); 
     195    } 
     196 
     197    float xOrigin = in.readFloat(); 
     198    float yOrigin = in.readFloat(); 
     199    float zOrigin = in.readFloat(); 
     200 
     201    in.skipBytes(4); 
     202 
     203    String[] title = new String[10]; 
     204    for (int i=0; i<title.length; i++) { 
     205      // Make sure that "null" characters are stripped out 
     206      title[i] = in.readString(80).replaceAll("\0", ""); 
     207    } 
     208 
     209    long fp = in.getFilePointer(); 
     210 
     211    in.seek(76); 
     212 
     213    float[] minWave = new float[5]; 
     214    float[] maxWave = new float[5]; 
     215 
     216    minWave[0] = in.readFloat(); 
     217    maxWave[0] = in.readFloat(); 
     218 
     219    float meanIntensity = in.readFloat(); 
     220    int spaceGroupNumber = in.readInt(); 
     221 
     222    extSize = in.readInt(); 
     223 
     224    in.seek(128); 
     225    numIntsPerSection = in.readShort(); 
     226    numFloatsPerSection = in.readShort(); 
     227 
     228    short numSubResSets = in.readShort(); 
     229    short zAxisReductionQuotient = in.readShort(); 
     230 
     231    for (int i=1; i<=3; i++) { 
     232      minWave[i] = in.readFloat(); 
     233      maxWave[i] = in.readFloat(); 
     234    } 
     235 
     236    in.seek(172); 
     237 
     238    minWave[4] = in.readFloat(); 
     239    maxWave[4] = in.readFloat(); 
     240 
     241    // --- compute some secondary values --- 
     242 
    175243    String imageType = 
    176244      type < IMAGE_TYPES.length ? IMAGE_TYPES[type] : "unknown"; 
    177245 
    178     int lensID = in.readShort(); 
    179  
    180     in.seek(180); 
    181  
    182     int sizeT = in.readShort(); 
    183     int realSizeT = sizeT == 0 ? 1 : sizeT; 
    184  
    185     int sequence = in.readShort(); 
    186246    String imageSequence; 
    187247    switch (sequence) { 
     
    202262    } 
    203263 
    204     float xTiltAngle = in.readFloat(); 
    205     float yTiltAngle = in.readFloat(); 
    206     float zTiltAngle = in.readFloat(); 
    207  
    208     int sizeC = in.readShort(); 
    209     int realSizeC = sizeC == 0 ? 1 : sizeC; 
    210     int sizeZ = imageCount / (realSizeC * realSizeT); 
    211  
    212     short[] waves = new short[5]; 
    213     for (int i=0; i<waves.length; i++) { 
    214       waves[i] = in.readShort(); 
    215     } 
    216  
    217     float xOrigin = in.readFloat(); 
    218     float yOrigin = in.readFloat(); 
    219     float zOrigin = in.readFloat(); 
    220  
    221     in.skipBytes(4); 
    222  
    223     String[] title = new String[10]; 
    224     for (int i=0; i<title.length; i++) { 
    225       // Make sure that "null" characters are stripped out 
    226       title[i] = in.readString(80).replaceAll("\0", ""); 
    227     } 
    228  
    229     long fp = in.getFilePointer(); 
    230  
    231     in.seek(76); 
    232  
    233     float[] minWave = new float[5]; 
    234     float[] maxWave = new float[5]; 
    235  
    236     minWave[0] = in.readFloat(); 
    237     maxWave[0] = in.readFloat(); 
    238  
    239     float meanWave0 = in.readFloat(); 
    240     int spaceGroupNumber = in.readInt(); 
    241  
    242     extSize = in.readInt(); 
    243  
    244     in.seek(128); 
    245     numIntsPerSection = in.readShort(); 
    246     numFloatsPerSection = in.readShort(); 
    247  
    248     short numSubResSets = in.readShort(); 
    249     short zAxisReductionQuotient = in.readShort(); 
    250  
    251     for (int i=1; i<=3; i++) { 
    252       minWave[i] = in.readFloat(); 
    253       maxWave[i] = in.readFloat(); 
    254     } 
    255  
    256     in.seek(172); 
    257  
    258     minWave[4] = in.readFloat(); 
    259     maxWave[4] = in.readFloat(); 
     264    int sizeZ = imageCount / (sizeC * sizeT); 
     265 
     266    String imageDesc = title[0]; 
     267    if (imageDesc != null && imageDesc.length() == 0) imageDesc = null; 
    260268 
    261269    // --- populate core metadata --- 
     
    299307    } 
    300308 
    301     core[0].sizeT = realSizeT; 
     309    core[0].sizeT = sizeT; 
    302310 
    303311    core[0].dimensionOrder = "XY" + imageSequence.replaceAll("W", "C"); 
    304312 
    305     core[0].sizeC = realSizeC; 
     313    core[0].sizeC = sizeC; 
    306314    core[0].sizeZ = sizeZ; 
    307315 
     
    341349    addMeta("Lens ID Number", lensID); 
    342350 
    343     addMeta("Number of timepoints", sizeT); 
     351    addMeta("Number of timepoints", rawSizeT); 
    344352 
    345353    addMeta("Image sequence", imageSequence); 
     
    349357    addMeta("Z axis tilt angle", zTiltAngle); 
    350358 
    351     addMeta("Number of wavelengths", sizeC); 
     359    addMeta("Number of wavelengths", rawSizeC); 
    352360    addMeta("Number of focal planes", sizeZ); 
    353361 
     
    367375    } 
    368376 
    369     addMeta("Wavelength 1 mean intensity", meanWave0); 
     377    addMeta("Wavelength 1 mean intensity", meanIntensity); 
    370378    addMeta("Space group number", spaceGroupNumber); 
    371379 
     
    404412    store.setImageName("", 0); 
    405413 
    406     String desc = title[0]; 
    407     if (desc != null && desc.length() == 0) desc = null; 
    408     store.setImageDescription(desc, 0); 
     414    store.setImageDescription(imageDesc, 0); 
    409415 
    410416    // ----- The Extended Header data handler begins here ------ 
     
    414420    in.seek(fp); 
    415421 
    416     setOffsetInfo(sequence, sizeZ, realSizeC, realSizeT); 
    417     extHdrFields = new DVExtHdrFields[sizeZ][realSizeC][getSizeT()]; 
    418  
    419     ndFilters = new Float[realSizeC]; 
     422    setOffsetInfo(sequence, sizeZ, sizeC, sizeT); 
     423    extHdrFields = new DVExtHdrFields[sizeZ][sizeC][sizeT]; 
     424 
     425    ndFilters = new Float[sizeC]; 
    420426 
    421427    // if matching log file exists, extract key/value pairs from it 
     
    426432    // Extended Header information array for that image 
    427433    int offset = HEADER_LENGTH + numIntsPerSection * 4; 
    428     for (int i=0; i<getImageCount(); i++) { 
     434    for (int i=0; i<imageCount; i++) { 
    429435      int[] coords = getZCTCoords(i); 
    430436      int z = coords[0]; 
     
    437443      if (!logFound) { 
    438444        store.setPlaneTimingDeltaT( 
    439           new Float(extHdrFields[z][w][t].getTimeStampSeconds()), 0, 0, i); 
     445          new Float(extHdrFields[z][w][t].timeStampSeconds), 0, 0, i); 
    440446      } 
    441447      store.setPlaneTimingExposureTime( 
    442         new Float(extHdrFields[z][w][t].getExpTime()), 0, 0, i); 
     448        new Float(extHdrFields[z][w][t].expTime), 0, 0, i); 
    443449 
    444450      // stage position 
    445451      if (!logFound) { 
    446452        store.setStagePositionPositionX( 
    447           new Float(extHdrFields[z][w][t].getStageXCoord()), 0, 0, i); 
     453          new Float(extHdrFields[z][w][t].stageXCoord), 0, 0, i); 
    448454        store.setStagePositionPositionY( 
    449           new Float(extHdrFields[z][w][t].getStageYCoord()), 0, 0, i); 
     455          new Float(extHdrFields[z][w][t].stageYCoord), 0, 0, i); 
    450456        store.setStagePositionPositionZ( 
    451           new Float(extHdrFields[z][w][t].getStageZCoord()), 0, 0, i); 
    452       } 
    453     } 
    454  
    455     for (int w=0; w<realSizeC; w++) { 
     457          new Float(extHdrFields[z][w][t].stageZCoord), 0, 0, i); 
     458      } 
     459    } 
     460 
     461    for (int w=0; w<sizeC; w++) { 
    456462      store.setLogicalChannelEmWave(new Integer(waves[w]), 0, w); 
    457463      store.setLogicalChannelExWave( 
    458         new Integer((int) extHdrFields[0][w][0].getExWavelen()), 0, w); 
     464        new Integer((int) extHdrFields[0][w][0].exWavelen), 0, w); 
    459465      if (ndFilters[w] == null) { 
    460         ndFilters[w] = new Float(extHdrFields[0][w][0].getNdFilter()); 
     466        ndFilters[w] = new Float(extHdrFields[0][w][0].ndFilter); 
    461467      } 
    462468      store.setLogicalChannelNdFilter(ndFilters[w], 0, w); 
     
    881887    } 
    882888 
    883     /** Various getters for the Extended header fields. */ 
    884     public float getPhotosensorReading() { return photosensorReading; } 
    885     public float getTimeStampSeconds() { return timeStampSeconds; } 
    886     public float getStageXCoord() { return stageXCoord; } 
    887     public float getStageYCoord() { return stageYCoord; } 
    888     public float getStageZCoord() { return stageZCoord; } 
    889     public float getMinInten() { return minInten; } 
    890     public float getMaxInten() { return maxInten; } 
    891     public float getMeanInten() { return meanInten; } 
    892     public float getExpTime() { return expTime; } 
    893     public float getNdFilter() { return ndFilter; } 
    894     public float getExWavelen() { return exWavelen; } 
    895     public float getEmWavelen() { return emWavelen; } 
    896     public float getIntenScaling() { return intenScaling; } 
    897  
    898889  } 
    899890 
Note: See TracChangeset for help on using the changeset viewer.