Compute mask for several objects

Hello everyone
I have several subjects (around 200) and I used uber_subject.py to do the pre-processing steps on them. In the result folder there are several files that have the mask word in their names, the names are:
rm.mask_r01+orig.HEAD
rm.mask_r01+orig.BRIK.gz
full_mask.S142290+orig.HEAD
full_mask.S142290+orig.BRIK.gz

first of all I would like to know the difference between these files.

And my second question is that how can I compute the union of several masks and combine them into a single mask. (I know that I should probably use 3dmask_tool but I don’t know how)

Here is what I have done so far Based on this tutorial,. I checked uber_subject.py and I found that it automatically does the following task for each subject:

3dAutomask -dilate 1 -prefix rm.mask_r$run pb03.$subj.r$run.blur+orig

Now I don’t know how to do these steps:

3dMean -datum short -prefix rm.mean rm.mask*.HEAD
3dcalc -a rm.mean+orig -expr ‘ispositive(a-0)’ -prefix full_mask.$subj

When I run the first command I get: 3dMean: No match..

Thank you very much for your time.

It is strange to see the rm.* files, which suggests
your processing script did not actually complete.

As for the difference, the rm* files should not be
there, so do not worry about them. But look at the
proc script for what the full_mask dataset is. That
is the union of EPI masks across runs, so it is a
slightly dilated EPI mask.

Your commands (3dMean/3dcalc) are trying to create a
full_mask dataset, but you already have that.

See example “c2” from the output of “3dmask_tool -help”
for a nice way to combine masks. Does that seem
reasonable?

  • rick

Thank you very much for your answer.
I created the mask that I wanted.
And the example helped me a lot.