Skip to content

Commit

Permalink
Fix bug where we double-cropped in underlying data
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Feb 4, 2025
1 parent 97a130f commit a1362c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ private void updateLabel(int inx, int iny) {
sb.append("/");
sb.append(w);
if(calcCoords != null){
sb.append(" "+NumberUtils.formatNumber(calcCoords.calcX(inx),6)+"/"+NumberUtils.formatNumber(calcCoords.extentX(),6));
sb.append(" ("+NumberUtils.formatNumber(calcCoords.calcX(inx),6)+"/"+NumberUtils.formatNumber(calcCoords.extentX(),6) + ")");
}

}
Expand All @@ -1901,7 +1901,7 @@ private void updateLabel(int inx, int iny) {
sb.append("/");
sb.append(h);
if(calcCoords != null){
sb.append(" "+NumberUtils.formatNumber(calcCoords.calcY(iny),6)+"/"+NumberUtils.formatNumber(calcCoords.extentY(),6));
sb.append(" ("+NumberUtils.formatNumber(calcCoords.calcY(iny),6)+"/"+NumberUtils.formatNumber(calcCoords.extentY(),6) + ")");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@ private void resizeImpl(ResizeInfo resizeInfo,ClientTaskStatusSupport clientTask
for (int c = 0; c < initImageDataSetChannels.length; c++) {
UShortImage[] zImageSet = new UShortImage[newISize.getZ()];
for (int z = 0; z < zImageSet.length; z++) {
zImageSet[z] = new UShortImage(resizeInfo.underlayC[c][z],originalOrigin,resizeExtent,newISize.getX(),newISize.getY(),1);
zImageSet[z] = new UShortImage(resizeInfo.underlayC[c][z], originalOrigin, resizeExtent, newISize.getX(), newISize.getY(), 1);
}
initImageDataSetChannels[c] = new ImageDataset(zImageSet, new double[] { 0.0 },newISize.getZ());
}
Expand Down Expand Up @@ -4145,13 +4145,13 @@ private void cropROIData(final Crop3D cropRectangle3D/*,boolean bThread*/){
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
ISize origISize = getImageDataSetChannel().getISize();
CoordinateIndex cropLow = new CoordinateIndex(-cropRectangle3D.low.x,-cropRectangle3D.low.y,-cropRectangle3D.low.z);
CoordinateIndex cropLow = new CoordinateIndex(-cropRectangle3D.low.x, -cropRectangle3D.low.y, -cropRectangle3D.low.z);
CoordinateIndex cropHigh =
new CoordinateIndex(cropRectangle3D.low.x+cropRectangle3D.width-origISize.getX(),
cropRectangle3D.low.y+cropRectangle3D.height-origISize.getY(),
cropRectangle3D.low.z+cropRectangle3D.depth-origISize.getZ());
new CoordinateIndex(cropRectangle3D.low.x + cropRectangle3D.width - origISize.getX(),
cropRectangle3D.low.y + cropRectangle3D.height - origISize.getY(),
cropRectangle3D.low.z + cropRectangle3D.depth - origISize.getZ());
resizeImpl(ResizeInfo.createPadCropResizeInfo(origISize, cropLow, cropHigh), getClientTaskStatusSupport());
updateAuxiliaryInfo(origISize,getClientTaskStatusSupport());
//updateAuxiliaryInfo(origISize,getClientTaskStatusSupport()); removed because we believe this was accidentally called double; resizeImpl calls this!
}
};
final AsynchClientTask updatePanelTask = getUpdateDisplayAfterCropTask();
Expand Down

0 comments on commit a1362c3

Please sign in to comment.