[vtkusers] Reading nrrd files
Moreland, Kenneth
kmorel at sandia.gov
Tue Jan 14 22:42:43 EST 2014
Have you tried calling SetDataVOI on the vtkNrrdReader? I don't think it works on ASCII files, but it should work on raw binary encoding.
-Ken
From: Sam Raby <rabysam28 at gmail.com<mailto:rabysam28 at gmail.com>>
Date: Tuesday, January 14, 2014 1:51 PM
To: "vtkusers at vtk.org<mailto:vtkusers at vtk.org>" <vtkusers at vtk.org<mailto:vtkusers at vtk.org>>
Subject: [EXTERNAL] [vtkusers] Reading nrrd files
Hello
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?
The following is what I have written so far.
Thanks
Sam
vtkSmartPointer<vtkNrrdReader> reader = vtkSmartPointer<vtkNrrdReader>::New();
reader->SetFileName(argv[1]);
vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();
imageViewer->SetInputConnection(reader->GetOutputPort());
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
imageViewer->SetupInteractor(renderWindowInteractor);
imageViewer->Render();
imageViewer->GetRenderer()->ResetCamera();
imageViewer->Render();
renderWindowInteractor->Start();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140115/cb2b710c/attachment.html>
More information about the vtkusers
mailing list