Hi everyone,<br><br>Another one of those endless questions about the vtkImageReslicer.<br><br>I am trying to achieve scaling through the vtkImageReslicer by applying the diagonal scaling matrix through a vtkTransform.<br><br>
The problem is that the output of the reslicer actually chops the image along the sides... i.e. cuts off portions of it. This chopping increases as the scaling increases. I think the reslicer is not returning the full image size or something like this. I have tried playing with OutputExtent but it did not help :(
<br><br>I have the code below. Quite simple, as you can see.<br><br>//-------------------------------------------------------------------------------------<br>QVTKWidget widget;<br>widget.resize(512, 512);<br><br>vtkDICOMImageReader *readerG = vtkDICOMImageReader::New();
<br>readerG-&gt;SetDirectoryName(&quot;/home/zoyd/data/dicom/11034&quot;);<br>readerG-&gt;Update();<br><br>// Center the image so that our scaling is uniform.<br>vtkImageChangeInformation * imageChangeInformation = vtkImageChangeInformation::New();
<br>imageChangeInformation-&gt;SetInput(readerG-&gt;GetOutput());<br>imageChangeInformation-&gt;CenterImageOn();<br><br>// Scale the image to double the size<br>vtkTransform * transform = vtkTransform::New();<br>transform-&gt;Identity();
<br>transform-&gt;Scale(0.5, 0.5, 0.5);<br>&nbsp;&nbsp; &nbsp;<br>// VTK reslicer<br>vtkImageReslice * slicer = vtkImageReslice::New();<br>slicer-&gt;SetResliceTransform(transform);<br>slicer-&gt;SetInput(imageChangeInformation-&gt;GetOutput());
<br>slicer-&gt;SetOutputDimensionality (2);<br>slicer-&gt;InterpolateOn();<br>slicer-&gt;SetInterpolationModeToCubic();<br><br>vtkImageViewer2 * view = vtkImageViewer2::New();<br>view-&gt;SetInput(slicer-&gt;GetOutput());
<br><br>// Not important...&nbsp;&nbsp; &nbsp;<br>widget.SetRenderWindow(viewer1-&gt;GetRenderWindow());<br>viewer1-&gt;SetupInteractor(widget.GetRenderWindow()-&gt;GetInteractor());<br>viewer1-&gt;Render();<br>//-------------------------------------------------------------------------------------
<br><br>I would really appreciate if someone can help me here. I am truly stuck!!!<br><br>Thanks,<br><br>Anna<br>