nilearn / nistats

Modeling and statistical inference on fMRI data in Python
BSD 3-Clause "New" or "Revised" License
95 stars 55 forks source link

[BUG] strange estimation artifacts outside of the EPI #86

Closed MartinPerez closed 8 years ago

MartinPerez commented 8 years ago

I think there is an artifact when we try to estimate a model on voxels outside of the EPI. Typically the cerebellum is in the brain mask but not in the EPI. I am not sure how SPM deals with this but we certainly should too.

Our case: sub-01_task-languagelocalizer_language-string

SPM: language_-_string_glass

bthirion commented 8 years ago

I think that there is a numerical issue with null variance in these regions ... We should indeed take care of that.

MartinPerez commented 8 years ago

Finally this issue was due to wrong inputs given to the masker. by mistake on file names I was giving a mask not in the same space and would have expected a warning to be raised if such mistake happened. I have no idea of what the masker is outputting in that case, but I think is not looking more into it.

Nonetheless should a warning be given when the mask and images are not in the same space? it would have been very useful to me.

bthirion commented 8 years ago

By construction, NiftiMaskers can take images that are not in the same space: if your mask is derives from a 2mm-resolution anatomical image, you may want to apply it to 3mm-sampled fMRI data. I understand that a warning might be helpful so I'm +1 on the idea.

bthirion commented 8 years ago

Looks like a Nilearn issue. Closing.

MartinPerez commented 8 years ago

Actually, I have been running second level analysis on already normalized images, if I use the template mask that includes a portion of empty voxels then this comes up again. So it was not the Masker, it was just that the mistake I did before created empty voxels.

I would reopen this since Im sure its a real annoying issue at second level analysis, where people are likely to use the mask of the template in the common space instead of trying to derive a new one. Maybe we should recommend by default to let the Nilearn masker infer the mask instead?

MartinPerez commented 8 years ago

I think we should be able to handle the case of empty voxels gracefully...

bthirion commented 8 years ago
MartinPerez commented 8 years ago