Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyDicomLayer.cpp @ 1201:ab958fd99b07
RadiographyScene fixes
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Fri, 29 Nov 2019 16:21:24 +0100 |
parents | a5f2a6b04a31 |
children | b519c1c878f1 a989c7d46b9a |
comparison
equal
deleted
inserted
replaced
1199:922d2e61aa5d | 1201:ab958fd99b07 |
---|---|
159 AffineTransform2D::CreateOffset(cropX, cropY)); | 159 AffineTransform2D::CreateOffset(cropX, cropY)); |
160 | 160 |
161 Orthanc::ImageAccessor cropped; | 161 Orthanc::ImageAccessor cropped; |
162 converted_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight); | 162 converted_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight); |
163 | 163 |
164 unsigned int x1, y1, x2, y2; | |
165 if (!OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2, | |
166 t.GetHomogeneousMatrix(), | |
167 cropped.GetWidth(), | |
168 cropped.GetHeight(), | |
169 buffer.GetWidth(), | |
170 buffer.GetHeight())) | |
171 { | |
172 return; // layer is outside the buffer | |
173 } | |
174 | |
164 t.Apply(buffer, cropped, interpolation, false); | 175 t.Apply(buffer, cropped, interpolation, false); |
165 unsigned int x1, y1, x2, y2; | |
166 OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2, | |
167 t.GetHomogeneousMatrix(), | |
168 cropped.GetWidth(), | |
169 cropped.GetHeight(), | |
170 buffer.GetWidth(), | |
171 buffer.GetHeight()); | |
172 | 176 |
173 if (applyWindowing) | 177 if (applyWindowing) |
174 { | 178 { |
175 // apply windowing but stay in the range [0.0, 65535.0] | 179 // apply windowing but stay in the range [0.0, 65535.0] |
176 float w0 = windowCenter - windowWidth / 2.0f; | 180 float w0 = windowCenter - windowWidth / 2.0f; |