Hi,<div><br></div><div>I'm trying to use simpleitk. I need to add two images of same size and shape. i'm converting them to numpy arrays and adding to get a final numpy array. When I try to convert that back to a simpleitk image i get this error. </div>
<div><br></div><div><div>In [11]: imComb_0_2 = sitk.GetImageFromArray(npComb_0_2)</div><div>ERROR: An unexpected error occurred while tokenizing input</div><div>The following traceback may be corrupted or invalid</div><div>
The error message is: ('EOF in multi-line statement', (7061, 0))</div><div><br></div><div>---------------------------------------------------------------------------</div><div>TypeError Traceback (most recent call last)</div>
<div><br></div><div>/home/ros/cpp_code/itkAdd/data/<ipython console> in <module>()</div><div><br></div><div>/media/sda5/home/ros/softwares/bio/SimpleITK/bin/SimpleITK-build/Wrapping/SimpleITK.pyc in GetImageFromArray(arr)</div>
<div> 146 """Get a SimpleITK Image from a numpy array."""</div><div> 147 </div><div>--> 148 return _SimpleITK._GetImageFromArray( arr )</div><div> 149 </div><div> 150 class VectorBool(_object):</div>
<div><br></div><div>TypeError: 'numpy.ndarray' does not have the buffer interface</div><div><br></div><div>In [12]: imComb_0_2 = sitk.GetImageFromArray(npComb_0_2)</div><div>ERROR: An unexpected error occurred while tokenizing input</div>
<div>The following traceback may be corrupted or invalid</div><div>The error message is: ('EOF in multi-line statement', (7061, 0))</div><div><br></div><div>---------------------------------------------------------------------------</div>
<div>TypeError Traceback (most recent call last)</div><div><br></div><div>/home/ros/cpp_code/itkAdd/data/<ipython console> in <module>()</div><div><br></div><div>/media/sda5/home/ros/softwares/bio/SimpleITK/bin/SimpleITK-build/Wrapping/SimpleITK.pyc in GetImageFromArray(arr)</div>
<div> 146 """Get a SimpleITK Image from a numpy array."""</div><div> 147 </div><div>--> 148 return _SimpleITK._GetImageFromArray( arr )</div><div> 149 </div><div> 150 class VectorBool(_object):</div>
<div><br></div><div>TypeError: 'numpy.ndarray' does not have the buffer interface</div><div><br></div><div><br></div><div>Can somebody help me with this? Thank you.</div><div><br></div>-- <br>Regards,<br>Onti<br>
</div>