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->SetDirectoryName("/home/zoyd/data/dicom/11034");<br>readerG->Update();<br><br>// Center the image so that our scaling is uniform.<br>vtkImageChangeInformation * imageChangeInformation = vtkImageChangeInformation::New();
<br>imageChangeInformation->SetInput(readerG->GetOutput());<br>imageChangeInformation->CenterImageOn();<br><br>// Scale the image to double the size<br>vtkTransform * transform = vtkTransform::New();<br>transform->Identity();
<br>transform->Scale(0.5, 0.5, 0.5);<br> <br>// VTK reslicer<br>vtkImageReslice * slicer = vtkImageReslice::New();<br>slicer->SetResliceTransform(transform);<br>slicer->SetInput(imageChangeInformation->GetOutput());
<br>slicer->SetOutputDimensionality (2);<br>slicer->InterpolateOn();<br>slicer->SetInterpolationModeToCubic();<br><br>vtkImageViewer2 * view = vtkImageViewer2::New();<br>view->SetInput(slicer->GetOutput());
<br><br>// Not important... <br>widget.SetRenderWindow(viewer1->GetRenderWindow());<br>viewer1->SetupInteractor(widget.GetRenderWindow()->GetInteractor());<br>viewer1->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>