Changeset 3012 for trunk


Ignore:
Timestamp:
07/26/07 09:11:12 (13 years ago)
Author:
melissa
Message:

Removed date parsing logic from ZVI - no matter how we do it, the date is going to be wrong.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/DataTools.java

    r3009 r3012  
    4242  /** Timestamp formats. */ 
    4343  public static final int UNIX = 0;  // January 1, 1970 
    44   public static final int VMS = 1;   // November 17, 1858 
    45   public static final int COBOL = 2;  // January 1, 1601 
     44  public static final int COBOL = 1;  // January 1, 1601 
    4645 
    4746  /** Milliseconds until UNIX epoch. */ 
    4847  public static final long UNIX_EPOCH = 0; 
    49   public static final long VMS_EPOCH = 3531859200000L; 
    5048  public static final long COBOL_EPOCH = 11644444800000L; 
    5149 
     
    533531 
    534532    switch (format) { 
    535       case VMS: 
    536         ms -= VMS_EPOCH; 
    537         break; 
    538533      case COBOL: 
    539534        ms -= COBOL_EPOCH; 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r3009 r3012  
    360360    MetadataStore store = getMetadataStore(); 
    361361 
    362     String date = (String) getMeta("Acquisition Date 0"); 
    363     if (date == null) date = (String) getMeta("Acquisition Date");  
    364     try {  
    365       long stamp = Long.parseLong(date) / 1000000;  
    366       date = DataTools.convertDate(stamp, DataTools.VMS); 
    367     } 
    368     catch (Exception e) {  
    369       try { 
    370         date = (String) getMeta("File Date"); 
    371         if (date == null) date = (String) getMeta("File Date 0"); 
    372         long stamp = Long.parseLong(date) / 1000000; 
    373         date = DataTools.convertDate(stamp, DataTools.VMS); 
    374       } 
    375       catch (Exception ex) { date = null; }  
    376     } 
    377     store.setImage((String) getMeta("Title"), date, null, null); 
     362    store.setImage((String) getMeta("Title"), null, null, null); 
    378363 
    379364    if (bpp == 1 || bpp == 3) core.pixelType[0] = FormatTools.UINT8; 
     
    422407      String white = (String) getMeta("WhiteValue " + idx); 
    423408      String gamma = (String) getMeta("GammaValue " + idx); 
     409      
     410      Double blackValue = null, whiteValue = null; 
     411      Float gammaValue = null; 
     412 
     413      try { blackValue = new Double(black); } 
     414      catch (Exception e) { } 
     415      try { whiteValue = new Double(white); } 
     416      catch (Exception e) { } 
     417      try { gammaValue = new Float(gamma); } 
     418      catch (Exception e) { } 
    424419       
    425       store.setDisplayChannel(new Integer(i),  
    426         black == null ? null : new Double(black),  
    427         white == null ? null : new Double(white),  
    428         gamma == null ? null : new Float(gamma), null);  
     420      store.setDisplayChannel(new Integer(i), blackValue, whiteValue,  
     421        gammaValue, null);  
    429422    } 
    430423   
Note: See TracChangeset for help on using the changeset viewer.