<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi again,<br><br>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:<br><br><blockquote>niftiReader = vtk.vtkNIFTIImageReader()<br>niftiReader.SetFileName("c4ICBM_MNI_0103.nii")<br><br>niftiWriter = vtk.vtkNIFTIImageWriter()<br>niftiWriter.SetFileName("output.nii")<br># niftiWriter.SetInputConnection(niftiReader.GetOutputPort()) # this works<br>niftiWriter.SetInputData(niftiReader.GetOutput()) # this causes a crash<br>niftiWriter.Write()<br></blockquote><br>The file I'm using can be downloaded here: https://onedrive.live.com/redir?resid=C74503A42DE708!3266&authkey=!AGdR2dDTvYntgYc&ithint=file%2cnii<br><br>As far as I understand, niftiReader.GetOutput() returns a vtkImageData (which is a vtkDataObject) and vtkNIFTIWriter.GetInputData() should take a vtkDataObject as input.<br><br>Could anyone help me understand what's going on? Please let me know if you need any more info.<br><br>Cheers,<br><br>Daniel </div></body>
</html>