Changeset 5659


Ignore:
Timestamp:
11/02/09 16:12:21 (10 years ago)
Author:
melissa
Message:

Fixed bugs exposed by test suite.

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

Legend:

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

    r5624 r5659  
    341341        if (checkSuffix(listing[i], PRAIRIE_SUFFIXES)) { 
    342342          initFile(new Location(parent, listing[i]).getAbsolutePath()); 
     343          return; 
    343344        } 
    344345      } 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r5625 r5659  
    161161  private Vector<String> imageNames; 
    162162  private String binning; 
     163 
     164  private int totalROIs = 0; 
    163165 
    164166  // -- Constructor -- 
     
    216218      imageNames = null; 
    217219      binning = null; 
     220      totalROIs = 0; 
    218221    } 
    219222  } 
     
    227230    return TiffTools.isValidHeader(check) || 
    228231      (check[2] == 0x53 && check[3] == 0x74); 
     232  } 
     233 
     234  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
     235  public int fileGroupOption(String id) throws FormatException, IOException { 
     236    return FormatTools.MUST_GROUP; 
    229237  } 
    230238 
     
    647655    } 
    648656 
     657    totalROIs = 0; 
     658 
    649659    addSeriesMeta("ToolbarFlags", ras.readInt()); 
    650660 
     
    10041014    in.skipBytes(164); 
    10051015 
    1006     for (int i=0; i<numberOfShapes; i++) { 
     1016    for (int i=totalROIs; i<totalROIs+numberOfShapes; i++) { 
    10071017      long offset = in.getFilePointer(); 
    10081018      int type = in.readInt(); 
     
    10341044      in.skipBytes(34); 
    10351045 
    1036       // populate shape attributes 
    1037  
    1038       store.setShapeFontFamily(fontName, series, 0, i); 
    1039       store.setShapeFontSize(new Integer(fontHeight), series, 0, i); 
    1040       store.setShapeFontStyle(fontItalic ? "normal" : "italic", series, 0, i); 
    1041       store.setShapeFontWeight(String.valueOf(fontWeight), series, 0, i); 
    1042       store.setShapeLocked(new Boolean(moveable), series, 0, i); 
    1043       store.setShapeStrokeColor(String.valueOf(color), series, 0, i); 
    1044       store.setShapeStrokeWidth(new Integer(lineWidth), series, 0, i); 
    1045       store.setShapeTextDecoration(fontUnderlined ? "underline" : 
    1046         fontStrikeout ? "line-through" : "normal", series, 0, i); 
    1047       store.setShapeVisibility(new Boolean(enabled), series, 0, i); 
    1048  
    10491046      switch (type) { 
    10501047        case TEXT: 
     
    10521049          double y = in.readDouble(); 
    10531050          String text = DataTools.stripString(in.readCString()); 
    1054           store.setShapeText(text, series, 0, i); 
     1051          store.setShapeText(text, series, i, 0); 
    10551052          break; 
    10561053        case LINE: 
     
    10611058          double endY = in.readDouble(); 
    10621059 
    1063           store.setLineX1(String.valueOf(startX), series, 0, i); 
    1064           store.setLineY1(String.valueOf(startY), series, 0, i); 
    1065           store.setLineX2(String.valueOf(endX), series, 0, i); 
    1066           store.setLineY2(String.valueOf(endY), series, 0, i); 
     1060          store.setLineX1(String.valueOf(startX), series, i, 0); 
     1061          store.setLineY1(String.valueOf(startY), series, i, 0); 
     1062          store.setLineX2(String.valueOf(endX), series, i, 0); 
     1063          store.setLineY2(String.valueOf(endY), series, i, 0); 
    10671064          break; 
    10681065        case SCALE_BAR: 
     
    10841081          topY = Math.min(topY, bottomY); 
    10851082 
    1086           store.setRectX(String.valueOf(topX), series, 0, i); 
    1087           store.setRectY(String.valueOf(topY), series, 0, i); 
    1088           store.setRectWidth(String.valueOf(width), series, 0, i); 
    1089           store.setRectHeight(String.valueOf(height), series, 0, i); 
     1083          store.setRectX(String.valueOf(topX), series, i, 0); 
     1084          store.setRectY(String.valueOf(topY), series, i, 0); 
     1085          store.setRectWidth(String.valueOf(width), series, i, 0); 
     1086          store.setRectHeight(String.valueOf(height), series, i, 0); 
    10901087 
    10911088          break; 
     
    11351132 
    11361133            store.setEllipseTransform("rotate(" + theta + " " + centerX + 
    1137               " " + centerY + ")", series, 0, i); 
    1138           } 
    1139  
    1140           store.setEllipseCx(String.valueOf(centerX), series, 0, i); 
    1141           store.setEllipseCy(String.valueOf(centerY), series, 0, i); 
    1142           store.setEllipseRx(String.valueOf(rx), series, 0, i); 
    1143           store.setEllipseRy(String.valueOf(ry), series, 0, i); 
     1134              " " + centerY + ")", series, i, 0); 
     1135          } 
     1136 
     1137          store.setEllipseCx(String.valueOf(centerX), series, i, 0); 
     1138          store.setEllipseCy(String.valueOf(centerY), series, i, 0); 
     1139          store.setEllipseRx(String.valueOf(rx), series, i, 0); 
     1140          store.setEllipseRy(String.valueOf(ry), series, i, 0); 
    11441141 
    11451142          break; 
     
    11541151            Math.pow(curveY - centerY, 2)); 
    11551152 
    1156           store.setCircleCx(String.valueOf(centerX), series, 0, i); 
    1157           store.setCircleCy(String.valueOf(centerY), series, 0, i); 
    1158           store.setCircleR(String.valueOf(radius), series, 0, i); 
     1153          store.setCircleCx(String.valueOf(centerX), series, i, 0); 
     1154          store.setCircleCy(String.valueOf(centerY), series, i, 0); 
     1155          store.setCircleR(String.valueOf(radius), series, i, 0); 
    11591156 
    11601157          break; 
     
    11861183            Math.pow(points[0][1] - cy, 2)); 
    11871184 
    1188           store.setCircleCx(String.valueOf(cx), series, 0, i); 
    1189           store.setCircleCy(String.valueOf(cy), series, 0, i); 
    1190           store.setCircleR(String.valueOf(r), series, 0, i); 
     1185          store.setCircleCx(String.valueOf(cx), series, i, 0); 
     1186          store.setCircleCy(String.valueOf(cy), series, i, 0); 
     1187          store.setCircleR(String.valueOf(r), series, i, 0); 
    11911188 
    11921189          break; 
     
    12081205          } 
    12091206 
    1210           store.setPolylinePoints(p.toString(), series, 0, i); 
     1207          store.setPolylinePoints(p.toString(), series, i, 0); 
    12111208 
    12121209          break; 
     
    12311228 
    12321229          if (type == CLOSED_POLYLINE) { 
    1233             store.setPolygonPoints(p.toString(), series, 0, i); 
    1234           } 
    1235           else store.setPolylinePoints(p.toString(), series, 0, i); 
     1230            store.setPolygonPoints(p.toString(), series, i, 0); 
     1231          } 
     1232          else store.setPolylinePoints(p.toString(), series, i, 0); 
    12361233 
    12371234          break; 
     
    12461243            } 
    12471244          } 
     1245 
     1246          p = new StringBuffer(); 
     1247          for (int j=0; j<points.length; j++) { 
     1248            p.append(points[j][0]); 
     1249            p.append(","); 
     1250            p.append(points[j][1]); 
     1251            if (j < points.length - 1) p.append(" "); 
     1252          } 
     1253 
     1254          if (type == OPEN_BEZIER) { 
     1255            store.setPolylinePoints(p.toString(), series, i, 0); 
     1256          } 
     1257          else store.setPolygonPoints(p.toString(), series, i, 0); 
     1258 
    12481259          break; 
    1249       } 
     1260        default: 
     1261          i--; 
     1262          numberOfShapes--; 
     1263          continue; 
     1264      } 
     1265 
     1266      // populate shape attributes 
     1267 
     1268      store.setShapeFontFamily(fontName, series, i, 0); 
     1269      store.setShapeFontSize(new Integer(fontHeight), series, i, 0); 
     1270      store.setShapeFontStyle(fontItalic ? "normal" : "italic", series, i, 0); 
     1271      store.setShapeFontWeight(String.valueOf(fontWeight), series, i, 0); 
     1272      store.setShapeLocked(new Boolean(moveable), series, i, 0); 
     1273      store.setShapeStrokeColor(String.valueOf(color), series, i, 0); 
     1274      store.setShapeStrokeWidth(new Integer(lineWidth), series, i, 0); 
     1275      store.setShapeTextDecoration(fontUnderlined ? "underline" : 
     1276        fontStrikeout ? "line-through" : "normal", series, i, 0); 
     1277      store.setShapeVisibility(new Boolean(enabled), series, i, 0); 
    12501278 
    12511279      in.seek(offset + blockLength); 
    12521280    } 
     1281    totalROIs += numberOfShapes; 
    12531282  } 
    12541283 
Note: See TracChangeset for help on using the changeset viewer.