Changeset 6700
 Timestamp:
 07/14/10 13:47:38 (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/components/bioformats/src/loci/formats/in/MetamorphReader.java
r6661 r6700 102 102 private double zStart; 103 103 private Double sizeX = null, sizeY = null; 104 private double tempZ; 105 private boolean validZ; 104 106 105 107 private int mmPlanes; //number of metamorph planes … … 228 230 firstSeriesChannels = null; 229 231 sizeX = sizeY = null; 232 tempZ = 0d; 233 validZ = false; 230 234 } 231 235 } … … 656 660 } 657 661 if (zDistances != null && p < zDistances.length) { 658 if (zDistances[p] != 0d) distance += zDistances[p]; 659 else distance += zDistances[0]; 662 if (p > 0) { 663 if (zDistances[p] != 0d) distance += zDistances[p]; 664 else distance += zDistances[0]; 665 } 660 666 store.setPlanePositionZ(distance, i, p); 661 667 } … … 1042 1048 in.seek(uic4offset); 1043 1049 if (in.getFilePointer() + 2 >= in.length()) return; 1050 1051 tempZ = 0d; 1052 validZ = false; 1053 1044 1054 short id = in.readShort(); 1045 1055 while (id != 0) { … … 1056 1066 break; 1057 1067 case 40: 1058 readRationals(new String[] {" absoluteZ"});1068 readRationals(new String[] {"UIC4 absoluteZ"}); 1059 1069 break; 1060 1070 case 41: 1061 1071 readAbsoluteZValid(); 1062 1072 break; 1073 case 46: 1074 in.skipBytes(mmPlanes * 8); // TODO 1075 break; 1076 default: 1077 in.skipBytes(4); 1063 1078 } 1064 1079 id = in.readShort(); 1065 1080 } 1066 1081 in.seek(saveLoc); 1082 1083 if (validZ) zStart = tempZ; 1067 1084 } 1068 1085 … … 1086 1103 for (int q=0; q<labels.length; q++) { 1087 1104 double v = readRational(in).doubleValue(); 1088 if (labels[q].e quals("absoluteZ") && i == 0) {1089 zStart= v;1105 if (labels[q].endsWith("absoluteZ") && i == 0) { 1106 tempZ = v; 1090 1107 } 1091 1108 addSeriesMeta(labels[q] + "[" + pos + "]", v); … … 1106 1123 void readAbsoluteZValid() throws IOException { 1107 1124 for (int i=0; i<mmPlanes; i++) { 1108 addSeriesMeta("absoluteZValid[" + intFormatMax(i, mmPlanes) + "]", 1109 in.readInt()); 1125 int valid = in.readInt(); 1126 addSeriesMeta("absoluteZValid[" + intFormatMax(i, mmPlanes) + "]", valid); 1127 if (i == 0) { 1128 validZ = valid == 1; 1129 } 1110 1130 } 1111 1131 } … … 1129 1149 String thedate, thetime; 1130 1150 long lastOffset; 1151 1152 tempZ = 0d; 1153 validZ = false; 1131 1154 for (int i=0; i<uic1count; i++) { 1132 1155 if (in.getFilePointer() >= in.length()) break; … … 1224 1247 if (valOrOffset != 0) { 1225 1248 in.seek(valOrOffset); 1226 readRationals(new String[] {" absoluteZ"});1249 readRationals(new String[] {"UIC1 absoluteZ"}); 1227 1250 } 1228 1251 break; … … 1254 1277 } 1255 1278 in.seek(saveLoc); 1279 1280 if (validZ) zStart = tempZ; 1256 1281 } 1257 1282 … … 1333 1358 private String getKey(int id) { 1334 1359 switch (id) { 1360 case 0: return "AutoScale"; 1335 1361 case 1: return "MinScale"; 1336 1362 case 2: return "MaxScale"; … … 1354 1380 case 20: return "grayPointCount"; 1355 1381 case 21: return "grayX"; 1356 case 22: return "gray ";1382 case 22: return "grayY"; 1357 1383 case 23: return "grayMin"; 1358 1384 case 24: return "grayMax"; … … 1360 1386 case 26: return "StandardLUT"; 1361 1387 case 27: return "Wavelength"; 1388 case 28: return "StagePosition"; 1389 case 29: return "CameraChipOffset"; 1362 1390 case 30: return "OverlayMask"; 1363 1391 case 31: return "OverlayCompress"; … … 1369 1397 case 38: return "AutoScaleLoInfo"; 1370 1398 case 39: return "AutoScaleHiInfo"; 1399 case 40: return "AbsoluteZ"; 1400 case 41: return "AbsoluteZValid"; 1371 1401 case 42: return "Gamma"; 1372 1402 case 43: return "GammaRed"; … … 1374 1404 case 45: return "GammaBlue"; 1375 1405 case 46: return "CameraBin"; 1406 case 47: return "NewLUT"; 1407 case 48: return "ImagePropertyEx"; 1408 case 49: return "PlaneProperty"; 1409 case 50: return "UserLutTable"; 1410 case 51: return "RedAutoScaleInfo"; 1411 case 52: return "RedAutoScaleLoInfo"; 1412 case 53: return "RedAutoScaleHiInfo"; 1413 case 54: return "RedMinScaleInfo"; 1414 case 55: return "RedMaxScaleInfo"; 1415 case 56: return "GreenAutoScaleInfo"; 1416 case 57: return "GreenAutoScaleLoInfo"; 1417 case 58: return "GreenAutoScaleHiInfo"; 1418 case 59: return "GreenMinScaleInfo"; 1419 case 60: return "GreenMaxScaleInfo"; 1420 case 61: return "BlueAutoScaleInfo"; 1421 case 62: return "BlueAutoScaleLoInfo"; 1422 case 63: return "BlueAutoScaleHiInfo"; 1423 case 64: return "BlueMinScaleInfo"; 1424 case 65: return "BlueMaxScaleInfo"; 1425 case 66: return "OverlayPlaneColor"; 1376 1426 } 1377 1427 return null;
Note: See TracChangeset
for help on using the changeset viewer.