Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent defacing results #51

Open
noah10 opened this issue Mar 29, 2023 · 1 comment
Open

inconsistent defacing results #51

noah10 opened this issue Mar 29, 2023 · 1 comment

Comments

@noah10
Copy link

noah10 commented Mar 29, 2023

We're finding inconsistent results in defacing depending on the hardware and minor dependency version changes. In the image below, the red is:

  • pydeface 2.0.2
  • fsl 6.0.4
  • python 3.10.4
  • OS Ventura 13.2.1 on Intel Mac

...and the green is:

  • pydeface 2.0.2
  • fsl 6.0.5.1
  • python 3.10.1
  • OS debian:bullseye-slim (run in Docker with --platform=linux/x86_64 on an M1 Mac, fwiw)

The green is what we see with pydeface 2.0.0 and 2.0.2 on fsl 5 and 6 on a variety of python/debian version combinations; so far it's only the Mac that's different. Unfortunately, the green is also obviously not very well defaced. (The red has its own defacing problems, of course, just different ones.) The original nifti is a normalized PDw high-resolution scan targeting the locus coeruleus.

Does anyone have any thoughts as to why we're seeing different results on different hardware platforms?

Screenshot 2023-03-29 at 10 23 30 AM

@ofgulban
Copy link
Collaborator

ofgulban commented Mar 30, 2023

Hi @noah10 ,

pydeface is basically a wrapper for fsl flirt registration program. See lines:

pydeface/pydeface/utils.py

Lines 90 to 112 in 69a17a6

print('Defacing...\n %s' % infile)
# register template to infile
outfile_type = get_outfile_type(template_reg)
flirt = fsl.FLIRT()
flirt.inputs.cost_func = cost
flirt.inputs.in_file = template
flirt.inputs.out_matrix_file = template_reg_mat
flirt.inputs.out_file = template_reg
flirt.inputs.output_type = outfile_type
flirt.inputs.reference = infile
flirt.run()
outfile_type = get_outfile_type(warped_mask)
# warp facemask to infile
flirt = fsl.FLIRT()
flirt.inputs.in_file = facemask
flirt.inputs.in_matrix_file = template_reg_mat
flirt.inputs.apply_xfm = True
flirt.inputs.reference = infile
flirt.inputs.out_file = warped_mask
flirt.inputs.output_type = outfile_type
flirt.inputs.out_matrix_file = warped_mask_mat
flirt.run()

Therefore, I suspect that the difference you are seeing is related to fsl version differences and its dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants