Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Volumes/IVolumeSlicer.h @ 1851:739a69562826
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Jun 2021 14:25:58 +0200 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
rev | line source |
---|---|
814 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
814 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
814 | 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 | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
15 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
16 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
18 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
814 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "../Scene2D/ILayerStyleConfigurator.h" | |
26 #include "../Toolbox/CoordinateSystem3D.h" | |
27 | |
28 namespace OrthancStone | |
29 { | |
30 /** | |
31 This interface is implemented by objects representing 3D volume data and | |
32 that are able to return an object that: | |
33 - represent a slice of their data | |
34 - are able to create the corresponding slice visual representation. | |
35 */ | |
36 class IVolumeSlicer : public boost::noncopyable | |
37 { | |
38 public: | |
39 /** | |
40 This interface is implemented by objects representing a slice of | |
41 volume data and that are able to create a 2D layer to display a this | |
42 slice. | |
43 | |
44 The CreateSceneLayer factory method is called with an optional | |
45 configurator that possibly impacts the ISceneLayer subclass that is | |
46 created (for instance, if a LUT must be applied on the texture when | |
47 displaying it) | |
48 */ | |
49 class IExtractedSlice : public boost::noncopyable | |
50 { | |
51 public: | |
52 virtual ~IExtractedSlice() | |
53 { | |
54 } | |
55 | |
56 /** | |
57 Invalid slices are created when the data is not ready yet or if the | |
58 cut is outside of the available geometry. | |
59 */ | |
60 virtual bool IsValid() = 0; | |
61 | |
62 /** | |
63 This retrieves the *revision* that gets incremented every time the | |
64 underlying object undergoes a mutable operation (that it, changes its | |
65 state). | |
66 This **must** be a cheap call. | |
67 */ | |
68 virtual uint64_t GetRevision() = 0; | |
69 | |
70 /** Creates the slice visual representation */ | |
71 virtual ISceneLayer* CreateSceneLayer( | |
72 const ILayerStyleConfigurator* configurator, // possibly absent | |
73 const CoordinateSystem3D& cuttingPlane) = 0; | |
74 }; | |
75 | |
76 /** | |
77 See IExtractedSlice.IsValid() | |
78 */ | |
79 class InvalidSlice : public IExtractedSlice | |
80 { | |
81 public: | |
1571 | 82 virtual bool IsValid() ORTHANC_OVERRIDE |
814 | 83 { |
84 return false; | |
85 } | |
86 | |
1571 | 87 virtual uint64_t GetRevision() ORTHANC_OVERRIDE; |
814 | 88 |
89 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator, | |
1571 | 90 const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; |
814 | 91 }; |
92 | |
93 | |
94 virtual ~IVolumeSlicer() | |
95 { | |
96 } | |
97 | |
98 /** | |
99 This method is implemented by the objects representing volumetric data | |
100 and must returns an IExtractedSlice subclass that contains all the data | |
101 needed to, later on, create its visual representation through | |
102 CreateSceneLayer. | |
103 Subclasses a.o.: | |
104 - InvalidSlice, | |
105 - DicomVolumeImageMPRSlicer::Slice, | |
106 - DicomVolumeImageReslicer::Slice | |
107 - DicomStructureSetLoader::Slice | |
108 */ | |
109 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) = 0; | |
110 }; | |
111 } |