Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/DicomStructure2.cpp @ 1019:29f5f2031310
Added a way to specificy which structures are to be initially displayed (the
default being ALL structures displayed) + the loader maintains a list of
structure display state, that can be modified continuously + the cache now takes
the initial list of structure into account for computing the entry + added methods
to change the loaded structure visibility + disabled the alternate loaders
(DicomStructureSetLoader2 and friends) + disabled corresponding tests
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 27 Sep 2019 13:32:05 +0200 |
parents | 38b6bb0bdd72 |
children | 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
1018:58eed6bbcabb | 1019:29f5f2031310 |
---|---|
16 * | 16 * |
17 * You should have received a copy of the GNU Affero General Public License | 17 * You should have received a copy of the GNU Affero General Public License |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 #ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 | |
22 | |
21 #include "DicomStructure2.h" | 23 #include "DicomStructure2.h" |
22 | 24 |
23 #include "../Toolbox/GeometryToolbox.h" | 25 #include "../Toolbox/GeometryToolbox.h" |
24 #include "../Toolbox/DisjointDataSet.h" | 26 #include "../Toolbox/DisjointDataSet.h" |
25 | 27 |
79 LOG(ERROR) << "DicomStructure2::ComputeSliceThickness - state must be NormalComputed"; | 81 LOG(ERROR) << "DicomStructure2::ComputeSliceThickness - state must be NormalComputed"; |
80 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | 82 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); |
81 } | 83 } |
82 if (polygons_.size() < 2) | 84 if (polygons_.size() < 2) |
83 { | 85 { |
84 // cannot compute thickness if there are not at least 2 slabs (contours) | 86 // cannot compute thickness if there are not at least 2 slabs (structures) |
85 sliceThickness_ = 1.0; | 87 sliceThickness_ = 1.0; |
86 state_ = Invalid; | 88 state_ = Invalid; |
87 } | 89 } |
88 else | 90 else |
89 { | 91 { |
275 { | 277 { |
276 // plane is not perpendicular to the polygons | 278 // plane is not perpendicular to the polygons |
277 // 180.0 / [Math]::Pi = 57.2957795130823 | 279 // 180.0 / [Math]::Pi = 57.2957795130823 |
278 double acDot = 57.2957795130823 * acos(dot); | 280 double acDot = 57.2957795130823 * acos(dot); |
279 LOG(ERROR) << "DicomStructure2::Project -- cutting plane must be " | 281 LOG(ERROR) << "DicomStructure2::Project -- cutting plane must be " |
280 << "perpendicular to the contours, but dot product is: " | 282 << "perpendicular to the structures, but dot product is: " |
281 << dot << " and (180/pi)*acos(dot) = " << acDot; | 283 << dot << " and (180/pi)*acos(dot) = " << acDot; |
282 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | 284 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); |
283 } | 285 } |
284 } | 286 } |
285 return segments.size() != 0; | 287 return segments.size() != 0; |
286 } | 288 } |
287 } | 289 } |
290 | |
291 #endif | |
292 // BGO_ENABLE_DICOMSTRUCTURESETLOADER2 | |
293 |