[vtkusers] VTK6.3 runtime crash when using vtkImageData as input for vtkImageAlgorithm

D L lackodan at outlook.com
Tue Jun 7 10:22:27 EDT 2016


Hi again,

I have another question. I'm using VTK 6.3 in Python 2.7, and every time I try to use an object of type vtkImageData as input for an vtkImageAlgorithm, it crashes, saying "This application has requested the Runtime to terminate it in an unusual way". Here's a minimal example reading and writing a NIFTI-file:

niftiReader = vtk.vtkNIFTIImageReader()
niftiReader.SetFileName("c4ICBM_MNI_0103.nii")

niftiWriter = vtk.vtkNIFTIImageWriter()
niftiWriter.SetFileName("output.nii")
# niftiWriter.SetInputConnection(niftiReader.GetOutputPort())  # this works
niftiWriter.SetInputData(niftiReader.GetOutput())  # this causes a crash
niftiWriter.Write()

The file I'm using can be downloaded here: https://onedrive.live.com/redir?resid=C74503A42DE708!3266&authkey=!AGdR2dDTvYntgYc&ithint=file%2cnii

As far as I understand, niftiReader.GetOutput() returns a vtkImageData (which is a vtkDataObject) and vtkNIFTIWriter.GetInputData() should take a vtkDataObject as input.

Could anyone help me understand what's going on? Please let me know if you need any more info.

Cheers,

Daniel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160607/b8e185e2/attachment.html>


More information about the vtkusers mailing list