comparison Framework/Volumes/DicomVolumeImageMPRSlicer.h @ 814:aead999345e0

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 21:16:39 +0200
parents
children 68f888812af4
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 #include "DicomVolumeImage.h"
25 #include "IVolumeSlicer.h"
26
27 #include <boost/shared_ptr.hpp>
28
29 namespace OrthancStone
30 {
31 /**
32 Implements the IVolumeSlicer on Dicom volume data when the cutting plane
33 that is supplied to the slicer is either axial, sagittal or coronal.
34 Arbitrary planes are *not* supported
35 */
36 class DicomVolumeImageMPRSlicer : public IVolumeSlicer
37 {
38 public:
39 class Slice : public IExtractedSlice
40 {
41 private:
42 const DicomVolumeImage& volume_;
43 bool valid_;
44 VolumeProjection projection_;
45 unsigned int sliceIndex_;
46
47 void CheckValid() const;
48
49 protected:
50 // Can be overloaded in subclasses
51 virtual uint64_t GetRevisionInternal(VolumeProjection projection,
52 unsigned int sliceIndex) const
53 {
54 return volume_.GetRevision();
55 }
56
57 public:
58 /**
59 Represents a slice of a volume image that is parallel to the
60 coordinate system axis.
61 The constructor initializes the type of projection (axial, sagittal or
62 coronal) and the corresponding slice index, from the cutting plane.
63 */
64 Slice(const DicomVolumeImage& volume,
65 const CoordinateSystem3D& cuttingPlane);
66
67 VolumeProjection GetProjection() const;
68
69 unsigned int GetSliceIndex() const;
70
71 virtual bool IsValid()
72 {
73 return valid_;
74 }
75
76 virtual uint64_t GetRevision();
77
78 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator,
79 const CoordinateSystem3D& cuttingPlane);
80 };
81
82 private:
83 boost::shared_ptr<DicomVolumeImage> volume_;
84
85 public:
86 DicomVolumeImageMPRSlicer(const boost::shared_ptr<DicomVolumeImage>& volume) :
87 volume_(volume)
88 {
89 }
90
91 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
92 };
93 }