814
|
1 /**
|
|
2 * Stone of Orthanc
|
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
|
|
4 * Department, University Hospital of Liege, Belgium
|
|
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
|
|
6 *
|
|
7 * This program is free software: you can redistribute it and/or
|
|
8 * modify it under the terms of the GNU Affero General Public License
|
|
9 * as published by the Free Software Foundation, either version 3 of
|
|
10 * the License, or (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful, but
|
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
15 * Affero General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU Affero General Public License
|
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19 **/
|
|
20
|
|
21
|
|
22 #pragma once
|
|
23
|
|
24 #include "../Scene2D/ILayerStyleConfigurator.h"
|
|
25 #include "../Toolbox/CoordinateSystem3D.h"
|
|
26
|
|
27 namespace OrthancStone
|
|
28 {
|
|
29 /**
|
|
30 This interface is implemented by objects representing 3D volume data and
|
|
31 that are able to return an object that:
|
|
32 - represent a slice of their data
|
|
33 - are able to create the corresponding slice visual representation.
|
|
34 */
|
|
35 class IVolumeSlicer : public boost::noncopyable
|
|
36 {
|
|
37 public:
|
|
38 /**
|
|
39 This interface is implemented by objects representing a slice of
|
|
40 volume data and that are able to create a 2D layer to display a this
|
|
41 slice.
|
|
42
|
|
43 The CreateSceneLayer factory method is called with an optional
|
|
44 configurator that possibly impacts the ISceneLayer subclass that is
|
|
45 created (for instance, if a LUT must be applied on the texture when
|
|
46 displaying it)
|
|
47 */
|
|
48 class IExtractedSlice : public boost::noncopyable
|
|
49 {
|
|
50 public:
|
|
51 virtual ~IExtractedSlice()
|
|
52 {
|
|
53 }
|
|
54
|
|
55 /**
|
|
56 Invalid slices are created when the data is not ready yet or if the
|
|
57 cut is outside of the available geometry.
|
|
58 */
|
|
59 virtual bool IsValid() = 0;
|
|
60
|
|
61 /**
|
|
62 This retrieves the *revision* that gets incremented every time the
|
|
63 underlying object undergoes a mutable operation (that it, changes its
|
|
64 state).
|
|
65 This **must** be a cheap call.
|
|
66 */
|
|
67 virtual uint64_t GetRevision() = 0;
|
|
68
|
|
69 /** Creates the slice visual representation */
|
|
70 virtual ISceneLayer* CreateSceneLayer(
|
|
71 const ILayerStyleConfigurator* configurator, // possibly absent
|
|
72 const CoordinateSystem3D& cuttingPlane) = 0;
|
|
73 };
|
|
74
|
|
75 /**
|
|
76 See IExtractedSlice.IsValid()
|
|
77 */
|
|
78 class InvalidSlice : public IExtractedSlice
|
|
79 {
|
|
80 public:
|
|
81 virtual bool IsValid()
|
|
82 {
|
|
83 return false;
|
|
84 }
|
|
85
|
|
86 virtual uint64_t GetRevision();
|
|
87
|
|
88 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator,
|
|
89 const CoordinateSystem3D& cuttingPlane);
|
|
90 };
|
|
91
|
|
92
|
|
93 virtual ~IVolumeSlicer()
|
|
94 {
|
|
95 }
|
|
96
|
|
97 /**
|
|
98 This method is implemented by the objects representing volumetric data
|
|
99 and must returns an IExtractedSlice subclass that contains all the data
|
|
100 needed to, later on, create its visual representation through
|
|
101 CreateSceneLayer.
|
|
102 Subclasses a.o.:
|
|
103 - InvalidSlice,
|
|
104 - DicomVolumeImageMPRSlicer::Slice,
|
|
105 - DicomVolumeImageReslicer::Slice
|
|
106 - DicomStructureSetLoader::Slice
|
|
107 */
|
|
108 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) = 0;
|
|
109 };
|
|
110 }
|