Hi,<div><br></div><div>I&#39;m trying to use simpleitk. I need to add two images of same size and shape. i&#39;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: (&#39;EOF in multi-line statement&#39;, (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/&lt;ipython console&gt; in &lt;module&gt;()</div><div><br></div><div>/media/sda5/home/ros/softwares/bio/SimpleITK/bin/SimpleITK-build/Wrapping/SimpleITK.pyc in GetImageFromArray(arr)</div>

<div>    146     &quot;&quot;&quot;Get a SimpleITK Image from a numpy array.&quot;&quot;&quot;</div><div>    147 </div><div>--&gt; 148     return _SimpleITK._GetImageFromArray( arr )</div><div>    149 </div><div>    150 class VectorBool(_object):</div>

<div><br></div><div>TypeError: &#39;numpy.ndarray&#39; 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: (&#39;EOF in multi-line statement&#39;, (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/&lt;ipython console&gt; in &lt;module&gt;()</div><div><br></div><div>/media/sda5/home/ros/softwares/bio/SimpleITK/bin/SimpleITK-build/Wrapping/SimpleITK.pyc in GetImageFromArray(arr)</div>

<div>    146     &quot;&quot;&quot;Get a SimpleITK Image from a numpy array.&quot;&quot;&quot;</div><div>    147 </div><div>--&gt; 148     return _SimpleITK._GetImageFromArray( arr )</div><div>    149 </div><div>    150 class VectorBool(_object):</div>

<div><br></div><div>TypeError: &#39;numpy.ndarray&#39; 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>