Mercurial > hg > orthanc-stone
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 |
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 | |
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 | 7 * |
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 | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
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 | 21 **/ |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include "DicomVolumeImage.h" | |
27 #include "IVolumeSlicer.h" | |
28 | |
29 #include <boost/shared_ptr.hpp> | |
30 | |
31 namespace OrthancStone | |
32 { | |
33 /** | |
34 Implements the IVolumeSlicer on Dicom volume data when the cutting plane | |
35 that is supplied to the slicer is either axial, sagittal or coronal. | |
36 Arbitrary planes are *not* supported | |
37 */ | |
38 class DicomVolumeImageMPRSlicer : public IVolumeSlicer | |
39 { | |
40 public: | |
41 class Slice : public IExtractedSlice | |
42 { | |
43 private: | |
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 | 46 bool valid_; |
47 VolumeProjection projection_; | |
48 unsigned int sliceIndex_; | |
49 | |
50 void CheckValid() const; | |
51 | |
52 public: | |
53 /** | |
54 Represents a slice of a volume image that is parallel to the | |
55 coordinate system axis. | |
56 The constructor initializes the type of projection (axial, sagittal or | |
57 coronal) and the corresponding slice index, from the cutting plane. | |
58 */ | |
59 Slice(const DicomVolumeImage& volume, | |
60 const CoordinateSystem3D& cuttingPlane); | |
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 | 67 VolumeProjection GetProjection() const; |
68 | |
69 unsigned int GetSliceIndex() const; | |
70 | |
71 virtual bool IsValid() | |
72 { | |
73 return valid_; | |
74 } | |
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 | 80 |
81 virtual ISceneLayer* CreateSceneLayer(const ILayerStyleConfigurator* configurator, | |
82 const CoordinateSystem3D& cuttingPlane); | |
83 }; | |
84 | |
85 private: | |
86 boost::shared_ptr<DicomVolumeImage> volume_; | |
87 | |
88 public: | |
1571 | 89 explicit DicomVolumeImageMPRSlicer(const boost::shared_ptr<DicomVolumeImage>& volume) : |
814 | 90 volume_(volume) |
91 { | |
92 } | |
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 | 101 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; |
102 }; | |
103 } |