ecaruyer / phantomas

Create realistic digital phantoms in diffusion MRI.
Other
31 stars 16 forks source link

BF: Indexing for sqrt(2) SH scalling #34

Closed mpaquette closed 8 years ago

mpaquette commented 8 years ago

Trying to generate the FODs was throwing this warning:

phantomas/utils/shm.py:200: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 0; dimension is 30 but corresponding boolean dimension is 1 H[ms != 0] *= np.sqrt(2)

Probably a behaviour change in more recent numpy:

H is (#points x #sh_coef), ms is (1 x #sh_coef) H[ms != 0] was incorrectly indexing H[ 0, (ms != 0)[0] ] instead of H[ :, (ms != 0)[0] ]

Also, fixed a small save path irregularity

ecaruyer commented 8 years ago

Thanks!