AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
June 28, 2013 05:04PM
I've been using (and loving) afni_proc.py for several years now, and have (of course!) read the masking note in the help- the reason for the extents masking sort of made sense and it never seemed to cause any difficulties. But it's created a problem in with a recent (slightly unusual) dataset and in coming up with some work-arounds it's not entirely clear to me whether what I'm doing is valid or not.

There are four functional runs for this participant, and the anatomical image was collected after the last functional run, so I'm using a late volume in the last functional as the EPI base for alignment/volreg purposes. However, it looks like the all1 mask is calculated only once and is calculated based on the first functional run. Normally, all four runs would be collected one after the other with the exact same slice positions and minimal head movement- however, in this particular case we had to remove the participant from the scanner between runs 2 and 3 and didn't get them back in at quite the same position, so the unregistered images from runs 1-2 aren't in particularly good alignment with runs 3-4... they're about 3cm off in the y and z directions in this case (though the anatomical coverage is basically the same.) It's almost like they're data from a separate session (albeit one without an anatomical image for doing cross-session alignment. And that's a question for another day.)

I realize I'm getting long-winded, so to make a long story short, the all1 mask covers runs 1-2 nicely but only shows about 75% overlap with runs 3-4. So when the all1 dataset (based on the run 1 data) is transformed using the catenated align/volreg matrix for these latter runs, it's not actually a good representation of where the brain data is and the mean extents mask is cropped pretty badly, resulting in a brain missing big chunks off the top and side. Incidentially, 3dvolreg is doing a good job of aligning runs 1-2 to the later EPI base- when I look at those (normally automatically removed) temporary volreg files, they are in good alignment and don't appear to be distorted.

I've temporarily solved the extents masking problem by moving the step that creates the all1 mask inside the run loop, so a new all1 mask is created/warped for each run and the mean of those is what is getting turned into the extents mask. That's working great, but as I read through the masking note and try to think harder about what's actually going on, I'm not entirely sure. My questions are:

1. Is creating an all1 mask per run and then warping it using that run's volreg/align transformation invalidating the point of doing extents masking?
1a. If it is, what can I do to get around my particular problem, where the all1 mask isn't in good alignment with later functional runs and I'm losing lots of brain?

And as an aside, is there any particular reason the all1 mask is created based on the first run and not the run where the EPI base is set? That wouldn't solve this problem, but I'm just curious.

Thanks for your help!
- Kate
Subject Author Posted

extents masking

Kate Pirog Revill June 28, 2013 05:04PM

Re: extents masking

rick reynolds June 28, 2013 08:51PM