Skip to content

Commit e757f00

Browse files
committed
Fix implicit cast
1 parent 4b77803 commit e757f00

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/gred/nucleus/process/ChromocenterSegmentation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public ImagePlus imgGradient3D() {
143143
FloatProcessor ipDiff = new FloatProcessor(is.getWidth(), is.getHeight());
144144
for (int i = 0; i < raw[0].getWidth(); ++i) {
145145
for (int j = 0; j < raw[0].getHeight(); ++j) {
146-
float sum = 0;
146+
double sum = 0;
147147
int nb = 0;
148148
double valueA = is.getVoxel(i, j, k);
149149
if (isBin.getVoxel(i, j, k) > 0) {
@@ -169,7 +169,8 @@ public ImagePlus imgGradient3D() {
169169
}
170170
}
171171
}
172-
ipDiff.setf(i, j, sum / nb);
172+
sum = nb != 0 ? sum / nb : Double.NaN;
173+
ipDiff.setf(i, j, (float) sum);
173174
}
174175

175176
}

0 commit comments

Comments
 (0)