comparison Framework/Volumes/VolumeReslicer.h @ 154:7a52c968ea1b wasm

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Feb 2018 09:39:13 +0100
parents Framework/Toolbox/VolumeReslicer.h@ae531ab5dcd9
children fac46066b933
comparison
equal deleted inserted replaced
153:ae531ab5dcd9 154:7a52c968ea1b
1 #pragma once
2
3 #include "../Toolbox/Extent2D.h"
4 #include "../Toolbox/OrientedBoundingBox.h"
5 #include "ImageBuffer3D.h"
6
7 namespace OrthancStone
8 {
9 // Hypothesis: The output voxels always have square size
10 class VolumeReslicer : public boost::noncopyable
11 {
12 private:
13 // Input parameters
14 Orthanc::PixelFormat outputFormat_;
15 bool hasLinearFunction_;
16 float scaling_; // "a" in "f(x) = a * x + b"
17 float offset_; // "b" in "f(x) = a * x + b"
18 ImageInterpolation interpolation_;
19 bool fastMode_;
20
21 // Output of reslicing
22 bool success_;
23 Extent2D extent_;
24 std::auto_ptr<Orthanc::Image> slice_;
25
26 void CheckIterators(const ImageBuffer3D& source,
27 const CoordinateSystem3D& plane,
28 const OrientedBoundingBox& box) const;
29
30 void Reset();
31
32 float GetMinOutputValue() const;
33
34 float GetMaxOutputValue() const;
35
36 void SetWindow(float low,
37 float high);
38
39 public:
40 VolumeReslicer();
41
42 void GetLinearFunction(float& scaling,
43 float& offset) const;
44
45 void ResetLinearFunction();
46
47 void SetLinearFunction(float scaling,
48 float offset);
49
50 void FitRange(const ImageBuffer3D& image);
51
52 void SetWindowing(ImageWindowing windowing,
53 const ImageBuffer3D& image,
54 float rescaleSlope,
55 float rescaleIntercept);
56
57 Orthanc::PixelFormat GetOutputFormat() const
58 {
59 return outputFormat_;
60 }
61
62 void SetOutputFormat(Orthanc::PixelFormat format);
63
64 ImageInterpolation GetInterpolation() const
65 {
66 return interpolation_;
67 }
68
69 void SetInterpolation(ImageInterpolation interpolation);
70
71 bool IsFastMode() const
72 {
73 return fastMode_;
74 }
75
76 void EnableFastMode(bool enabled)
77 {
78 fastMode_ = enabled;
79 }
80
81 bool IsSuccess() const
82 {
83 return success_;
84 }
85
86 const Extent2D& GetOutputExtent() const;
87
88 const Orthanc::ImageAccessor& GetOutputSlice() const;
89
90 Orthanc::ImageAccessor* ReleaseOutputSlice();
91
92 void Apply(const ImageBuffer3D& source,
93 const CoordinateSystem3D& plane);
94
95 void Apply(const ImageBuffer3D& source,
96 const CoordinateSystem3D& plane,
97 double voxelSize);
98 };
99 }