pnlbwh / pnlNipype

PNL pipeline for NIFTI images
Other
10 stars 15 forks source link

nifti_align error on Apple M2 Pro chip #106

Open kavandeloo opened 1 year ago

kavandeloo commented 1 year ago

Hi Tashrif! I'm trying pnlNipype on an Apple M2 Pro chip, not sure if it can be done. I have Python 3.10.12; Miniconda3 https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh; FSL 6.0.6.5; I built ANTs from source (https://github.com/ANTsX/ANTs/wiki/Compiling-ANTs-on-Linux-and-Mac-OS); FreeSurfer 7.4.1.

Could you provide insight into this problem with nifti_align?:

(pnlpipe3) katievandeloo@Katies-MacBook-Pro dwi % nifti_align --axisAlign --center -i sub-PILOT_ses-1_dwi.nii.gz --bvals sub-PILOT_ses-1_dwi.bval --bvecs sub-PILOT_ses-1_dwi.bvec -o sub-PILOT-ses-1_desc-Xc_dwi Traceback (most recent call last): File "/Users/katievandeloo/pnlNipype/exec/nifti_align", line 182, in Xalign.run() File "/Users/katievandeloo/fsl/lib/python3.10/site-packages/plumbum/cli/application.py", line 633, in run retcode = inst.main(*tailargs) File "/Users/katievandeloo/pnlNipype/exec/nifti_align", line 178, in main save_nifti(self.out_prefix+'.nii.gz', mri.get_data(), hdr_out.get_best_affine(), hdr_out) File "/Users/katievandeloo/fsl/lib/python3.10/site-packages/nibabel/deprecator.py", line 208, in deprecated_func raise exception(message) nibabel.deprecator.ExpiredDeprecationError: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

tashrifbillah commented 1 year ago

Hi Katie, you just need to downgrade your nibabel.

pip remove nibabel
pip install nibabel==3.2.2