Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp @ 1571:85e117739eca
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2020 17:46:39 +0200 |
parents | 244ad1e4e76a |
children | 4fb8fdf03314 |
comparison
equal
deleted
inserted
replaced
1570:9a04f42098a3 | 1571:85e117739eca |
---|---|
42 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 42 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
43 } | 43 } |
44 | 44 |
45 } | 45 } |
46 | 46 |
47 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) | 47 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE |
48 { | 48 { |
49 // Complete the DICOM tags with just-received "Grid Frame Offset Vector" | 49 // Complete the DICOM tags with just-received "Grid Frame Offset Vector" |
50 std::string s = Orthanc::Toolbox::StripSpaces(message.GetAnswer()); | 50 std::string s = Orthanc::Toolbox::StripSpaces(message.GetAnswer()); |
51 dicom_->SetValue(Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR, s, false); | 51 dicom_->SetValue(Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR, s, false); |
52 | 52 |
71 | 71 |
72 | 72 |
73 class OrthancMultiframeVolumeLoader::LoadGeometry : public State | 73 class OrthancMultiframeVolumeLoader::LoadGeometry : public State |
74 { | 74 { |
75 public: | 75 public: |
76 LoadGeometry(OrthancMultiframeVolumeLoader& that) : | 76 explicit LoadGeometry(OrthancMultiframeVolumeLoader& that) : |
77 State(that) | 77 State(that) |
78 { | 78 { |
79 } | 79 } |
80 | 80 |
81 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) | 81 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) |
82 { | 82 { |
113 }; | 113 }; |
114 | 114 |
115 class OrthancMultiframeVolumeLoader::LoadTransferSyntax : public State | 115 class OrthancMultiframeVolumeLoader::LoadTransferSyntax : public State |
116 { | 116 { |
117 public: | 117 public: |
118 LoadTransferSyntax(OrthancMultiframeVolumeLoader& that) : | 118 explicit LoadTransferSyntax(OrthancMultiframeVolumeLoader& that) : |
119 State(that) | 119 State(that) |
120 { | 120 { |
121 } | 121 } |
122 | 122 |
123 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) | 123 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) |
124 { | 124 { |
127 }; | 127 }; |
128 | 128 |
129 class OrthancMultiframeVolumeLoader::LoadUncompressedPixelData : public State | 129 class OrthancMultiframeVolumeLoader::LoadUncompressedPixelData : public State |
130 { | 130 { |
131 public: | 131 public: |
132 LoadUncompressedPixelData(OrthancMultiframeVolumeLoader& that) : | 132 explicit LoadUncompressedPixelData(OrthancMultiframeVolumeLoader& that) : |
133 State(that) | 133 State(that) |
134 { | 134 { |
135 } | 135 } |
136 | 136 |
137 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) | 137 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) |
138 { | 138 { |
383 while (it != distribution.end()) | 383 while (it != distribution.end()) |
384 { | 384 { |
385 T pixelValue = it->first; | 385 T pixelValue = it->first; |
386 uint64_t count = it->second; | 386 uint64_t count = it->second; |
387 totalCount += count; | 387 totalCount += count; |
388 it++; | 388 ++it; |
389 if (it == distribution.end()) | 389 if (it == distribution.end()) |
390 distributionRawMax_ = static_cast<float>(pixelValue); | 390 distributionRawMax_ = static_cast<float>(pixelValue); |
391 } | 391 } |
392 LOG(INFO) << "Volume image. First distribution value = " | 392 LOG(INFO) << "Volume image. First distribution value = " |
393 << static_cast<float>(distributionRawMin_) | 393 << static_cast<float>(distributionRawMin_) |
441 else | 441 else |
442 { | 442 { |
443 currentCount += count; | 443 currentCount += count; |
444 } | 444 } |
445 // and continue walking along the distribution | 445 // and continue walking along the distribution |
446 it++; | 446 ++it; |
447 } | 447 } |
448 } | 448 } |
449 | 449 |
450 // this will contain the actual distribution maximum after outlier | 450 // this will contain the actual distribution maximum after outlier |
451 // rejection | 451 // rejection |
471 else | 471 else |
472 { | 472 { |
473 currentCount += count; | 473 currentCount += count; |
474 } | 474 } |
475 // and continue walking along the distribution | 475 // and continue walking along the distribution |
476 it++; | 476 ++it; |
477 } | 477 } |
478 } | 478 } |
479 if (resultMin > resultMax) | 479 if (resultMin > resultMax) |
480 { | 480 { |
481 LOG(ERROR) << "Internal error in dose distribution computation! " << | 481 LOG(ERROR) << "Internal error in dose distribution computation! " << |