annotate OrthancStone/Sources/Toolbox/SortedFrames.h @ 1534:0443d04416d9

don't discard the windowing altered by mouse
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Aug 2020 21:48:43 +0200
parents 244ad1e4e76a
children 85e117739eca
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
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
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
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
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
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
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 #pragma once
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "LinearAlgebra.h"
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 namespace OrthancStone
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 class SortedFrames : public boost::noncopyable
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 private:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 class Instance : public boost::noncopyable
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 private:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 bool hasPosition_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 Orthanc::DicomMap tags_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 std::string sopInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 unsigned int numberOfFrames_;
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
38 Vector normal_; // Only used in "Sort()"
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
39 Vector position_; // Only used in "Sort()"
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
40 bool monochrome1_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 public:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 Instance(const Orthanc::DicomMap& tags);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 const Orthanc::DicomMap& GetTags() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 return tags_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 const std::string& GetSopInstanceUid() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 return sopInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 unsigned int GetNumberOfFrames() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 return numberOfFrames_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 bool HasPosition() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 return hasPosition_;
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
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 const Vector& GetNormal() const;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 const Vector& GetPosition() const;
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
68
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
69 bool IsMonochrome1() const
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
70 {
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
71 return monochrome1_;
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
72 }
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 };
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 struct Frame
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 private:
1485
60be4627ae52 fix for msvc2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1479
diff changeset
78 const Instance* instance_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 unsigned int frameIndex_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 public:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 Frame(const Instance& instance,
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 unsigned int frameIndex);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 const Instance& GetInstance() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
1485
60be4627ae52 fix for msvc2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1479
diff changeset
87 return *instance_;
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 unsigned int GetFrameIndex() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 return frameIndex_;
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 };
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 std::string studyInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 std::string seriesInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 std::vector<Instance*> instances_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 std::vector<Frame> frames_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 bool sorted_;
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 const Instance& GetInstance(size_t index) const;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 const Frame& GetFrame(size_t index) const;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 void AddFramesOfInstance(std::set<size_t>& remainingInstances,
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 size_t index);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 void SortUsingIntegerTag(std::set<size_t>& remainingInstances,
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 const Orthanc::DicomTag& tag);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 void SortUsingSopInstanceUid(std::set<size_t>& remainingInstances);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 void SortUsing3DLocation(std::set<size_t>& remainingInstances);
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 public:
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 SortedFrames() :
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 sorted_(true)
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
1479
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
122 ~SortedFrames()
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
123 {
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
124 Clear();
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
125 }
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
126
5e3cfe87a873 SortedFrames::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1478
diff changeset
127 void Clear();
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 const std::string& GetStudyInstanceUid() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 return studyInstanceUid_;
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
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 const std::string& GetSeriesInstanceUid() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 return seriesInstanceUid_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 }
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 void AddInstance(const Orthanc::DicomMap& tags);
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 size_t GetInstancesCount() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 return instances_.size();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 const Orthanc::DicomMap& GetInstanceTags(size_t index) const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 return GetInstance(index).GetTags();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 const std::string& GetSopInstanceUid(size_t index) const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 return GetInstance(index).GetSopInstanceUid();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 bool IsSorted() const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 return sorted_;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 size_t GetFramesCount() const;
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 const Orthanc::DicomMap& GetFrameTags(size_t index) const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 return GetFrame(index).GetInstance().GetTags();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 const std::string& GetFrameSopInstanceUid(size_t index) const
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 return GetFrame(index).GetInstance().GetSopInstanceUid();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
173 unsigned int GetFrameSiblingsCount(size_t index) const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 return GetFrame(index).GetInstance().GetNumberOfFrames();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
178 unsigned int GetFrameIndex(size_t index) const
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 {
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 return GetFrame(index).GetFrameIndex();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 }
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
183 bool IsFrameMonochrome1(size_t index) const
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
184 {
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
185 return GetFrame(index).GetInstance().IsMonochrome1();
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
186 }
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1485
diff changeset
187
1478
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 void Sort();
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 };
fab6c6e795a3 Framework/Toolbox/SortedFrames.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 }