[vtkusers] Reading nrrd files

Sam Raby rabysam28 at gmail.com
Thu Jan 16 23:16:51 EST 2014


Thanks Ken for the reply.
In general, I wanted to know what the typical way of reading a NRRD file
is. I thought I should use vtkNrrdReader, but I could not figure it out.

Thanks


On Tue, Jan 14, 2014 at 9:42 PM, Moreland, Kenneth <kmorel at sandia.gov>wrote:

>   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>
> Date: Tuesday, January 14, 2014 1:51 PM
> To: "vtkusers at vtk.org" <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/20140116/365e1ae5/attachment.html>


More information about the vtkusers mailing list