()
| 1080 | } |
| 1081 | |
| 1082 | double getPixel() { |
| 1083 | interp.getLeftParen(); |
| 1084 | double a1 = interp.getExpression(); |
| 1085 | ImageProcessor ip = getProcessor(); |
| 1086 | double value = 0.0; |
| 1087 | interp.getToken(); |
| 1088 | if (interp.token==',') { |
| 1089 | double a2 = interp.getExpression(); |
| 1090 | interp.getRightParen(); |
| 1091 | int ia1 = (int)a1; |
| 1092 | int ia2 = (int)a2; |
| 1093 | if (a1==ia1 && a2==ia2) { |
| 1094 | if (ip instanceof FloatProcessor) |
| 1095 | value = ip.getPixelValue(ia1, ia2); |
| 1096 | else |
| 1097 | value = ip.getPixel(ia1, ia2); |
| 1098 | } else { |
| 1099 | if (ip instanceof ColorProcessor) |
| 1100 | value = ip.getPixelInterpolated(a1, a2); |
| 1101 | else { |
| 1102 | ImagePlus imp = getImage(); |
| 1103 | Calibration cal = imp.getCalibration(); |
| 1104 | imp.setCalibration(null); |
| 1105 | ip = imp.getProcessor(); |
| 1106 | value = ip.getInterpolatedValue(a1, a2); |
| 1107 | imp.setCalibration(cal); |
| 1108 | } |
| 1109 | } |
| 1110 | } else { |
| 1111 | if (interp.token!=')') interp.error("')' expected"); |
| 1112 | if (ip instanceof ColorProcessor) |
| 1113 | value = ip.get((int)a1); |
| 1114 | else |
| 1115 | value = ip.getf((int)a1); |
| 1116 | } |
| 1117 | return value; |
| 1118 | } |
| 1119 | |
| 1120 | void setZCoordinate() { |
| 1121 | int z = (int)getArg(); |
no test coverage detected