[vtkusers] vtkImageReslice to vtkImageBlend

Bill Q bill.q.hdp at gmail.com
Tue Apr 18 23:15:52 EDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170419/6cb2eaf9/attachment.html>


More information about the vtkusers mailing list