vtkImageReslice to vtkImageBlend

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

vtkImageReslice to vtkImageBlend

Bill Q
Hi All,
I have some two DICOM data sets that I would like to blend to display together. I am using vtkImageReslice to get slices from each data set and tried to blend them in vtkImageBlend. The rough code is as following:
self.reslice_1 = vtk.vtkImageReslice()
self.reslice_1.SetInputConnection(img_reader_1.GetOutputPort())
self.reslice_1.SetOutputDimensionality(2)
self.reslice_1.SetResliceAxes(image_basics_1.axes[orientation])
self.reslice_1.SetInterpolationModeToLinear()
self.reslice_1.SetOutputSpacing(img_reader_1.GetDataSpacing())

self.reslice_2 = vtk.vtkImageReslice()
self.reslice_2.SetInputConnection(img_reader_2.GetOutputPort())
self.reslice_2.SetOutputDimensionality(2)
self.reslice_2.SetResliceAxes(image_basics_2.axes[orientation])
self.reslice_2.SetInterpolationModeToLinear()
self.reslice_2.SetOutputSpacing(img_reader_2.GetDataSpacing())
self.blend = vtk.vtkImageBlend()
self.blend.AddInputConnection(self.reslice_1.GetOutputPort())
self.blend.AddInputConnection(self.reslice_2.GetOutputPort())
self.blend.SetOpacity(0, .5)
self.blend.SetOpacity(1, .5)
But for some reasons, all I got is a blank. What did I miss?

Many thanks.


Bill

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers