<div dir="ltr">Hello<div><br></div><div>I would like to read a nrrd file and be able to scroll through slices. Is there an example online that can help on how to use vtknrrdreader in order to do that?<div><br></div><div>The following is what I have written so far.</div>
<div><br></div><div>Thanks</div><div>Sam</div></div><div><br></div><div><div><br></div><div>vtkSmartPointer<vtkNrrdReader> reader = vtkSmartPointer<vtkNrrdReader>::New();</div><div>reader->SetFileName(argv[1]);</div>
<div><br></div><div>vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();</div><div>imageViewer->SetInputConnection(reader->GetOutputPort());</div><div><br></div><div>vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();</div>
<div><br></div><div>imageViewer->SetupInteractor(renderWindowInteractor);</div><div>imageViewer->Render();</div><div>imageViewer->GetRenderer()->ResetCamera();</div><div>imageViewer->Render();</div><div><br>
</div><div>renderWindowInteractor->Start();<br></div></div></div>