[vtkusers] Superpose two vtkImageData with ResliceImageViewer

Jojobus jojotranel at hotmail.com
Tue Jan 31 03:28:40 EST 2017


Hello,

I copy my former message in order to be broadcast in the mailing list :):

I am trying to superpose two vtkImageDatas; one greyscale (DICOM) and
another that is coloured (the dose-map). The dose map is mostly zero, and
using vtkLookUpTable, I used LUT.SetTableValue(0, 0./255., 0./255.,
0./255.,0) so that those voxels are transparent.

The goal is to show the DICOM and place the dose-map over the top (but with
transparent voxels where the dose is zero).

I use vtkResliceImageViewer to visualise the vtkImageData because I am using
python.

I can visualise both the DICOM and the dose-map separately, but I can't
superpose the two. Using the code attached at the end of this post opens two
render windows with strange interactions (scrolling on one window moves
through slices of the second render window).

I imagine my problem comes from reusing the same interactor for two
different vtkResliceImageViewers.

Any ideas?

Thanks in advance.

# Create render window and interactor
renWin = vtk.vtkRenderWindow()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

# Read DICOM
directory = vtkDICOMPython.vtkDICOMDirectory()
directory.SetDirectoryName(PathDicom)
directory.Update()

readerDICOM = vtkDICOMPython.vtkDICOMReader()
readerDICOM.SetFileNames(directory.GetFileNamesForSeries(0))
readerDICOM.Update()

# Read dose
readerDose = vtk.vtkMetaImageReader()
readerDose.SetFileName("/home/jonathan/Bureau/DICOMcochon/mhd/holmium.mhd")
readerDose.Update()

# Visualise DICOM
StackViewerDICOM=vtk.vtkResliceImageViewer()
StackViewerDICOM.SetInputData(readerDICOM.GetOutput())
StackViewerDICOM.SetupInteractor(iren)
StackViewerDICOM.SetSliceOrientation(2) #Sur 0 ou 1: vue sagittale ou
coronale

# Visualise dose
StackViewerDose=vtk.vtkResliceImageViewer()
StackViewerDose.SetInputData(readerDose.GetOutput())
StackViewerDose.SetupInteractor(iren)
StackViewerDose.SetSliceOrientation(2) #Sur 0 ou 1: vue sagittale ou
coronale

# Start interactor
iren.Initialize()
iren.Start() 



--
View this message in context: http://vtk.1045678.n5.nabble.com/Superpose-two-vtkImageData-with-ResliceImageViewer-tp5741971p5741990.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list