annotate OrthancServer/Sources/SliceOrdering.h @ 5676:b744a2cf408a find-refactoring tip

shorten ParentRetrieveSpecification/ChildrenRetrieveSpecification as ParentSpecification/ChildrenSpecification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jul 2024 15:04:28 +0200
parents f7adfb22e20e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
26 #include "../../OrthancFramework/Sources/DicomFormat/DicomMap.h"
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace Orthanc
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
3097
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
30 class ServerIndex;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
31
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 class SliceOrdering
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 private:
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 typedef float Vector[3];
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 struct Instance;
2028
d108412411e5 fix msvc warnings
sjodogne
parents: 1900
diff changeset
38 class PositionComparator;
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ServerIndex& index_;
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 std::string seriesId_;
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 bool hasNormal_;
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 Vector normal_;
3899
104e27133ebd '/ordered-slices': reverted the change introduced in 1.5.8 and go-back to 1.5.7 behaviour
Alain Mazy <alain@mazy.be>
parents: 3640
diff changeset
44 std::vector<Instance*> instances_;
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
45 bool isVolume_;
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
46
2804
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
47 static bool ComputeNormal(Vector& normal,
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
48 const DicomMap& dicom);
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
49
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
50 static bool IsParallelOrOpposite(const Vector& a,
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
51 const Vector& b);
d88970f1ffbf fix ordering of non-parallel slices + /tools/reconstruct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
52
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
53 static bool IndexInSeriesComparator(const SliceOrdering::Instance* a,
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
54 const SliceOrdering::Instance* b);
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 void ComputeNormal();
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 void CreateInstances();
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 bool SortUsingPositions();
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
62 bool SortUsingIndexInSeries();
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
63
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 public:
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 SliceOrdering(ServerIndex& index,
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 const std::string& seriesId);
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 ~SliceOrdering();
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
69
3899
104e27133ebd '/ordered-slices': reverted the change introduced in 1.5.8 and go-back to 1.5.7 behaviour
Alain Mazy <alain@mazy.be>
parents: 3640
diff changeset
70 size_t GetInstancesCount() const
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
71 {
3899
104e27133ebd '/ordered-slices': reverted the change introduced in 1.5.8 and go-back to 1.5.7 behaviour
Alain Mazy <alain@mazy.be>
parents: 3640
diff changeset
72 return instances_.size();
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
73 }
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
74
3899
104e27133ebd '/ordered-slices': reverted the change introduced in 1.5.8 and go-back to 1.5.7 behaviour
Alain Mazy <alain@mazy.be>
parents: 3640
diff changeset
75 const std::string& GetInstanceId(size_t index) const;
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
76
3899
104e27133ebd '/ordered-slices': reverted the change introduced in 1.5.8 and go-back to 1.5.7 behaviour
Alain Mazy <alain@mazy.be>
parents: 3640
diff changeset
77 unsigned int GetFramesCount(size_t index) const;
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
78
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1702
diff changeset
79 void Format(Json::Value& result) const;
1702
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 };
9980875edc7c started work on SliceOrdering
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 }