Differences between revisions 5 and 6
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
This wiki page describes how to compute the difference map of cortical thickness from two repeated scans of 
the same subject, and how to compute the overall statistics from a group of such repeated scans. This 
= Thickness reproducibility =

''Author: Xiao Han (see also: XiaoNotes)''

This wik
i page describes how to compute the difference map of cortical thickness from two repeated scans of
the same subject, and how to compute the overall statistics from a group of such repeated scans. This
Line 5: Line 9:
In the following, we assume that each subject has two repeated scans, for example, 1001 and 1001a are two scans for the first subject.
We also assume that recon-all has been completed for all the data. The thickness reliability study will consist of
the following 4 steps.
In the following, we assume that each subject has two repeated scans, for example, 1001 and 1001a are two scans for the first subject. We also assume that recon-all has been completed for all the data. The thickness reliability study will consist of the following 4 steps.
Line 9: Line 11:
Step 1. Compute the linear alignment between the two repeated scans of each subject. Taking 1001 and 1001a as an example, we use FLIRT for the linear registration, and the command line is:

  "
fsl_rigid_register -i $SUBJECTS_DIR/1001/mri/orig.mgz -r $SUBJECTS_DIR/1001a/mri/orig.mgz -o $SUBJECTS_DIR/1001a/mri/orig_o_to_a.mgz -dof 9 -cost corratio -ltamat $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta".
=== Step 1. Compute the linear alignment between the two repeated scans of each subject.===
Taking 1001 and 1001a as an example, we use FLIRT for the linear registration, and the command line is:
{{{
fsl_rigid_register -i $SUBJECTS_DIR/1001/mri/orig.mgz \
  
-r $SUBJECTS_DIR/1001a/mri/orig.mgz \
  
-o $SUBJECTS_DIR/1001a/mri/orig_o_to_a.mgz \
  
-dof 9 -cost corratio \
 
-ltamat $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta
}}}
Line 15: Line 23:
Step 2. Compute the thickness difference map for each subject. Taking again 1001 as an example, the command line is

  "
mris_thickness_diff -xform $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta -src_type curv -trg_type curv -out $SUBJECTS_DIR/1001/surf/lh.thickness_diff.w -nsmooth 0 -abs -S 1001 -L $SUBJECTS_DIR/1001/surf/lh_thickness_diff.log $SUBJECTS_DIR/1001/surf/lh.white $SUBJECTS_DIR/1001/surf/lh.thickness $SUBJECTS_DIR/1001a/surf/lh.white $SUBJECTS_DIR/1001a/surf/lh.thickness".
=== Step 2. Compute the thickness difference map for each subject.===
Taking again 1001 as an example, the command line is:
{{{
mris_thickness_diff -xform $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta \
 
-src_type curv \
  
-trg_type curv \
  
-out $SUBJECTS_DIR/1001/surf/lh.thickness_diff.w \
  -nsmooth 0 \
 
-abs -S 1001 \
  
-L $SUBJECTS_DIR/1001/surf/lh_thickness_diff.log \
  
$SUBJECTS_DIR/1001/surf/lh.white \
  $SUBJECTS_DIR/1001/surf/lh.thickness \
 
$SUBJECTS_DIR/1001a/surf/lh.white \
  $SUBJECTS_DIR/1001a/surf/lh.thickness
}}}
Line 21: Line 40:
Many options are optional.  Many options are optional.
Line 25: Line 44:
"-src_type" and "trg_type" specify the input and output surface data type.  "-src_type" and "trg_type" specify the input and output surface data type.
Line 29: Line 48:
"-nsmooth" specifies the number of smoothing steps applied to the original thickness maps before their point-wise differences are computed. If not specified, default will be zero.  "-nsmooth" specifies the number of smoothing steps applied to the original thickness maps before their point-wise differences are computed. If not specified, default will be zero.
Line 35: Line 54:
The last four arguments are the two surfaces and the two thickness maps.  The last four arguments are the two surfaces and the two thickness maps.
Line 38: Line 57:
The above two steps complete the thickness difference computation for an individual subject, and the output difference map
indicates the relative error in the thickness measurement along the cortical surface of the individual subject.
The above two steps complete the thickness difference computation for an individual subject, and the output difference map indicates the relative error in the thickness measurement along the cortical surface of the individual subject.
Line 41: Line 59:
To compute the group-wise statistics of such thickness error, the thickness difference (or error) maps need be resampled to a common template, and then the error statistics can be computed point-wise along the template surface. This resampling requires a nonlinear alignment across different subjects, which is provided by the spherical registration in FreeSurfer. Different choices of the template is possible. One straightforward option is to simply select one subject from the group as the template.  To compute the group-wise statistics of such thickness error, the thickness difference (or error) maps need be resampled to a common template, and then the error statistics can be computed point-wise along the template surface. This resampling requires a nonlinear alignment across different subjects, which is provided by the spherical registration in FreeSurfer. Different choices of the template is possible. One straightforward option is to simply select one subject from the group as the template.
Line 43: Line 61:
In the following, we assume the subject 1001 is chosen as the template. The group analysis requires the next two steps.    Step 3. Resample the thickness difference map for each subject to the common template. Taking subject 1002 as an example, and the command line is In the following, we assume the subject 1001 is chosen as the template. The group analysis requires the next two steps.
Line 47: Line 63:
  "mri_surf2surf --srcsubject 1002 --sval $SUBJECTS_DIR/1002/surf/lh.thickness_diff.w --src_type curv --trgsubject 1001 --tval $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w --trg_type paint --hemi lh --surfreg sphere.reg".
