comparison Framework/Toolbox/Slice.cpp @ 120:063f7f3d9f14 wasm

fix 3d locations of the doses
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Oct 2017 15:51:34 +0200
parents ba83e38cf3ff
children e66b2c757790
comparison
equal deleted inserted replaced
119:ba83e38cf3ff 120:063f7f3d9f14
67 } 67 }
68 68
69 std::vector<std::string> offsets; 69 std::vector<std::string> offsets;
70 Orthanc::Toolbox::TokenizeString(offsets, offsetTag, '\\'); 70 Orthanc::Toolbox::TokenizeString(offsets, offsetTag, '\\');
71 71
72 if (frameCount_ == 0 || 72 if (frameCount_ <= 1 ||
73 offsets.size() != frameCount_ || 73 offsets.size() != frameCount_ ||
74 frame >= frameCount_) 74 frame >= frameCount_)
75 { 75 {
76 LOG(ERROR) << "No information about the 3D location of some slice(s) in a RT DOSE"; 76 LOG(ERROR) << "No information about the 3D location of some slice(s) in a RT DOSE";
77 return false; 77 return false;
78 } 78 }
79 79
80 double offset0, z; 80 double offset0, offset1, z;
81 81
82 if (!ParseDouble(offset0, offsets[0]) || 82 if (!ParseDouble(offset0, offsets[0]) ||
83 !ParseDouble(offset1, offsets[1]) ||
83 !ParseDouble(z, offsets[frame])) 84 !ParseDouble(z, offsets[frame]))
84 { 85 {
85 LOG(ERROR) << "Invalid syntax"; 86 LOG(ERROR) << "Invalid syntax";
86 return false; 87 return false;
87 } 88 }
91 LOG(ERROR) << "Invalid syntax"; 92 LOG(ERROR) << "Invalid syntax";
92 return false; 93 return false;
93 } 94 }
94 95
95 geometry_ = CoordinateSystem3D(geometry_.GetOrigin() + z * geometry_.GetNormal(), 96 geometry_ = CoordinateSystem3D(geometry_.GetOrigin() + z * geometry_.GetNormal(),
97 //+ 650 * geometry_.GetAxisX(),
96 geometry_.GetAxisX(), 98 geometry_.GetAxisX(),
97 geometry_.GetAxisY()); 99 geometry_.GetAxisY());
100
101 thickness_ = offset1 - offset0;
102 if (thickness_ < 0)
103 {
104 thickness_ = -thickness_;
105 }
106
107 printf("%d: %f %f %f\n", frame_, geometry_.GetOrigin()[0], geometry_.GetOrigin()[1], geometry_.GetOrigin()[2]);
108 //printf("%f %f %f\n", pixelSpacingX_, pixelSpacingY_, thickness_);
98 109
99 return true; 110 return true;
100 } 111 }
101 112
102 113