annotate OrthancStone/Sources/Volumes/DicomVolumeImageMPRSlicer.h @ 2092:b7d4d288459a dicom-sr

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 08 Nov 2023 10:32:16 +0100
parents 07964689cb0b
children c23eef785569
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
2077
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * 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
9 * modify it under the terms of the GNU Lesser General Public License
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * 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
15 * 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
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
17 *
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
18 * 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
19 * 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
20 * <http://www.gnu.org/licenses/>.
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "DicomVolumeImage.h"
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "IVolumeSlicer.h"
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <boost/shared_ptr.hpp>
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 Implements the IVolumeSlicer on Dicom volume data when the cutting plane
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 that is supplied to the slicer is either axial, sagittal or coronal.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 Arbitrary planes are *not* supported
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 */
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 class DicomVolumeImageMPRSlicer : public IVolumeSlicer
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 public:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 class Slice : public IExtractedSlice
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 private:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 const DicomVolumeImage& volume_;
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
45 uint64_t revision_;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 bool valid_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 VolumeProjection projection_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 unsigned int sliceIndex_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 void CheckValid() const;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 public:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 Represents a slice of a volume image that is parallel to the
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 coordinate system axis.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 The constructor initializes the type of projection (axial, sagittal or
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 coronal) and the corresponding slice index, from the cutting plane.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 */
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 Slice(const DicomVolumeImage& volume,
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 const CoordinateSystem3D& cuttingPlane);
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
62 void SetRevision(uint64_t 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 revision_ = revision;
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
65 }
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
66
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 VolumeProjection GetProjection() 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 unsigned int GetSliceIndex() const;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 virtual bool IsValid()
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 return valid_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
817
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
76 virtual uint64_t GetRevision()
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
77 {
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
78 return revision_;
68f888812af4 simplification of DicomVolumeImageMPRSlicer::ExtractedSlice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
79 }
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator,
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 const CoordinateSystem3D& cuttingPlane);
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 };
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 private:
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 boost::shared_ptr<DicomVolumeImage> volume_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 public:
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
89 explicit DicomVolumeImageMPRSlicer(const boost::shared_ptr<DicomVolumeImage>& volume) :
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 volume_(volume)
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
1072
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
94 boost::shared_ptr<const DicomVolumeImage> GetVolume() const
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 return volume_;
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
97 }
391fb6d6905d OrthancMultiframeVolumeLoader asks volume image to compute range +
Benjamin Golinvaux <bgo@osimis.io>
parents: 935
diff changeset
98
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
99 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
100
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 };
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }