Dear Paul,
I would recommend using the midtrans solution for two reasons:
1 - It is guaranteed to give you an exact midpoint transformation whereas avscale only ever created an approximate one
2 - The code you use for avscale in the first example actually relies on flirt being inverse consistent in order to get a precise alignment between the two images in the midspace, whereas flirt is not guaranteed to be inverse consistent and so it is likely to be slightly inaccurate.
The examples you use for midtrans look correct to me, but always double-check by looking at your results!
There is no better check than that.
All the best,
Mark
On 12 Feb 2013, at 02:22, Paul Chou <[log in to unmask]> wrote:
> Dear all
>
> Sorry to repost this question again, because i try to figure out how to perform half-way space registration correctly, hope some of you could give me a hand to figure out the correct analysis procedure. Thanks.
>
> ==============================================================================
>
> Dear all FSL experts
>
> I have some questions about how to perform 2 and 3+ time points half-way space registration, hope you could help me to figure out how to run this kind of analysis correctly in FSL v5.0.2. The questions were listed as follows:
>
> 1. For 2 time-points dataset: After searching the related informations in FSL archives, i found Saad provided the script for analyzing 2 time-points dataset using half-way space registration approach. If i understand the script correctly, the following demo script will produce the half space template for subject SB_002, am I correct ? (T1 stands for Time-point-1 and T2 stands for Time-point-2 )
>
> flirt -in T1_SB_002.nii.gz -ref T2_SB_002.nii.gz -omat Time1_to_Time2.mat
> avscale --allparams Time1_to_Time2.mat | grep -A 4 "Forward half transform" | tail -n 4 > Half_Way_T1.mat
> flirt -in T2_SB_002.nii.gz -ref T1_SB_002.nii.gz -omat Time2_to_Time1.mat
> avscale --allparams Time2_to_Time1.mat | grep -A 4 "Forward half transform" | tail -n 4 > Half_Way_T2.mat
> flirt -in T1_SB_002.nii.gz -ref T2_SB_002.nii.gz -applyxfm -init Half_Way_T1.mat -o T1_SB_002_Half_Way.nii.gz -interp spline
> flirt -in T2_SB_002.nii.gz -ref T1_SB_002.nii.gz -applyxfm -init Half_Way_T2.mat -o T2_SB_002_Half_Way.nii.gz -interp spline
> fslmaths T1_SB_002_Half_Way.nii.gz -add T2_SB_002_Half_Way.nii.gz -div 2 Half_Way_Space_Template_SB_002.nii.gz
>
> 2. For 3 time-points dataset: After searching the related information in FSL archives, some experts recommend to use "midtrans" for such kind of analysis (also including 2 time-points dataset). I have tried to use this command line tool, but have some further questions about this function:
>
> A. For two time-points dataset, i tried to use the following demo script to produce half-way space template for SB_002 (like previous question 1), is this demo code correct for producing the half way space template for SB_002 ?
>
> flirt -in T2_SB_002.nii.gz -ref T1_SB_002.nii.gz -omat Time2_to_Time1.mat
> midtrans --separate=Test -o Time1_to_Mid.mat Time2_to_Time1.mat ident.mat
> flirt -in T1_SB_002.nii.gz -ref T2_SB_002.nii.gz -applyxfm -init Test0002.mat [or Time1_to_Mid.mat (i found the Test0002.mat is the same with Time1_to_Mid.mat)] -o T1_SB_002_Half_Way.nii.gz -interp spline
> flirt -in T2_SB_002.nii.gz -ref T1_SB_002.nii.gz -applyxfm -init Test0001.mat -o T2_SB_002_Half_Way.nii.gz -interp spline
> fslmaths T1_SB_002_Half_Way.nii.gz -add T2_SB_002_Half_Way.nii.gz -div 2 Half_Way_Space_Template_SB_002.nii.gz
>
> After running the above demo script, i found the mat files for Halfway-space registration are different from two methods. I think the major difference between the these two approaches is saad's script consider the flirt isn't a inverse consistent registration algorithm, am I correct ?
>
> B. If i want to extend the previous demo script to 3+ time-points dataset, could i simply change the script like follows ?
> flirt -in T2_SB_002.nii.gz -ref T1_SB_002.nii.gz -omat Time2_to_Time1.mat
> flirt -in T3_SB_002.nii.gz -ref T1_SB_002.nii.gz -omat Time3_to_Time1.mat
> midtrans --separate=Test -o Time1_to_Mid.mat Time2_to_Time1.mat Time3_to_Time1.mat ident.mat
>
> Hope hear some feedbacks and shed me some lights for performing longitudinal analysis
>
> Best
>
> Paul
|