We’re running into issues de-facing anatomical files on our lab’s linux VM. Please note that this issue does not arise when running pydeface on a mac. Here’s the error we get when running pydeface:
Defacing…
sub-014_ses-1_T1w.nii.gz
Traceback (most recent call last):
File “/PathLocalToMyComputer/anaconda3/bin/pydeface”, line 8, in
sys.exit(main())
File “/PathLocalToMyComputer/anaconda3/lib/python3.9/site-packages/pydeface/main.py”, line 95, in main
pdu.deface_image(**vars(args))
File “/PathLocalToMyComputer/anaconda3/lib/python3.9/site-packages/pydeface/utils.py”, line 124, in deface_image
masked_brain = Nifti1Image(outdata, infile_img.get_affine(),
File “/PathLocalToMyComputer/anaconda3/lib/python3.9/site-packages/nibabel/deprecator.py”, line 181, in deprecated_func
raise error_class(message)
nibabel.deprecator.ExpiredDeprecationError: get_affine method is deprecated.
Please use the img.affine property instead.
deprecated from version: 2.1
Raises <class ‘nibabel.deprecator.ExpiredDeprecationError’> as of version: 4.0
Thanks for providing details. It’s strange because I’ve got those programs installed within my conda environment. Here’s my yaml file I use to create the environment.
channels:
conda-forge
dependencies:
pip
dcm2niix
dcm2bids
joblib
nibabel
numpy
pandas
nipype
python>=3.7
scipy
fslpy
pip:
bidsify
cmake
fmriprep-docker
bids-validator
pydeface
I’m still getting the issue “nibabel.deprecator.ExpiredDeprecationError: get_affine method is deprecated.
Please use the img.affine property instead.”
Anything seem out of the ordinary from your point of view?
This was very different than my experience described above. In that case, pydeface will run for about 5 mins to run before it throws me the “img.affine” issue (described above). I’m not sure what’s going on.