[Nipy-devel] nipy affines

Bago Amirbekian mrbago@gmail....
Mon Jan 11 21:19:58 CST 2010


Please let me know if this is the wrong forum to ask this question, but 
I don't quite understand what is going on with the nipy affines. My 
question is first, is the behavior bellow expected? Second if so, why do 
i lose the second column of the affine? if I'm loosing anything 
shouldn't it be the fourth column? And third, is there a way to make 
ipython round if i need to produce pretty outputs for pasting into 
future emails?

In [21]: im1.shape
Out[21]: (256, 256, 50, 56)

In [22]: im1.affine
Out[22]:
array([[  -1.09379995,    0.        ,    0.        ,    0.        ,    
143.82800293],
       [   0.        ,   -1.09379995,    0.        ,    0.        ,    
159.13600159],
       [   0.        ,    0.        ,   -2.20000005,    0.        ,    
81.48210144],
       [   0.        ,    0.        ,    0.        ,    0.        ,    
0.        ],
       [   0.        ,    0.        ,    0.        ,    0.        ,    
1.        ]])

In [23]: im2=im1[...,0]

In [24]: im2.shape
Out[24]: (256, 256, 50)

In [25]: im2.affine
Out[25]:
array([[  -1.09379995,    0.        ,    0.        ,  143.82800293],
       [   0.        ,    0.        ,    0.        ,  159.13600159],
       [   0.        ,   -2.20000005,    0.        ,   81.48210144],
       [   0.        ,    0.        ,    0.        ,    0.        ],
       [   0.        ,    0.        ,    0.        ,    1.        ]])

Bago



More information about the Nipy-devel mailing list