Changeset 6361


Ignore:
Timestamp:
05/24/10 09:03:36 (9 years ago)
Author:
melissa
Message:

Fixed several TIFF, Zeiss LSM and Zeiss ZVI bugs exposed during testing.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6353 r6361  
    642642    } 
    643643 
     644    for (int c=0; c<getEffectiveSizeC(); c++) { 
     645      String lsid = MetadataTools.createLSID("Channel", series, c); 
     646      store.setChannelID(lsid, series, c); 
     647    } 
     648 
    644649    if (getMetadataOptions().getMetadataLevel() == MetadataLevel.ALL) { 
    645650      int spectralScan = ras.readShort(); 
     
    10481053          store.setDichroicID(id, series, nextDichroic); 
    10491054          store.setDichroicModel(beamSplitter.filter, series, nextDichroic); 
    1050           if (nextDichroicChannel < getSizeC()) { 
     1055          if (nextDichroicChannel < getEffectiveSizeC()) { 
    10511056            store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
    10521057          } 
  • branches/4.2/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r6266 r6361  
    572572        s.close(); 
    573573      } 
    574       else if (dirName.equals("RectangleSetup")) { 
     574      else if (dirName.equals("Mosaic")) { 
    575575        RandomAccessInputStream s = poi.getDocumentStream(name); 
    576576        s.order(true); 
    577         s.seek(88); 
    578         short magic = s.readShort(); 
    579         isMeanderScan = magic < 5; 
     577        s.seek(60); 
     578        isMeanderScan = s.readShort() != 0; 
    580579        s.close(); 
    581580      } 
     
    10291028    } 
    10301029 
     1030    int shapeIndex = 0; 
    10311031    for (int shape=0; shape<roiOffsets.size(); shape++) { 
    10321032      s.seek(roiOffsets.get(shape).longValue() + 18); 
     
    10811081 
    10821082      if (roiType == ELLIPSE) { 
    1083         store.setEllipseX(new Double(x + (w / 2)), imageNum, shape); 
    1084         store.setEllipseY(new Double(y + (h / 2)), imageNum, shape); 
    1085         store.setEllipseRadiusX(new Double(w / 2), imageNum, shape); 
    1086         store.setEllipseRadiusY(new Double(h / 2), imageNum, shape); 
     1083        store.setEllipseX(new Double(x + (w / 2)), imageNum, shapeIndex); 
     1084        store.setEllipseY(new Double(y + (h / 2)), imageNum, shapeIndex); 
     1085        store.setEllipseRadiusX(new Double(w / 2), imageNum, shapeIndex); 
     1086        store.setEllipseRadiusY(new Double(h / 2), imageNum, shapeIndex); 
     1087        shapeIndex++; 
    10871088      } 
    10881089      else if (roiType == CURVE || roiType == OUTLINE || 
     
    10991100        } 
    11001101 
    1101         store.setPolylinePoints(points.toString(), imageNum, shape); 
    1102         store.setPolylineClosed(roiType != CURVE, imageNum, shape); 
     1102        store.setPolylinePoints(points.toString(), imageNum, shapeIndex); 
     1103        store.setPolylineClosed(roiType != CURVE, imageNum, shapeIndex); 
     1104        shapeIndex++; 
    11031105      } 
    11041106      else if (roiType == RECTANGLE || roiType == TEXT) { 
    1105         store.setRectangleX(new Double(x), imageNum, shape); 
    1106         store.setRectangleY(new Double(y), imageNum, shape); 
    1107         store.setRectangleWidth(new Double(w), imageNum, shape); 
    1108         store.setRectangleHeight(new Double(h), imageNum, shape); 
     1107        store.setRectangleX(new Double(x), imageNum, shapeIndex); 
     1108        store.setRectangleY(new Double(y), imageNum, shapeIndex); 
     1109        store.setRectangleWidth(new Double(w), imageNum, shapeIndex); 
     1110        store.setRectangleHeight(new Double(h), imageNum, shapeIndex); 
     1111        shapeIndex++; 
    11091112      } 
    11101113      else if (roiType == LINE || roiType == SCALE_BAR) { 
     
    11131116        double x2 = s.readDouble(); 
    11141117        double y2 = s.readDouble(); 
    1115         store.setLineX1(x1, imageNum, shape); 
    1116         store.setLineY1(y1, imageNum, shape); 
    1117         store.setLineX2(x2, imageNum, shape); 
    1118         store.setLineY2(y2, imageNum, shape); 
     1118        store.setLineX1(x1, imageNum, shapeIndex); 
     1119        store.setLineY1(y1, imageNum, shapeIndex); 
     1120        store.setLineX2(x2, imageNum, shapeIndex); 
     1121        store.setLineY2(y2, imageNum, shapeIndex); 
     1122        shapeIndex++; 
    11191123      } 
    11201124    } 
  • branches/4.2/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6355 r6361  
    901901    } 
    902902    long offset = (previous & ~0xffffffffL) | (in.readInt() & 0xffffffffL); 
    903     if (offset < previous && offset != 0) { 
     903 
     904    // Only adjust the offset if we know that the file is too large for 32-bit 
     905    // offsets to be accurate; otherwise, we're making the incorrect assumption 
     906    // that IFDs are stored sequentially. 
     907    if (offset < previous && offset != 0 && in.length() > Integer.MAX_VALUE) { 
    904908      offset += 0x100000000L; 
    905909    } 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6353 r6361  
    642642    } 
    643643 
     644    for (int c=0; c<getEffectiveSizeC(); c++) { 
     645      String lsid = MetadataTools.createLSID("Channel", series, c); 
     646      store.setChannelID(lsid, series, c); 
     647    } 
     648 
    644649    if (getMetadataOptions().getMetadataLevel() == MetadataLevel.ALL) { 
    645650      int spectralScan = ras.readShort(); 
     
    10481053          store.setDichroicID(id, series, nextDichroic); 
    10491054          store.setDichroicModel(beamSplitter.filter, series, nextDichroic); 
    1050           if (nextDichroicChannel < getSizeC()) { 
     1055          if (nextDichroicChannel < getEffectiveSizeC()) { 
    10511056            store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
    10521057          } 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r6266 r6361  
    572572        s.close(); 
    573573      } 
    574       else if (dirName.equals("RectangleSetup")) { 
     574      else if (dirName.equals("Mosaic")) { 
    575575        RandomAccessInputStream s = poi.getDocumentStream(name); 
    576576        s.order(true); 
    577         s.seek(88); 
    578         short magic = s.readShort(); 
    579         isMeanderScan = magic < 5; 
     577        s.seek(60); 
     578        isMeanderScan = s.readShort() != 0; 
    580579        s.close(); 
    581580      } 
     
    10291028    } 
    10301029 
     1030    int shapeIndex = 0; 
    10311031    for (int shape=0; shape<roiOffsets.size(); shape++) { 
    10321032      s.seek(roiOffsets.get(shape).longValue() + 18); 
     
    10811081 
    10821082      if (roiType == ELLIPSE) { 
    1083         store.setEllipseX(new Double(x + (w / 2)), imageNum, shape); 
    1084         store.setEllipseY(new Double(y + (h / 2)), imageNum, shape); 
    1085         store.setEllipseRadiusX(new Double(w / 2), imageNum, shape); 
    1086         store.setEllipseRadiusY(new Double(h / 2), imageNum, shape); 
     1083        store.setEllipseX(new Double(x + (w / 2)), imageNum, shapeIndex); 
     1084        store.setEllipseY(new Double(y + (h / 2)), imageNum, shapeIndex); 
     1085        store.setEllipseRadiusX(new Double(w / 2), imageNum, shapeIndex); 
     1086        store.setEllipseRadiusY(new Double(h / 2), imageNum, shapeIndex); 
    10871087      } 
    10881088      else if (roiType == CURVE || roiType == OUTLINE || 
     
    10991099        } 
    11001100 
    1101         store.setPolylinePoints(points.toString(), imageNum, shape); 
    1102         store.setPolylineClosed(roiType != CURVE, imageNum, shape); 
     1101        store.setPolylinePoints(points.toString(), imageNum, shapeIndex); 
     1102        store.setPolylineClosed(roiType != CURVE, imageNum, shapeIndex); 
    11031103      } 
    11041104      else if (roiType == RECTANGLE || roiType == TEXT) { 
    1105         store.setRectangleX(new Double(x), imageNum, shape); 
    1106         store.setRectangleY(new Double(y), imageNum, shape); 
    1107         store.setRectangleWidth(new Double(w), imageNum, shape); 
    1108         store.setRectangleHeight(new Double(h), imageNum, shape); 
     1105        store.setRectangleX(new Double(x), imageNum, shapeIndex); 
     1106        store.setRectangleY(new Double(y), imageNum, shapeIndex); 
     1107        store.setRectangleWidth(new Double(w), imageNum, shapeIndex); 
     1108        store.setRectangleHeight(new Double(h), imageNum, shapeIndex); 
    11091109      } 
    11101110      else if (roiType == LINE || roiType == SCALE_BAR) { 
     
    11131113        double x2 = s.readDouble(); 
    11141114        double y2 = s.readDouble(); 
    1115         store.setLineX1(x1, imageNum, shape); 
    1116         store.setLineY1(y1, imageNum, shape); 
    1117         store.setLineX2(x2, imageNum, shape); 
    1118         store.setLineY2(y2, imageNum, shape); 
     1115        store.setLineX1(x1, imageNum, shapeIndex); 
     1116        store.setLineY1(y1, imageNum, shapeIndex); 
     1117        store.setLineX2(x2, imageNum, shapeIndex); 
     1118        store.setLineY2(y2, imageNum, shapeIndex); 
    11191119      } 
    11201120    } 
  • trunk/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6355 r6361  
    901901    } 
    902902    long offset = (previous & ~0xffffffffL) | (in.readInt() & 0xffffffffL); 
    903     if (offset < previous && offset != 0) { 
     903 
     904    // Only adjust the offset if we know that the file is too large for 32-bit 
     905    // offsets to be accurate; otherwise, we're making the incorrect assumption 
     906    // that IFDs are stored sequentially. 
     907    if (offset < previous && offset != 0 && in.length() > Integer.MAX_VALUE) { 
    904908      offset += 0x100000000L; 
    905909    } 
Note: See TracChangeset for help on using the changeset viewer.