Skip to content

Commit 9162dbd

Browse files
committed
Fix rotation of MPR axes
1 parent 1004b3b commit 9162dbd

File tree

24 files changed

+597
-342
lines changed

24 files changed

+597
-342
lines changed

weasis-base/weasis-base-viewer2d/src/main/java/org/weasis/base/viewer2d/EventManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ public JMenu getOrientationMenu(String prop) {
613613

614614
// public JMenu getSortStackMenu(String prop) {
615615
// JMenu menu = null;
616-
// if (BundleTools.SYSTEM_PREFERENCES.getBooleanProperty(prop, true)) {
616+
// if (GuiUtils.getUICore().getSystemPreferences().getBooleanProperty(prop, true)) {
617617
// menu =
618618
// sortStackAction.createUnregisteredRadioMenu(Messages.getString("View2dContainer.sort_stack"));
619619
//

weasis-dicom/weasis-dicom-3d/viewer3d/src/main/java/org/weasis/dicom/viewer3d/View3DContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private void initTools() {
259259
eventManager, eventManager.getMouseActions().getActiveButtons(), preferences, 10));
260260
}
261261
// if (InsertableUtil.getBooleanProperty(
262-
// BundleTools.SYSTEM_PREFERENCES,
262+
// GuiUtils.getUICore().getSystemPreferences(),
263263
// bundleName,
264264
// componentName,
265265
// InsertableUtil.getCName(MeasureToolBar.class),

weasis-dicom/weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/EventManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public void stateChanged(BoundedRangeModel model) {
278278
if (view2d instanceof MprView mprView) {
279279
MprContainer mprContainer = (MprContainer) selectedView2dContainer;
280280
MprController controller = mprContainer.getMprController();
281-
MprAxis axis = controller.getMprAxis(mprView.getSliceOrientation());
281+
MprAxis axis = controller.getMprAxis(mprView.getPlane());
282282
int index = model.getValue() - 1;
283283
axis.setSliceIndex(index);
284284
boolean oldAdjusting = controller.isAdjusting();
@@ -1077,7 +1077,7 @@ public synchronized boolean updateComponentsListener(ViewCanvas<DicomImageElemen
10771077
MprController controller = mprContainer.getMprController();
10781078
Volume<?> volume = controller.getVolume();
10791079
maxSlice = volume.getSliceSize();
1080-
MprAxis axis = controller.getMprAxis(mprView.getSliceOrientation());
1080+
MprAxis axis = controller.getMprAxis(mprView.getPlane());
10811081
currentSlice = axis.getSliceIndex();
10821082
} else {
10831083
maxSlice =

weasis-dicom/weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/View2d.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
import org.weasis.dicom.explorer.pr.PrGraphicUtil;
117117
import org.weasis.dicom.viewer2d.KOComponentFactory.KOViewButton;
118118
import org.weasis.dicom.viewer2d.KOComponentFactory.KOViewButton.eState;
119-
import org.weasis.dicom.viewer2d.mpr.MprView.SliceOrientation;
119+
import org.weasis.dicom.viewer2d.mpr.MprView.Plane;
120120
import org.weasis.opencv.data.PlanarImage;
121121
import org.weasis.opencv.op.lut.WlPresentation;
122122

@@ -877,12 +877,12 @@ public void computeCrosshair(Vector3d p3, PanPoint panPoint) {
877877
}
878878
GeometryOfSlice sliceGeometry = image.getSliceGeometry();
879879
if (sliceGeometry != null) {
880-
SliceOrientation sliceOrientation = this.getSliceOrientation();
881-
if (sliceOrientation != null && p3 != null) {
880+
Plane plane = this.getPlane();
881+
if (plane != null && p3 != null) {
882882
Point2D p = sliceGeometry.getImagePosition(p3);
883883
if (p != null) {
884884
Vector3d dim = sliceGeometry.getDimensions();
885-
boolean axial = SliceOrientation.AXIAL.equals(sliceOrientation);
885+
boolean axial = Plane.AXIAL.equals(plane);
886886
Point2D centerPt = new Point2D.Double(p.getX(), p.getY());
887887
int centerGap =
888888
eventManager.getOptions().getIntProperty(View2d.P_CROSSHAIR_CENTER_GAP, 40);
@@ -897,7 +897,7 @@ public void computeCrosshair(Vector3d p3, PanPoint panPoint) {
897897
pts.add(new Point2D.Double(p.getX(), -50.0));
898898
pts.add(new Point2D.Double(p.getX(), dim.x + 50));
899899

900-
boolean sagittal = SliceOrientation.SAGITTAL.equals(sliceOrientation);
900+
boolean sagittal = Plane.SAGITTAL.equals(plane);
901901
Color color1 = axial ? Biped.A.getColor() : Biped.F.getColor();
902902
addCrosshairLine(layer, pts, color1, centerPt, centerGap);
903903

@@ -966,25 +966,25 @@ protected void addRectangle(GraphicLayer layer, Rectangle2D rect, Color color) {
966966
}
967967
}
968968

969-
public SliceOrientation getSliceOrientation() {
970-
SliceOrientation sliceOrientation = null;
969+
public Plane getPlane() {
970+
Plane plane = null;
971971
MediaSeries<DicomImageElement> s = getSeries();
972972
if (s != null) {
973973
Object img = s.getMedia(MediaSeries.MEDIA_POSITION.MIDDLE, null, null);
974974
if (img instanceof DicomImageElement imageElement) {
975975
Plan orientation = ImageOrientation.getPlan(imageElement);
976976
if (orientation != null) {
977977
if (Plan.AXIAL.equals(orientation)) {
978-
sliceOrientation = SliceOrientation.AXIAL;
978+
plane = Plane.AXIAL;
979979
} else if (Plan.CORONAL.equals(orientation)) {
980-
sliceOrientation = SliceOrientation.CORONAL;
980+
plane = Plane.CORONAL;
981981
} else if (Plan.SAGITTAL.equals(orientation)) {
982-
sliceOrientation = SliceOrientation.SAGITTAL;
982+
plane = Plane.SAGITTAL;
983983
}
984984
}
985985
}
986986
}
987-
return sliceOrientation;
987+
return plane;
988988
}
989989

990990
@Override

weasis-dicom/weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/mpr/AbstractStack.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
import org.weasis.core.api.media.data.MediaSeries.MEDIA_POSITION;
1515
import org.weasis.dicom.codec.DicomImageElement;
1616
import org.weasis.dicom.codec.TagD;
17-
import org.weasis.dicom.viewer2d.mpr.MprView.SliceOrientation;
17+
import org.weasis.dicom.viewer2d.mpr.MprView.Plane;
1818

1919
public class AbstractStack {
2020
protected final int width;
2121
protected final int height;
22-
protected final SliceOrientation stackOrientation;
22+
protected final Plane plane;
2323
protected final MediaSeries<DicomImageElement> series;
2424

25-
public AbstractStack(SliceOrientation sliceOrientation, MediaSeries<DicomImageElement> series) {
26-
this.stackOrientation = sliceOrientation;
25+
public AbstractStack(Plane plane, MediaSeries<DicomImageElement> series) {
26+
this.plane = plane;
2727
this.series = series;
2828

2929
final DicomImageElement img = series.getMedia(MEDIA_POSITION.MIDDLE, null, null);
@@ -44,8 +44,8 @@ public int getHeight() {
4444
return height;
4545
}
4646

47-
public SliceOrientation getStackOrientation() {
48-
return stackOrientation;
47+
public Plane getPlane() {
48+
return plane;
4949
}
5050

5151
public MediaSeries<DicomImageElement> getSeries() {

0 commit comments

Comments
 (0)