Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyWindowingTracker.cpp @ 1042:08cdcadfab14
allow using nearest neighbour interpolation while windowing
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 09 Oct 2019 15:34:45 +0200 |
parents | 4f2416d519b4 |
children | 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
1039:3a35d8397559 | 1042:08cdcadfab14 |
---|---|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #include "RadiographyWindowingTracker.h" | 22 #include "RadiographyWindowingTracker.h" |
23 #include "RadiographyWidget.h" | |
23 | 24 |
24 #include <Core/OrthancException.h> | 25 #include <Core/OrthancException.h> |
25 | 26 |
26 | 27 |
27 namespace OrthancStone | 28 namespace OrthancStone |
113 } | 114 } |
114 | 115 |
115 | 116 |
116 RadiographyWindowingTracker::RadiographyWindowingTracker(UndoRedoStack& undoRedoStack, | 117 RadiographyWindowingTracker::RadiographyWindowingTracker(UndoRedoStack& undoRedoStack, |
117 RadiographyScene& scene, | 118 RadiographyScene& scene, |
119 RadiographyWidget& widget, | |
120 ImageInterpolation interpolationDuringTracking, | |
118 int x, | 121 int x, |
119 int y, | 122 int y, |
120 Action leftAction, | 123 Action leftAction, |
121 Action rightAction, | 124 Action rightAction, |
122 Action upAction, | 125 Action upAction, |
123 Action downAction) : | 126 Action downAction) : |
124 undoRedoStack_(undoRedoStack), | 127 undoRedoStack_(undoRedoStack), |
125 scene_(scene), | 128 scene_(scene), |
129 widget_(widget), | |
130 initialWidgetInterpolation_(widget.GetInterpolation()), | |
126 clickX_(x), | 131 clickX_(x), |
127 clickY_(y), | 132 clickY_(y), |
128 leftAction_(leftAction), | 133 leftAction_(leftAction), |
129 rightAction_(rightAction), | 134 rightAction_(rightAction), |
130 upAction_(upAction), | 135 upAction_(upAction), |
131 downAction_(downAction) | 136 downAction_(downAction) |
132 { | 137 { |
133 scene_.GetWindowingWithDefault(sourceCenter_, sourceWidth_); | 138 scene_.GetWindowingWithDefault(sourceCenter_, sourceWidth_); |
139 widget_.SetInterpolation(interpolationDuringTracking); | |
134 | 140 |
135 float minValue, maxValue; | 141 float minValue, maxValue; |
136 scene.GetRange(minValue, maxValue); | 142 scene.GetRange(minValue, maxValue); |
137 | 143 |
138 assert(minValue <= maxValue); | 144 assert(minValue <= maxValue); |
154 } | 160 } |
155 | 161 |
156 | 162 |
157 void RadiographyWindowingTracker::MouseUp() | 163 void RadiographyWindowingTracker::MouseUp() |
158 { | 164 { |
165 widget_.SetInterpolation(initialWidgetInterpolation_); | |
159 undoRedoStack_.Add(new UndoRedoCommand(*this)); | 166 undoRedoStack_.Add(new UndoRedoCommand(*this)); |
160 } | 167 } |
161 | 168 |
162 | 169 |
163 void RadiographyWindowingTracker::MouseMove(int displayX, | 170 void RadiographyWindowingTracker::MouseMove(int displayX, |