comparison Framework/Radiography/RadiographyMaskLayer.cpp @ 1201:ab958fd99b07

RadiographyScene fixes
author Alain Mazy <alain@mazy.be>
date Fri, 29 Nov 2019 16:21:24 +0100
parents a5f2a6b04a31
children 69177b10e2b9
comparison
equal deleted inserted replaced
1199:922d2e61aa5d 1201:ab958fd99b07
110 Orthanc::ImageAccessor cropped; 110 Orthanc::ImageAccessor cropped;
111 mask_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight); 111 mask_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight);
112 112
113 Orthanc::Image tmp(Orthanc::PixelFormat_Grayscale8, buffer.GetWidth(), buffer.GetHeight(), false); 113 Orthanc::Image tmp(Orthanc::PixelFormat_Grayscale8, buffer.GetWidth(), buffer.GetHeight(), false);
114 114
115 t.Apply(tmp, cropped, ImageInterpolation_Nearest, true /* clear */);
116 115
117 unsigned int x1, y1, x2, y2; 116 unsigned int x1, y1, x2, y2;
118 OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2, 117 if (!OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2,
119 t.GetHomogeneousMatrix(), 118 t.GetHomogeneousMatrix(),
120 cropped.GetWidth(), 119 cropped.GetWidth(),
121 cropped.GetHeight(), 120 cropped.GetHeight(),
122 buffer.GetWidth(), 121 buffer.GetWidth(),
123 buffer.GetHeight()); 122 buffer.GetHeight()))
123 {
124 return; // layer is outside the buffer
125 }
126
127 t.Apply(tmp, cropped, ImageInterpolation_Nearest, true /* clear */);
124 128
125 // we have observed vertical lines at the image border (probably due to bilinear filtering of the DICOM image when it is not aligned with the buffer pixels) 129 // we have observed vertical lines at the image border (probably due to bilinear filtering of the DICOM image when it is not aligned with the buffer pixels)
126 // -> draw the mask one line further on each side 130 // -> draw the mask one line further on each side
127 if (x1 >= 1) 131 if (x1 >= 1)
128 { 132 {