comparison Framework/Volumes/IVolumeSlicer.cpp~ @ 814:aead999345e0

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 21:16:39 +0200
parents
children 2d8ab34c8c91
comparison
equal deleted inserted replaced
813:bc7ee59420a1 814:aead999345e0
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 namespace OrthancStone
25 {
26 /**
27 This interface is implemented by objects representing 3D volume data and
28 that are able to return an object that:
29 - represent a slice of their data
30 - are able to create the corresponding slice visual representation.
31 */
32 class IVolumeSlicer : public boost::noncopyable
33 {
34 public:
35 /**
36 This interface is implemented by objects representing a slice of
37 volume data and that are able to create a 2D layer to display a this
38 slice.
39
40 The CreateSceneLayer factory method is called with an optional
41 configurator that possibly impacts the ISceneLayer subclass that is
42 created (for instance, if a LUT must be applied on the texture when
43 displaying it)
44 */
45 class IExtractedSlice : public boost::noncopyable
46 {
47 public:
48 virtual ~IExtractedSlice()
49 {
50 }
51
52 /**
53 Invalid slices are created when the data is not ready yet or if the
54 cut is outside of the available geometry.
55 */
56 virtual bool IsValid() = 0;
57
58 /**
59 This retrieves the *revision* that gets incremented every time the
60 underlying object undergoes a mutable operation (that it, changes its
61 state).
62 This **must** be a cheap call.
63 */
64 virtual uint64_t GetRevision() = 0;
65
66 /** Creates the slice visual representation */
67 virtual ISceneLayer* CreateSceneLayer(
68 const ILayerStyleConfigurator* configurator, // possibly absent
69 const CoordinateSystem3D& cuttingPlane) = 0;
70 };
71
72 /**
73 See IExtractedSlice.IsValid()
74 */
75 class InvalidSlice : public IExtractedSlice
76 {
77 public:
78 virtual bool IsValid()
79 {
80 return false;
81 }
82
83 virtual uint64_t GetRevision()
84 {
85 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
86 }
87
88 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator,
89 const CoordinateSystem3D& cuttingPlane)
90 {
91 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
92 }
93 };
94
95
96 virtual ~IVolumeSlicer()
97 {
98 }
99
100 /**
101 This method is implemented by the objects representing volumetric data
102 and must returns an IExtractedSlice subclass that contains all the data
103 needed to, later on, create its visual representation through
104 CreateSceneLayer.
105 Subclasses a.o.:
106 - InvalidSlice,
107 - DicomVolumeImageMPRSlicer::Slice,
108 - DicomVolumeImageReslicer::Slice
109 - DicomStructureSetLoader::Slice
110 */
111 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) = 0;
112 };
113 }