[vtkusers] volume rendering ImageData after vtkImageReslice
David Gobbi
dgobbi at imaging.robarts.ca
Mon Aug 19 08:32:21 EDT 2002
Hi Yuan,
One problem you will have is that the volume will look squashed
the way that you have resampled it. The vtkImageViewer always
maps one image pixel (voxel) to one screen pixel i.e. it ignores
the Spacing of the image data. The vtkVolume does look at the
Spacing of the input image data, so it will see that the spacing
in Z is on-fifth the spacing in x or y and render accordingly.
When you read image data into VTK, you should always make sure
that you set the x, y, and z spacing correctly in the Reader.
For example to something like (1,1,5) in your case. Then, to
you resample the data, you change the spacing to (1,1,1).
There are many filters in VTK that cant't work properly unless
you correctly set the DataSpacing in the Reader. These include
vtkImageReslice, vtkMarchingCubes, vtkContourFilter, vtkProbeFilter,
vtkImageActor and several others.
- David
--
David Gobbi, MSc dgobbi at imaging.robarts.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
On Mon, 19 Aug 2002, Yuan Jin wrote:
> Hi all,
>
> I am trying to get more slices from the raw data, ie. interpolate between
> two adjacent slices to generate more slices. I have 30 slices raw data and
> want to interpolate addtional 4 slices between each two slices. I use the
> code below
>
> reslice = vtkImageReslice()
> reslice.SetInput(reader.GetOutput())
> reslice.GetOutput().SetExtent(0,511,0,511,1,150)
> reslice.InterpolateOn()
> reslice.SetInterpolationModeToCubic()
> reslice.SetOutputSpacing(1,1,0.2)
> reslice.SetOutputExtent(0,511,0,511,1,150)
> reslice.Update()
>
> I can see the resulting slices (interpolated ones) using vtkImageViewer, but
> when I volume render the vtkImageData (reslice.GetOutput()), it doesn't
> work. anyone has experience?
>
> Thanks a lot
>
> Yuan
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list