Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 27: Line 27:
 
Line 43: Line 43:
 
Line 53: Line 53:
be dir/hemi.name.lable, where name is the corresponding name in  be dir/hemi.name.lable, where name is the corresponding name in
Line 66: Line 66:
the human readable names are in the file given as the argument to  the human readable names are in the file given as the argument to
Line 68: Line 68:
the annotation file, and it must be supplied to mri_annotation2label  the annotation file, and it must be supplied to mri_annotation2label
Line 73: Line 73:
 mri_annotation2label --subject LW --hemi rh 
        --labelbase ./labels/aparc-rh 
        --table $FREESURFER_HOME/Simple_surface_labels2002.txt 
 mri_annotation2label --subject LW --hemi rh
        --labelbase ./labels/aparc-rh
        --table $FREESURFER_HOME/Simple_surface_labels2005.txt
Line 78: Line 78:
  and then create about 94 label files: aparc-rh-001.label,    and then create about 94 label files: aparc-rh-001.label,
Line 83: Line 83:
mri_annotation2label --subject LW --hemi rh 
        --outdir ./labels 
        --table $FREESURFER_HOME/Simple_surface_labels2002.txt 
mri_annotation2label --subject LW --hemi rh
        --outdir ./labels
        --table $FREESURFER_HOME/Simple_surface_labels2005.txt
Line 93: Line 93:
If the name of the label base does not include a forward slash (ie, '/') 
  then the program will attempt to put the label files in 
  $SUBJECTS_DIR/subject/label. So, if you want the labels to go into the 
If the name of the label base does not include a forward slash (ie, '/')
  then the program will attempt to put the label files in
  $SUBJECTS_DIR/subject/label. So, if you want the labels to go into the
Line 99: Line 99:
 1. Start tksurfer:    1. Start tksurfer:
Line 106: Line 106:
   
Line 116: Line 116:
      [Goto the point saved from step 1]        [Goto the point saved from step 1]
Line 134: Line 134:

Describe mri_annotation2label here.

Index TableOfContents

Name

mri_annotation2label - Converts annotation into label files

Synopsis

Arguments

Positional Arguments

Required Flagged Arguments

--srcreg

srcreg.dat

--targreg

targreg.dat

Optional Flagged Arguments

--targsubj subjid

default is talairach

--xfm xfmrname

xfm file name relative to transforms

--sd subjects_dir

default is env SUBJECTS_DIR

--fvol funcvol

path to example functional volume

--help

--version

Outputs

Positional Arguments

Required Flagged Arguments

--srcreg

srcreg.dat

--targreg

targreg.dat

Optional Flagged Arguments

--targsubj subjid

default is talairach

--xfm xfmrname

xfm file name relative to transforms

--sd subjects_dir

default is env SUBJECTS_DIR

--fvol funcvol

path to example functional volume

--help

--version

Outputs

Description

This program will convert an annotation into multiple label files. User specifies the subject, hemisphere, label base, and (optionally) the annotation base and surface. By default, the annotation base is aparc. The program will retrieves the annotations from SUBJECTS_DIR/subject/label/hemi_annotbase.annot. A separate label file is created for each annotation index. The output file names can take one of two forms: (1) If --outdir dir is used, then the output will be dir/hemi.name.lable, where name is the corresponding name in the table. (2) If --labelbase is used, name of the file conforms to labelbase-XXX.label, where XXX is the zero-padded 3 digit annotation index. If labelbase includes a directory path, that directory must already exist. If there are no points in the annotation file for a particular index, no label file is created. The xyz coordinates in the label file are obtained from the values at that vertex of the specified surface. The default surface is 'white'. Other options include 'pial' and 'orig'. BR

The human-readable names that correspond to the annotation indices for aparc depend upon how the annotations were created. They are created with the program mris_ca_label, and the human readable names are in the file given as the argument to the -t flag. Unfortunately, this information is not maintained inside the annotation file, and it must be supplied to mri_annotation2label through the --table flag.

Examples

Example 1

  • mri_annotation2label --subject LW --hemi rh
    • --labelbase ./labels/aparc-rh --table $FREESURFER_HOME/Simple_surface_labels2005.txt
    • This will get annotations from $SUBJECTS_DIR/LW/label/rh_aparc.annot and then create about 94 label files: aparc-rh-001.label, aparc-rh-002.label, ... Note that the directory 'labels' must already exist.

Example 2

mri_annotation2label --subject LW --hemi rh

  • --outdir ./labels --table $FREESURFER_HOME/Simple_surface_labels2005.txt
  • This will do the same thing as above except that the output files will have names of the form lh.S_occipital_anterior.label

description

Bugs

If the name of the label base does not include a forward slash (ie, '/')

  • then the program will attempt to put the label files in $SUBJECTS_DIR/subject/label. So, if you want the labels to go into the current directory, make sure to put a './' in front of the label base.

Testing

  1. Start tksurfer:
    • tksurfer -LW lh inflated read_annotations lh_aparc
    • When a point is clicked on, it prints out a lot of info, including something like:
      • annot = S_temporalis_sup (93, 3988701) (221, 220, 60)
      This indicates that annotion number 93 was hit. Save this point.
    1. Start another tksurfer and load the label:
      • tksurfer -LW lh inflated [edit label field and hit the 'Read' button]
      • Verify that label pattern looks like the annotation as seen in the tksurfer window from step 1.
    2. Load label into tkmedit
      • tkmedit LW T1 [Load the label]
      • [Goto the point saved from step 1]

See Also

Links

FreeSurfer, FsFast

Methods Description

References

Reporting Bugs

Report bugs to <analysis-bugs@nmr.mgh.harvard.edu>

Author/s

mri_annotation2label (last edited 2017-12-04 12:27:47 by MorganFogarty)