<br>I have been working with the second manual which tells about ITK+VTK. I want to know how we can display both the original image and smoothened image together in one VTK window. Is it possible?<br><div class="gmail_quote">
<div>
<div><br></div><div>The code builds without any errors but I must going terribly wrong with my understanding of the concepts because only one image is being displayed..</div><div><div class="im"><br><div>#include "itkImage.h"</div>
<div>#include "itkImageFileReader.h"</div><div>#include "itkImageToVTKImageFilter.h"</div><div>#include "vtkImageViewer.h"</div><div>#include "vtkRenderWindowInteractor.h"</div></div>
<div>
#include "itkCurvatureFlowImageFilter.h"</div><div><br></div><div>int main(int argc, char **argv)</div><div class="im"><div><br></div><div>{</div><div>typedef itk::Image<unsigned short,2>ImageType;</div><div>
typedef itk::ImageFileReader<ImageType>ReaderType;</div>
<div>typedef itk::ImageToVTKImageFilter<ImageType>ConnectorType;</div></div><div>typedef itk::CurvatureFlowImageFilter<ImageType,ImageType>SmoothingFilterType;</div><div><br></div><div>ReaderType::Pointer reader=ReaderType::New();</div>
<div>ConnectorType::Pointer connector=ConnectorType::New();</div><div>SmoothingFilterType::Pointer smoother= SmoothingFilterType::New();</div><div class="im"><div><br></div><div>reader->SetFileName(argv[1]);</div><div>
connector->SetInput(reader->GetOutput());</div>
</div><div>smoother->SetNumberOfIterations(7);</div><div>smoother->SetTimeStep(0.2);</div><div class="im"><div><br></div><div>vtkImageViewer * viewer= vtkImageViewer::New();</div><div>vtkRenderWindowInteractor * renderWindowInteractor= vtkRenderWindowInteractor::New();</div>
<div><br></div><div>viewer->SetupInteractor(renderWindowInteractor);</div><div>viewer->SetInput(connector->GetOutput());</div><div>viewer->Render();</div><div>viewer->SetColorWindow(255);</div><div>viewer->SetColorLevel(128);</div>
<div>renderWindowInteractor->Start();</div></div><div>smoother->SetInput(reader->GetOutput());</div><div class="im"><div>viewer->SetupInteractor(renderWindowInteractor);</div><div>viewer->SetInput(connector->GetOutput());</div>
<div>viewer->Render();</div><div>viewer->SetColorWindow(255);</div><div>viewer->SetColorLevel(128);</div><div>renderWindowInteractor->Start();</div><div>return 0;</div><div>}</div><div><br></div></div><div>Looking forward to hear from you.</div>
<div>Regards,</div><div>Niha</div></div></div></div><br>