The output is the resampled difference map $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w. 
=== Step 3. Resample the thickness difference map for each subject to the common template.===
Taking subject
1002 as an example, and the command line is:
{{{
mri_surf2surf --srcsubject 1002 \
 
--sval $SUBJECTS_DIR/1002/surf/lh.thickness_diff.w \
  
--src_type curv \
 
--trgsubject 1001 \
 
--tval $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w \
  
--trg_type paint \
  --hemi lh \
  --surfreg sphere.reg
}}}

The output is the resampled difference map $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w.
Line 52: Line 79:
Step 4. Assuming all the thickness difference maps are resampled to the same template (surface), we can now compute the group-wise mean and std of the thickness differences at every vertex of the template surface. The command is: === Step 4. Assuming all the thickness difference maps are resampled to the same template (surface)===
, we can now compute the group-wise mean and std of the thickness differences at every vertex of the template surface. The command is:
{{{
mris_surface_stats -mask some_mask.label \
  -nsmooth $N \
  -surf_name $SUBJECTS_DIR/1001/surf/${hemi}.white \
  -src_type paint \
  -out_name $SUBJECTS_DIR/groupstudy/${hemi}_std_${N}.w \
  -absmean $SUBJECTS_DIR/groupstudy/${hemi}_absmean_${N}.w \
  -mean $SUBJECTS_DIR/groupstudy/${hemi}_mean_${N}.w \
  -absstd $SUBJECTS_DIR/groupstudy/${hemi}_absstd_${N}.w \
  $SUBJECTS_DIR/groupstudy/1???_${hemi}_thickness_diff_resampled_to_1001.w
}}}
Line 54: Line 93:
  "mris_surface_stats -mask some_mask.label -nsmooth $N -surf_name $SUBJECTS_DIR/1001/surf/${hemi}.white -src_type paint
-out_name $SUBJECTS_DIR/groupstudy/${hemi}_std_${N}.w -absmean $SUBJECTS_DIR/groupstudy/${hemi}_absmean_${N}.w
-mean $SUBJECTS_DIR/groupstudy/${hemi}_mean_${N}.w -absstd $SUBJECTS_DIR/groupstudy/${hemi}_absstd_${N}.w $SUBJECTS_DIR/groupstudy/1???_${hemi}_thickness_diff_resampled_to_1001.w"

This command computes the mean and std of both the signed and unsigned thickness differences and outputs the results to
This command computes the mean and std of both the signed and unsigned thickness differences and outputs the results to
Line 72: Line 107:
"-absmean" stores the absolute average map of the input thickness difference maps.  "-absmean" stores the absolute average map of the input thickness difference maps.
Line 80: Line 115:

     

Thickness reproducibility

Author: Xiao Han (see also: XiaoNotes)

This wiki page describes how to compute the difference map of cortical thickness from two repeated scans of the same subject, and how to compute the overall statistics from a group of such repeated scans. This computation is needed in validation studies of cortical thickness measurement using FreeSurfer.

In the following, we assume that each subject has two repeated scans, for example, 1001 and 1001a are two scans for the first subject. We also assume that recon-all has been completed for all the data. The thickness reliability study will consist of the following 4 steps.

=== Step 1. Compute the linear alignment between the two repeated scans of each subject.=== Taking 1001 and 1001a as an example, we use FLIRT for the linear registration, and the command line is:

fsl_rigid_register -i $SUBJECTS_DIR/1001/mri/orig.mgz \
  -r $SUBJECTS_DIR/1001a/mri/orig.mgz \
  -o $SUBJECTS_DIR/1001a/mri/orig_o_to_a.mgz \
  -dof 9 -cost corratio \
  -ltamat $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta

"1001_to_1001a.lta" is the output registration file that will be used later. The output $SUBJECTS_DIR/1001a/mri/orig_o_to_a.mgz can be used to check the registration accuracy.

=== Step 2. Compute the thickness difference map for each subject.=== Taking again 1001 as an example, the command line is:

