align_epi_anat.py

Hi,

I would like to register an epi image (b0 image from a diffusion acquisition) to the MPRAGE scan of the same subject using align_epi+anat.py, but I get the following error:

bash-3.2$ align_epi_anat.py -anat IC004-4_t1_std.nii -epi IC004-4_dti_b2500_SC_EC_t2di.nii.gz -epi_base 0 -suffix T12b0 -deoblique off -tshift off -master_anat IC004-4_dti_b0.nii.gz

#++ align_epi_anat version: 1.57
#Script is running (command trimmed):
3dAttribute DELTA ./IC004-4_dti_b2500_SC_EC_t2di.nii.gz
#Script is running (command trimmed):
3dAttribute DELTA ./IC004-4_dti_b2500_SC_EC_t2di.nii.gz
#Script is running (command trimmed):
3dAttribute DELTA ./IC004-4_t1_std.nii
#++ Multi-cost is lpc
#++ Removing all the temporary files
#Script is running:
\rm -f ./__tt_IC004-4_dti_b2500_SC_EC_t2di*
#Script is running:
\rm -f ./__tt_IC004-4_t1_std*
#Script is running (command trimmed):
3dcopy ./IC004-4_t1_std.nii ./__tt_IC004-4_t1_std+orig
++ 3dcopy: AFNI version=AFNI_17.2.05 (Jul 27 2017) [64-bit]
#++ Removing skull from anat data
#Script is running (command trimmed):
3dSkullStrip -orig_vol -input ./__tt_IC004-4_t1_std+orig -prefix ./__tt_IC004-4_t1_std_ns
+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./__tt_IC004-4_t1_std+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./__tt_IC004-4_t1_std+orig.BRIK is 3.585230 degrees from plumb.
Warning 3dSkullStrip:
***************
Surface self intersecting! trying again:
smoothing of 84, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 96, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 108, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 120, avoid_vent -1
#++ Copying NIFTI EPI input to AFNI format
#Script is running (command trimmed):
3dcopy ./IC004-4_dti_b2500_SC_EC_t2di.nii.gz ./__tt_IC004-4_dti_b2500_SC_EC_t2di+tlrc
++ 3dcopy: AFNI version=AFNI_17.2.05 (Jul 27 2017) [64-bit]
#++ using 0th sub-brick because only one found
#Script is running (command trimmed):
3dbucket -prefix ./__tt_IC004-4_dti_b2500_SC_EC_t2di_ts ./__tt_IC004-4_dti_b2500_SC_EC_t2di+tlrc’[0]’
++ 3dbucket: AFNI version=AFNI_17.2.05 (Jul 27 2017) [64-bit]
#++ resampling epi to match anat data
#Script is running (command trimmed):
3dresample -master ./__tt_IC004-4_t1_std_ns+orig -prefix ./__tt_IC004-4_dti_b2500_SC_EC_t2di_ts_rs -inset ./__tt_IC004-4_dti_b2500_SC_EC_t2di_ts+tlrc’’ -rmode Cu
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./__tt_IC004-4_t1_std_ns+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./__tt_IC004-4_t1_std_ns+orig.BRIK is 3.585230 degrees from plumb.
++ Oblique dataset:./__tt_IC004-4_dti_b2500_SC_EC_t2di_ts+tlrc.BRIK is 2.883916 degrees from plumb.
** ERROR: Could not resample

#++ removing skull or area outside brain
Traceback (most recent call last):
File “/Users/giovanni/abin/align_epi_anat.py”, line 3414, in
ps.process_epi(use_ss=ps.epi_strip_method)
File “/Users/giovanni/abin/align_epi_anat.py”, line 3110, in process_epi
skullstrip_o = self.skullstrip_data( e, use_ss, ps.skullstrip_opt, prefix)
File “/Users/giovanni/abin/align_epi_anat.py”, line 2871, in skullstrip_data
% (skullstrip_opt, e.input(), n.pp()) , ps.oexec)
AttributeError: ‘NoneType’ object has no attribute ‘input’

Any ideas where the problem comes from?
Thanks,
Giovanni

Ciao, Giovanni-

There are others more qualified to answer about the align_epi_anat.py function specifically.

However, my ears perked up at the sight of having a b0 from a DWI acquisition. Can I ask more about this? Do you have ROIs from T1w-space that you would want to bring to the DTI space for tracking, perhaps? If so, then I would point out some functionality for that kind of thing here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/fatcat_prep/Postprocessing_II.html

If that’s not useful or what you want, then you can purge it from your memory bank!

-pt

I’ve seen that reported a couple times over the years, but I haven’t had any data myself. You can turn off the resampling step with “-resample off”. If these were done across sessions, I would imagine you would also need “-ginormous_move” to handle the large difference in coordinates and ignore obliquity.

Dear Daniel and Paul,

thank you very much for your messages. Actually, the command works by putting the -resample option to off. It is an error that I started having since I received the new pc at work…

Thank you Paul for the useful link; it is definitely something useful with DTI data.

Thanks
Giovanni