Then I used @Align Centers : -base {ref_base} -dset {sdir_anat2} -child ${ddets_epi}
But the problem is not solved, there is no change in the image after and before alignment, why is that?
... where DSET_ANAT is your input anatomical volume (probably a T1w anatomical) and DSET_REF is the reference/template volume you are using? This command will make an image that shows the initial overlap of those---I wonder if part of the problem here is that they are very far away to start, like if the anatomical has not-well-centered coordinates, and that is creating a memory issue.
So, please post the image (or images) that are output by that command, as well as the afni_proc.py command, and hopefully those will suggest what is happening.
Similarly, the EPI could be far off from the anat (sometimes the volume origins are not correct). It might be good to see how the +orig space vr_base dataset overlaps with the +orig space anat.
While deobliquing the anatomical before any processing can be useful, you should not need to deoblique the EPI. And deobliquing it in this way can actually change its apparent location quite a lot, possibly moving it far away from overlapping with its partner anatomical dataset. Even for deobliquing the anatomical, this is probably not the best way to go. We have recently written a new wrapper script to manage this, called adjunct_deob_around_origin. It essentially provides a way to deoblique while preserving the coordinate origin:
# and note that this has to copy to a BRIK/HEAD file,
# but the final DSET_NEW can be NIFTI again, fine
3dcopy DSET __tmp
3drefit -oblique_recenter __tmp+orig
3drefit -deoblique __tmp+orig
3dcopy __tmp+orig DSET_NEW
Another issue is that I notice to you also refitting the headers for your EPI and anatomical to have ORIG space. Your inputs should be in native/original space already. One reason they might not be is because of the ambiguous qform_code and sform_code values that some (other) software produce for NIFTI files (seeing the dreaded "2" appear there). Is that the case in what you have? What is the output of this for your EPI and anatomical:
?
That can be reset with 3drefit, sure. That is a separate consideration, but it would be good to know the root of the issue.
... and all of this is prior to considering anything about afni_proc.py. Such is life with data, that much work+understanding happens before the actual processing.
--pt
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.