Changeset 6068


Ignore:
Timestamp:
03/25/10 10:55:27 (10 years ago)
Author:
melissa
Message:

Catch NumberFormatException when parsing exposure times, and adjust SizeC if an RGB Metamorph file is encountered.

Location:
trunk/components/bio-formats/src/loci/formats/in
Files:
2 edited

Legend:

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

    r5624 r6068  
    206206      } 
    207207      // exposure times are stored in milliseconds, we want them in seconds 
    208       exposures.add(new Double(Double.parseDouble(value) / 1000)); 
     208      try { 
     209        exposures.add(new Double(Double.parseDouble(value) / 1000)); 
     210      } 
     211      catch (NumberFormatException e) { } 
    209212    } 
    210213  } 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphTiffReader.java

    r6055 r6068  
    102102      } 
    103103    } 
    104     core[0].sizeC = uniqueC.size(); 
     104    int effectiveC = uniqueC.size(); 
     105    if (effectiveC == 0) effectiveC = 1; 
     106    core[0].sizeC = effectiveC * ifds.get(0).getSamplesPerPixel(); 
    105107 
    106108    Vector<Double> uniqueZ = new Vector<Double>(); 
     
    110112    } 
    111113    core[0].sizeZ = uniqueZ.size(); 
    112     core[0].sizeT = ifds.size() / (getSizeZ() * getSizeC()); 
     114    core[0].sizeT = ifds.size() / (getSizeZ() * effectiveC); 
    113115 
    114116    MetadataStore store = 
Note: See TracChangeset for help on using the changeset viewer.