annotate OrthancStone/Sources/Toolbox/SortedFrames.h @ 1817:385c268e8b56

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 May 2021 19:51:45 +0200
parents 9ac2a65d4172
children 3889ae96d2e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1739
9ac2a65d4172 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1648
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * 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
8 * modify it under the terms of the GNU Lesser General Public License
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
16 *
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
17 * 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
18 * 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
19 * <http://www.gnu.org/licenses/>.
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1630
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
25 #include "CoordinateSystem3D.h"
1643
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
26 #include "DicomInstanceParameters.h"
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "LinearAlgebra.h"
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace OrthancStone
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 class SortedFrames : public boost::noncopyable
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
1645
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
33 #if defined(FRIEND_TEST)
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
34 // We're compiling the unit tests
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
35 FRIEND_TEST(SortedFrames, Basic);
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
36 FRIEND_TEST(SortedFrames, SortSopInstanceUid);
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
37 FRIEND_TEST(SortedFrames, SortInstanceNumber);
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
38 FRIEND_TEST(SortedFrames, SortInstanceNumberAndImageIndex);
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
39 #endif
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
40
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 private:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 struct Frame
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 private:
1643
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
45 const DicomInstanceParameters* instance_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
46 unsigned int frameNumber_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 public:
1643
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
49 Frame(const DicomInstanceParameters& instance,
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
50 unsigned int frameNumber);
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
1643
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
52 const DicomInstanceParameters& GetInstance() const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
1485
60be4627ae52 fix for msvc2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1479
diff changeset
54 return *instance_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
57 unsigned int GetFrameNumberInInstance() const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 {
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
59 return frameNumber_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 }
1648
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
61
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
62 double ComputeDistance(const Vector& p) const;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 };
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
1599
73cd85d7da6a SortedFrames::LookupSopInstanceUid()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
65
73cd85d7da6a SortedFrames::LookupSopInstanceUid()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
66 // Maps "SOPInstanceUID" to an index in "instances_"
73cd85d7da6a SortedFrames::LookupSopInstanceUid()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
67 typedef std::map<std::string, size_t> InstancesIndex;
73cd85d7da6a SortedFrames::LookupSopInstanceUid()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
68
1602
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
69 // Maps pair "(SOPInstanceUID, FrameNumber)" to an index in
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
70 // "frames_" (only once "Sort()" is called)
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
71 typedef std::map<std::pair<std::string, unsigned int>, size_t> FramesIndex;
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
72
1643
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
73 std::string studyInstanceUid_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
74 std::string seriesInstanceUid_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
75 std::vector<DicomInstanceParameters*> instances_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
76 std::vector<Frame> frames_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
77 bool sorted_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
78 InstancesIndex instancesIndex_;
882e2253a90e replacing SortedFrames::Instance by DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1631
diff changeset
79 FramesIndex framesIndex_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
1645
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
81 const DicomInstanceParameters& GetInstance(size_t instanceIndex) const;
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
82
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
83 bool LookupSopInstanceUid(size_t& instanceIndex,
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
84 const std::string& sopInstanceUid) const;
bc7bd8ee13f8 making private two potentially dangerous methods in SortedFrames
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1644
diff changeset
85
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
86 const Frame& GetFrame(size_t frameIndex) const;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 void AddFramesOfInstance(std::set<size_t>& remainingInstances,
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
89 size_t instanceIndex);
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 void SortUsingIntegerTag(std::set<size_t>& remainingInstances,
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 const Orthanc::DicomTag& tag);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 void SortUsingSopInstanceUid(std::set<size_t>& remainingInstances);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 void SortUsing3DLocation(std::set<size_t>& remainingInstances);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 public:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 SortedFrames() :
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 sorted_(true)
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
1479
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
104 ~SortedFrames()
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
105 {
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
106 Clear();
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
107 }
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
108
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
109 void Clear();
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 const std::string& GetStudyInstanceUid() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 return studyInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 const std::string& GetSeriesInstanceUid() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 return seriesInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 void AddInstance(const Orthanc::DicomMap& tags);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 size_t GetInstancesCount() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 return instances_.size();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 bool IsSorted() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 return sorted_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 size_t GetFramesCount() const;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
1644
4796fb60999e removing methods from SortedFrames to simplify api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
135 const DicomInstanceParameters& GetInstanceOfFrame(size_t frameIndex) const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
1644
4796fb60999e removing methods from SortedFrames to simplify api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
137 return GetFrame(frameIndex).GetInstance();
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
140 unsigned int GetFrameNumberInInstance(size_t frameIndex) const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 {
1600
b253b79906fa clarifying variable names: frameIndex vs numberIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
142 return GetFrame(frameIndex).GetFrameNumberInInstance();
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
1631
960bb5fcc440 SortedFrames::GetFrameGeometry()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
145 CoordinateSystem3D GetFrameGeometry(size_t frameIndex) const;
960bb5fcc440 SortedFrames::GetFrameGeometry()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
146
1602
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
147 bool LookupFrame(size_t& frameIndex,
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
148 const std::string& sopInstanceUid,
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
149 unsigned int frameNumber) const;
b2941196cabf SortedFrames::LookupFrame()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
150
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 void Sort();
1648
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
152
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
153 bool FindClosestFrame(size_t& frameIndex,
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
154 const Vector& point,
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1645
diff changeset
155 double maximumDistance) const;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 };
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }