[Neuroimaging] Affine Matrix AttributeError

Ángel Torrado Carvajal angel.torrado at urjc.es
Tue Oct 13 22:08:53 CEST 2015


Dear all,

I am trying to execute my (already working) code, and I am getting an error:

Traceback (most recent call last):
  File "PatchBasedSegmentation.py", line 158, in <module>
    output_img = nb.Nifti1Image(output_matrix_0, input_img.affine,
input_img.header)
AttributeError: 'Nifti1Image' object has no attribute 'affine'

where:

input_img = nb.load(input_path + input_vol)

What's the problem? From the *documentation
<http://nipy.org/nibabel/nibabel_images.html>* a 'Nifti1Image' object HAS
attribute 'affine'. Actually, it is working in my laptop. How can I fix it
in this computer?

Thank you in advance,
*--*
*      Ángel Torrado Carvajal*

*      Research Assistant*
      Medical Image Analysis Laboratory
      Universidad Rey Juan Carlos

      Despacho 155 - Departamental II
      Calle Tulipán s/n
      28933 Móstoles - Madrid

*      Before printing this message, make sure it's necessary. Protecting
the environment is in your hand.*
*      Antes de imprimir este mensaje, asegúrate de que es necesario.
Proteger el medio ambiente está también en tu mano.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20151013/9bd9c856/attachment.html>


More information about the Neuroimaging mailing list