Monday, September 18, 2006

Displaying The 2D-Slice

When I first tried to display the slice that came from the 3D-image, it resulted in VTK displaying a completely deformed image that had the bulk of the image colored blue with a red border. I had originally thought that this had to do with the itkImageToVTKImageFilter distorting the data received from ITK. Therefore, I wrote out the image as a .png file and loaded that into VTK, but the problem persisted. This led to me to think that the problem stemmed from the format of the data that I was passing to the VTK interface. The 3D-image had been loaded with a pixel type of unsigned short. I had used unsigned char when VTK had previously worked to display .png files. So I went about trying to change the pixel format of the slice that I had removed. The first filter I tried was the itkImageToImageFilter that would not instantiate itself as a new object due to it being a base class to be used only by other classes derived from it. Then I tried to use the itkRescaleIntensityImageFilter filter. This was able to convert from unsigned short pixels to unsigned char and output an image in that format. I connected the output from the filter to the itkImageToVTKImageFilter and passed that into my VTK visualization set up to successfully display the slice.

The following is an image of the distorted slice on the left and the corrected version on the right:

0 Comments:

Post a Comment

<< Home