Changeset 6105 for branches/4.1


Ignore:
Timestamp:
04/08/10 14:08:01 (10 years ago)
Author:
melissa
Message:

Prevent Image.CreationDate and PlaneTiming.DeltaT from being populated with a negative Image index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/components/bio-formats/src/loci/formats/in/LeicaHandler.java

    r5691 r6105  
    708708 
    709709      long ms = DateTools.getMillisFromTicks(high, low); 
    710       if (count == 0) { 
    711         String date = DateTools.convertDate(ms, DateTools.COBOL); 
    712         if (DateTools.getTime(date, DateTools.ISO8601_FORMAT) < 
    713           System.currentTimeMillis()) 
    714         { 
    715           store.setImageCreationDate(date, numDatasets); 
    716         } 
    717         firstStamp = ms; 
    718         store.setPlaneTimingDeltaT(new Float(0), numDatasets, 0, count); 
    719       } 
    720       else { 
    721         CoreMetadata coreMeta = core.get(numDatasets); 
    722         int nImages = coreMeta.sizeZ * coreMeta.sizeT * coreMeta.sizeC; 
    723         if (count < nImages) { 
    724           ms -= firstStamp; 
    725           store.setPlaneTimingDeltaT( 
    726             new Float(ms / 1000.0), numDatasets, 0, count); 
     710      if (numDatasets >= 0) { 
     711        if (count == 0) { 
     712          String date = DateTools.convertDate(ms, DateTools.COBOL); 
     713          if (DateTools.getTime(date, DateTools.ISO8601_FORMAT) < 
     714            System.currentTimeMillis()) 
     715          { 
     716            store.setImageCreationDate(date, numDatasets); 
     717          } 
     718          firstStamp = ms; 
     719          store.setPlaneTimingDeltaT(new Float(0), numDatasets, 0, count); 
     720        } 
     721        else { 
     722          CoreMetadata coreMeta = core.get(numDatasets); 
     723          int nImages = coreMeta.sizeZ * coreMeta.sizeT * coreMeta.sizeC; 
     724          if (count < nImages) { 
     725            ms -= firstStamp; 
     726            store.setPlaneTimingDeltaT( 
     727              new Float(ms / 1000.0), numDatasets, 0, count); 
     728          } 
    727729        } 
    728730      } 
Note: See TracChangeset for help on using the changeset viewer.