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

Wrong registration with given mask and template #48

Open
JiaBob opened this issue Aug 5, 2022 · 2 comments
Open

Wrong registration with given mask and template #48

JiaBob opened this issue Aug 5, 2022 · 2 comments

Comments

@JiaBob
Copy link

JiaBob commented Aug 5, 2022

I use this command to run defacing:

pydeface [my data] --template pydeface/data/mean_reg2mean.nii.gz --facemask pydeface/data/facemask.nii.gz

It runs a long time and I got the output below. It seems that the registration was wrong. Do you know how can I solve this? Which template and mask should I use? Thank you!
image

@ofgulban
Copy link
Collaborator

ofgulban commented Mar 7, 2023

Hi @JiaBob , it seems there there were no responses for a long time. But, my 2 cents on the issue is that prrobably the registration algorithm is failing. This can happen for many reasons and it is hard to debug or give instructions without seeing your nifti files. However, one guess could be that maybe the nifti headers are incorrectly set in your input or template files.

@rbonicel
Copy link

rbonicel commented Feb 6, 2024

Hi @ofgulban ,
I wish to add to this issue in order to not create a similar one, but I think I have the same issue.

I'm using pydeface 2.0.0, on child MRI data (T1w, T2w). With the default templates (facemask.nii.gz and mean_reg2mean.nii.gz) it gives me cropped brain on the frontal part. I assumed that the template data was from adult scans, so I used child templates provided by NIST : https://nist.mni.mcgill.ca/pediatric-atlases-4-5-18-5y/ . But instead of a facemask, they give a brainmask, which still crops a little because the mask is smaller.

Unable to find a child facemask yet, I wanted to use yours, but with a T1w child template from NIST. If i open data on the BrainVISA Anatomist tool (https://brainvisa.info/web/) , i seem to get proper origin registration:
Here's the NIST T1w template fused with your facemask :
Screenshot from 2024-02-06 12-05-53
No brain part is cropped.

Here's my data fused with your facemask (as the NIST brainmask still crops) :

Screenshot from 2024-02-06 12-08-44
Still alright.

But when I run the pydeface with the NIST T1w template and your facemask on my data, I get this :

Screenshot from 2024-02-06 12-10-20
I assume that the registration is not properly done, and the fused Anatomist image is misleading.
Do you have an idea on how to perform a proper registration (SPM ?) beforehand, in order to properly set the origin of the images ?

I checked the https://github.com/nipy/quickshear tool in order to expand a bit the threshold, but it failed directly because images didn't have the same shape and something else (I guess that tool was really basic without registration)

Thanks
Robin

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

3 participants