In one of my subjects auto_warp.py failed to do the affine step by itself. Therefore I tried to calculate before the affine transform with 3dAllineate:
3dAllineate -base ${TEMPLATEDIR}/${TEMPLATE}‘[0]’ -input ${SUBJ}_T1_ns_bc.nii.gz -1Dmatrix_save extra.1D -prefix prueba.nii.gz
I checked and the images are aligned successfully. I tried to give the extra.1D matrix to auto_warp.py to skip the automatic affine step:
auto_warp.py -overwrite -base ${TEMPLATEDIR}/${TEMPLATE}‘[0]’ -input prueba.nii.gz -skull_strip_input no -affine_input_xmat ‘extra.1D’
However, it gave me this error:
#++ auto_warp.py version: 0.04
#Script is running:
mkdir /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/
mkdir: cannot create directory `/bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/': File exists
cd /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/ #Script is running:
rm /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/anat.nii #Script is running (command trimmed):
3dcopy /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/prueba.nii.gz ./anat.nii
++ 3dcopy: AFNI version=AFNI_18.2.06 (Jul 31 2018) [64-bit] #Script is running:
rm /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/anat.un.nii #Script is running (command trimmed):
3dUnifize -GM -input ./anat.nii -prefix ./anat.un.nii
++ 3dUnifize: AFNI version=AFNI_18.2.06 (Jul 31 2018) [64-bit]
Pre-processing: ADV…UWG
++ Output dataset ./anat.un.nii
++ ===== Elapsed = 7.9 sec #Script is running:
rm /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/base.nii #Script is running (command trimmed):
3dcopy /export/home/vferrer/public/PARK_VFERRER/TEMPLATES_ATLAS/MNI152_2009_template_FSL.nii.gz ./base.nii
++ 3dcopy: AFNI version=AFNI_18.2.06 (Jul 31 2018) [64-bit]
** AFNI converts NIFTI_datatype=64 (FLOAT64) in file /export/home/vferrer/public/PARK_VFERRER/TEMPLATES_ATLAS/MNI152_2009_template_FSL.nii.gz to FLOAT32
Warnings of this type will be muted for this session.
Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
#++ Aligning /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/base.nii data to /bcbl/home/public/PARK_VFERRER/PREPROC/sub-029ParkEglPb/anat/awpy/anat.un.nii data #Script is running (command trimmed):
3dWarp -matvec_out2in extra.1D -prefix ./anat.un.aff.nii ./anat.un.nii
++ 3dWarp: AFNI version=AFNI_18.2.06 (Jul 31 2018) [64-bit]
++ Authored by: RW Cox
** FATAL ERROR: Can’t read -matvec file extra.1D
** Program compile date = Jul 31 2018
#**ERROR Failed in affine step
** ERROR - script failed
I have checked and the extra.1D file looks like this with cat_vect:
0.960819 0.0413537 -0.101087 -1.88474
0.0722554 0.78104 0.443372 -19.1824
0.0627243 -0.520414 0.699751 -16.6196
I have not done what you are doing, but it seems unsafe to
rely on the script deleting or overwriting old results. To be
sure, delete the anat/awpy directory and run it again.
Also, it is worth noting how well the source and base datasets
overlap before registration begins. If they barely touch each
other, one of them probably does not have correct coordinate
information. Use @Align_Centers to shift the source to match
the base before beginning.
Hi I have tried what you say and it doesn’t work, after applying @Align_centers the auto_warp.py stops in the affine registration: @Align_Centers -overwrite -base ${TEMPLATEDIR}/${TEMPLATE} -dset ${SUBJ}_T1_ns_bc.nii.gz -prefix prueba.nii.gz -1Dmat_only
++ 3dcopy: AFNI version=AFNI_18.2.16 (Sep 12 2018) [64-bit]
++ 3drefit: AFNI version=AFNI_18.2.16 (Sep 12 2018) [64-bit]
++ Authored by: RW Cox
++ Processing AFNI dataset ./prueba.nii.gz
deoblique
loading and re-writing dataset ./prueba.nii.gz (./prueba.nii.gz in NIFTI storage)
++ 3drefit processed 1 datasets
auto_warp.py -overwrite -base ${TEMPLATEDIR}/${TEMPLATE}‘[0]’ -input prueba.nii.gz -skull_strip_input no
#++ auto_warp.py version: 0.04
Warping used up maximum iterations
even after doubling number of iterations to 274.
Convergence might not have been reached.
If you find the alignment poor, try
rerunning the script with a transform
type of fewer parameters (-xform) or by using
an even higher number of iterations (-maxite).
You can also choose to continue with the
current result (dset: __ats_tmp__reg_warpdriveout+orig
by using the option: -OK_maxite
Script will stop …
#**ERROR Failed in affine step
** ERROR - script failed
I have checked and the images are touching each other after the Align_centers (obviusly) and if you notice, this was already incorporated in the auto_warp.py pipeline. Is there any alternative i can use in this subject for the wrapping?. Thanks in adavance,
For affine alignment to fail, there is probably something peculiar
about the data. Would it be possible to upload those 2 datasets
(both the base and input)?
Why does the base have ‘flip’ in the name? What sort of flip
operation was applied?
If you are able to do that, I will send you a PM (private message)
with instructions.
auto_warp.py, with builds after this posting, will have the option “-at_opts” to pass options on to @auto_tlrc. In this case, consider “-OK_maxite -maxite 50”.
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.