annotate Framework/Volumes/DicomVolumeImageMPRSlicer.h @ 1213:86a8266b8888 broker

moving the scene from IViewport to ViewportController
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Dec 2019 17:54:10 +0100
parents 391fb6d6905d
children 2d8ab34c8c91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "DicomVolumeImage.h"
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "IVolumeSlicer.h"
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include <boost/shared_ptr.hpp>
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace OrthancStone
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 Implements the IVolumeSlicer on Dicom volume data when the cutting plane
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 that is supplied to the slicer is either axial, sagittal or coronal.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 Arbitrary planes are *not* supported
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 */
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 class DicomVolumeImageMPRSlicer : public IVolumeSlicer
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 public:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 class Slice : public IExtractedSlice
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 private:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 const DicomVolumeImage& volume_;
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
43 uint64_t revision_;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 bool valid_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 VolumeProjection projection_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 unsigned int sliceIndex_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 void CheckValid() const;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 public:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 Represents a slice of a volume image that is parallel to the
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 coordinate system axis.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 The constructor initializes the type of projection (axial, sagittal or
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 coronal) and the corresponding slice index, from the cutting plane.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 */
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 Slice(const DicomVolumeImage& volume,
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 const CoordinateSystem3D& cuttingPlane);
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
60 void SetRevision(uint64_t revision)
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
61 {
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
62 revision_ = revision;
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
63 }
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
64
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 VolumeProjection GetProjection() const;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 unsigned int GetSliceIndex() const;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 virtual bool IsValid()
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 return valid_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
74 virtual uint64_t GetRevision()
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
75 {
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
76 return revision_;
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
77 }
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator,
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 const CoordinateSystem3D& cuttingPlane);
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 };
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 private:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 boost::shared_ptr<DicomVolumeImage> volume_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 public:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 DicomVolumeImageMPRSlicer(const boost::shared_ptr<DicomVolumeImage>& volume) :
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 volume_(volume)
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
1072
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
92 boost::shared_ptr<const DicomVolumeImage> GetVolume() const
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
93 {
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
94 return volume_;
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
95 }
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
96
935
401808e7ff2e Added traces in LoaderCache objects dtors + fuse to prevent dead weak ptrs to be calleds in VisitWdigets (in GuiAdapter.h)
Benjamin Golinvaux <bgo@osimis.io>
parents: 817
diff changeset
97 virtual ~DicomVolumeImageMPRSlicer();
401808e7ff2e Added traces in LoaderCache objects dtors + fuse to prevent dead weak ptrs to be calleds in VisitWdigets (in GuiAdapter.h)
Benjamin Golinvaux <bgo@osimis.io>
parents: 817
diff changeset
98
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 };
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 }