Registration independent of ASHS

174 views
Skip to first unread message

KA K

unread,
Mar 8, 2018, 1:58:11 PM3/8/18
to ashs-users

Hello,

I am using ASHS-1.0.0 with the "ashs_atlas_umcutrecht_7t_20170810" atlas. In my data, I have found that the most common culprit for failures is incorrect registration. I read a previous thread in the ashs-users group that suggested dealing with registration failures by running ANTS or FSL independently and then using the -N flag to skip the ASHS registration step.

I decided to give this a try. I used flirt for the T1 to T2 registration and named the files to be compatible with ASHS. I used ANTS for the template registration. I named the files to be analogous to the files ASHS is looking for, but unfortunately ASHS crashes directly after skipping the registrations:

____
+ greedy -d 3 -rm /mnt/autofs/netRAID18/7T/study610/ASHS_inv1/mprage.nii.gz /mnt/autofs/netRAID18/7T/study610/ASHS_inv1/ants_t1_to_temp/reslice_mprage_to_template.nii.gz -rf /mnt/autofs/netTools/ashs-1.0.0/ashs_atlas_umcutrecht_7t_20170810/template/template.nii.gz -r /mnt/autofs/netRAID18/7T/study610/ASHS_inv1/ants_t1_to_temp/greedy_t1_to_template_warp.nii.gz /mnt/autofs/netRAID18/7T/study610/ASHS_inv1/affine_t1_to_template/t1_to_template_affine.mat
Executing with the default number of threads: 24
/mnt/autofs/netTools/ashs-1.0.0/bin/ashs_template_qsub.sh: line 133: 28622 Segmentation fault      (core dumped) greedy -d 3 -rm $SUBJ_MPRAGE $WANT/reslice_mprage_to_template.nii.gz -rf $TEMP_T1_FULL -r $SUBJ_T1TEMP_WARP $SUBJ_AFF_T1TEMP_MAT

**************** !! ERROR !! *******************
Validity check at end of stage 1 detected
missing files.
(affine_t1_to_template/t1_to_template_affine_inv
.mat and 8 other files).
************************************************
____
 
When looking for potential causes, I noted that the affine transformation matrices that result when I run ASHS are in a different format than those output by ANTS.
Example of "t1_to_template_affine.mat" from ASHS:
0.961881 -0.0535103 -0.0391387 7.12039
0.0458272 1.1494 -0.189443 20.3251
0.031407 0.0164409 1.07787 -69.0945
0 0 0 1

Example of analogous output from ANTS:
#Insight Transform File V1.0
#Transform 0
Transform: MatrixOffsetTransformBase_double_3_3
Parameters: 0.913073 0.125598 0.0180961 -0.0983246 0.887079 -0.00698438 -0.0491411 -0.0280106 0.852064 -1.09167 -71.1605 -60.699
FixedParameters: 5.35678 22.4021 15.5758

Do you have any insight as to how to convert the ANTS affine transformation output so that it is comparable to matrix used by ASHS? Or is there some other way to deal with this issue?

I think the only other part I am missing is the inverted affine transformation matrix, which is not output by ANTS. I assume once I have the affine matrix in proper form I can just use c3d_affine_tool to create the inverted matrix in the same manner as with the greedy output?

Thank you very much for any help you can give.


Katherine Koenig
Imaging Sciences
The Cleveland Clinic

Paul Yushkevich

unread,
Mar 9, 2018, 10:03:25 AM3/9/18
to KA K, ashs-users
Hi Katherine,

To convert the transformations from ANTS to the format ASHS is using, use the c3d_affine_tool command, which you will find in the /ext/Linux/bin folder in ASHS:

c3d_affine_tool -itk input.ants.file -o output.mat

I would also just look at the commands that are executed in the ASHS scripts for template registration. In addition to doing the registration, there are commands to resample images into the template image space. Just look in ashs_main.sh and follow the calls to other scripts. 

Best,
Paul

KA K

unread,
Mar 16, 2018, 4:20:47 PM3/16/18
to ashs-users
Thanks Paul! The c3d_affine_tool conversion works like a charm. I am getting really great results on those difficult cases. In case it is of interest, our lab previously spent some time optimizing the parameters we use in ANTS. The command I am running for the difficult cases is:

 ANTS 3  -i 100x100x100x20   -t SyN[0.25] -r Gauss[3,0]   -m CC[/path/template.nii.gz,mprage.nii.gz,1,4]  -o ants_t1_to_temp/ants_t1_to_temp.nii -a affine_t1_to_template/antsaffineonlyAffine.txt

Thanks again for the help.

Katherine
Reply all
Reply to author
Forward
0 new messages