mris_thickness_diff -xform $SUBJECTS_DIR/1001/mri/transforms/1001_to_1001a.lta \
  -src_type curv \
  -trg_type curv \
  -out $SUBJECTS_DIR/1001/surf/lh.thickness_diff.w \
  -nsmooth 0 \
  -abs -S 1001 \
  -L $SUBJECTS_DIR/1001/surf/lh_thickness_diff.log \
  $SUBJECTS_DIR/1001/surf/lh.white \
  $SUBJECTS_DIR/1001/surf/lh.thickness \
  $SUBJECTS_DIR/1001a/surf/lh.white \
  $SUBJECTS_DIR/1001a/surf/lh.thickness

The above command need be run for the right hemisphere (rh) as well.

Many options are optional.

"-xform" specifies the registration file to be applied to align the first surface to the second. If not specified, an identity transformation is assumed.

"-src_type" and "trg_type" specify the input and output surface data type.

"-out" specifies the filename for the output thickness difference map.

"-nsmooth" specifies the number of smoothing steps applied to the original thickness maps before their point-wise differences are computed. If not specified, default will be zero.

"-abs" tells the program to compute the overall standard deviation of the absolute thickness differences; if not used, the std of the signed differences is computed.

"-L" denotes the logfile, where the following info are recorded "subject-name, surface vertex number, overall mean thickness difference, overall mean absolute thickness difference, std of (signed or unsigned) thickness differences"

The last four arguments are the two surfaces and the two thickness maps. Note that the computed thickness difference map is sampled on the first surface, $SUBJECTS_DIR/1001/surf/lh.white in this case. This means the number of entries in the output curvature file matches the number of vertices of the first surface.

The above two steps complete the thickness difference computation for an individual subject, and the output difference map indicates the relative error in the thickness measurement along the cortical surface of the individual subject.

To compute the group-wise statistics of such thickness error, the thickness difference (or error) maps need be resampled to a common template, and then the error statistics can be computed point-wise along the template surface. This resampling requires a nonlinear alignment across different subjects, which is provided by the spherical registration in FreeSurfer. Different choices of the template is possible. One straightforward option is to simply select one subject from the group as the template.

In the following, we assume the subject 1001 is chosen as the template. The group analysis requires the next two steps.

=== Step 3. Resample the thickness difference map for each subject to the common template.=== Taking subject 1002 as an example, and the command line is:

mri_surf2surf --srcsubject 1002 \
  --sval $SUBJECTS_DIR/1002/surf/lh.thickness_diff.w \
  --src_type curv \
  --trgsubject 1001 \
  --tval $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w \
  --trg_type paint \
  --hemi lh \
  --surfreg sphere.reg

The output is the resampled difference map $SUBJECTS_DIR/groupstudy/1002_lh_thicknes_diff_resampled_to_1001.w. The program "mri_surf2surf" doesn't allow the output to be saved in "curv" format, which should be changed in the future. The same computation can be done for the right-hemisphere (rh) as well.

=== Step 4. Assuming all the thickness difference maps are resampled to the same template (surface)=== , we can now compute the group-wise mean and std of the thickness differences at every vertex of the template surface. The command is:

mris_surface_stats -mask some_mask.label \
  -nsmooth $N \
  -surf_name $SUBJECTS_DIR/1001/surf/${hemi}.white \
  -src_type paint \
  -out_name $SUBJECTS_DIR/groupstudy/${hemi}_std_${N}.w \
  -absmean $SUBJECTS_DIR/groupstudy/${hemi}_absmean_${N}.w \
  -mean $SUBJECTS_DIR/groupstudy/${hemi}_mean_${N}.w \
  -absstd $SUBJECTS_DIR/groupstudy/${hemi}_absstd_${N}.w \
  $SUBJECTS_DIR/groupstudy/1???_${hemi}_thickness_diff_resampled_to_1001.w

This command computes the mean and std of both the signed and unsigned thickness differences and outputs the results to different files as specified by the different options. The user can define the hemisphere "${hemi}$", and the number of smoothing iterations "$N" applied to the input difference maps. The other options are:

"-mask" specifies a surface mask, where vertices within the mask will be excluded in all the computation (smoothing and statistics). If not specified, all vertices are used.

"-nsmooth" specifies the number of smoothing iterations before statistics are computed; N=60 roughly corresponds to a surface based Gaussian kernel of size 6mm. If not specified, no smoothing is performed.

"-surf_name" is the template surface (can be any surface of the template subject). This option is required.

"-src_type" means the same as in mri_surf2surf or mris_thickness_diff;

"-out_name" stores the standard deviation map of the input thickness difference maps. This option is required.

"-absmean" stores the absolute average map of the input thickness difference maps.

"-mean" stores the average map of the input thickness difference maps;

"-absstd" stores the standard deviation map of the absolute differences.

The statistical maps can be displayed on the template subject's surfaces, which can be used to visualize the spatially varying pattern of the thickness measurement variability.

ThicknessRepeatibility (last edited 2011-01-03 19:11:37 by MartinReuter)