ROI centering and ROI measurements
This commit is contained in:
@@ -96,6 +96,9 @@ public class Imaging extends Panel {
|
||||
ov.setMovable(true);
|
||||
renderer.addOverlay(ov);
|
||||
}
|
||||
if (checkMeasurements.isSelected()){
|
||||
checkMeasurementsActionPerformed(null);
|
||||
}
|
||||
} finally {
|
||||
updateButtons();
|
||||
}
|
||||
@@ -663,7 +666,16 @@ public class Imaging extends Panel {
|
||||
|
||||
private void buttonRoiSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRoiSetActionPerformed
|
||||
try {
|
||||
Rectangle roi = new Rectangle(0,0,Integer.valueOf(spinnerSize.getValue().toString()),Integer.valueOf(spinnerSize.getValue().toString()));
|
||||
int x=0;
|
||||
int y=0;
|
||||
int width = Integer.valueOf(spinnerSize.getValue().toString());
|
||||
int height = Integer.valueOf(spinnerSize.getValue().toString());
|
||||
try{
|
||||
x = Math.max((renderer.getImage().getWidth() - width) / 2, 0);
|
||||
y = Math.max((renderer.getImage().getHeight() - height) / 2, 0);
|
||||
} catch(Exception ex){
|
||||
}
|
||||
Rectangle roi = new Rectangle(x,y, width, height);
|
||||
setRoi(roi);
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
|
||||
Reference in New Issue
Block a user