Differences between revisions 4 and 12 (spanning 8 versions)
Revision 4 as of 2006-02-09 18:36:48
Size: 6194
Editor: brainiac
Comment:
Revision 12 as of 2006-06-19 12:01:57
Size: 7303
Editor: RahulDesikan
Comment:
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 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 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 example, we use FLIRT for the linear registration, and the command line is: === 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 11: Line 21:
  "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.
Line 13: Line 23:
"1001_to_1001a.lta" is the output registration file that will be used later. === 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.
Line 15: Line 40:
Step 2. Compute the thickness difference map for each subject. Taking again 1001 as an example, the command line is Many options are optional.
Line 17: Line 42:
  "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".  "-xform" specifies the registration file to be applied to align the first surface to the second. If not specified, an identity transformation is assumed.
Line 19: Line 44:
The above need be run for the right hemisphere (rh) as well.  "-src_type" and "trg_type" specify the input and output surface data type.
Line 21: Line 46:
Many options are optional.  "-out" specifies the filename for the output thickness difference map.
Line 23: Line 48:
"-xform" specifies the registration file to be applied to align the first surface to the second.  "-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 25: Line 50:
"-src_type" and "trg_type" specify the input and output surface data type.  "-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.
Line 27: Line 52:
"-out" specifies the output thickness difference map filename.  "-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"
Line 29: Line 54:
"-nsmooth" specifies the number of smoothing steps applied to the original thickness maps before their point-wise differences are computed. 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.
Line 31: Line 57:
"-abs" tells the program to compute the overall standard deviation of the absolute thickness differences; without it, the std of the signed differences is computed. 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 33: Line 59:
"-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 matches the number of vertices of that surface.
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 re sampling 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 37: Line 61:
The above two steps complete the thickness difference measurement for an individual subject, and the output difference map
indicates the relative error in thickness measurement along the cortical surface of the subject.
In the following, we assume the subject 1001 is chosen as the template. The group analysis requires the next two steps.
Line 40: Line 63:
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 statistics can be computed along the template surface. This resampling requires a nonlinear alignment across different subjects, which
is provided by the spherical registration results. Difference choices of the template is possible. One straightforward option is to simply select
one subject as the template. In the following, we assume the subject 1001 is chosen as the template.
 
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.
=== 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 62: Line 97:
"-mask" specifies a surface mask, where vertices within the mask will be excluded in all the computation (smoothing and statistics);  "-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.
Line 64: Line 99:
"-nsmooth" specifies the number of smoothing iterations before statistics are computed; N=60 roughly corresponds to a surface based Gaussian kernel of size 6mm;  "-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.
Line 66: Line 101:
"-surf_name" is the template surface (can be any surface of the template subject);  "-surf_name" is the template surface (can be any surface of the template subject). This option is required.
Line 68: Line 103:
"-src_type" means the same as in mri_surf2surf or mris_thickness_diff;  "-src_type" means the same as in mri_surf2surf or mris_thickness_diff;
Line 70: Line 105:
"-out_name" stores the standard deviation map of the input thickness difference maps;  "-out_name" stores the standard deviation map of the input thickness difference maps. This option is required.
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 74: Line 109:
"-mean" stores the average map of the input thickness difference maps;  "-mean" stores the average map of the input thickness difference maps;
Line 76: Line 111:
"-absstd" stores the standard deviation map of the absolute differences.  "-absstd" stores the standard deviation map of the absolute differences.

 "1???_${hemi}_thickness_diff_resampled_to_1001.w" refers to the list of.w files created in Step3 that are to be
  used as input for this step. If those files are stored under the same directory, you can indeed use
  "1???_lh_thickness_diff_resampled.w" instead of listing each individual file explicitly, or
  "1*_lh_thickness_diff_resampled.w".
Line 80: Line 120:

     

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 re sampling 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. "1???_${hemi}_thickness_diff_resampled_to_1001.w" refers to the list of.w files created in Step3 that are to be
    • used as input for this step. If those files are stored under the same directory, you can indeed use "1???_lh_thickness_diff_resampled.w" instead of listing each individual file explicitly, or "1*_lh_thickness_diff_resampled.w".

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)