poldracklab / pydeface

defacing utility for MRI images
MIT License
110 stars 42 forks source link

Issue using pydeface on linux VM #45

Closed frankgarcea closed 2 years ago

frankgarcea commented 2 years ago

Hi all,

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 <module>
    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

Has anyone encountered a similar issue?

Thanks, Frank

ofgulban commented 2 years ago

Same issue reported at #46 .

ofgulban commented 2 years ago

I have addressed this issue with the commit above. Should be solved with the release of pydeface v2.0.1. Closing. Feel free to reopen if it is not resolved for after installing pydeface v2.0.1.

frankgarcea commented 2 years ago

@ofgulban Thank you for addressing this! It's much appreciated. Do you have an estimate when we will be able to update via pip? At the moment pydeface 2.0.0 is the go-to version on pip.

All the best, FG

ofgulban commented 2 years ago

I have updated pypi now: https://pypi.org/project/pydeface/2.0.2/ Thanks for the reminder :)