[[FsTutorial|top]] | [[FsTutorial/Tools|previous]]
== Reference ==
=== 1.0 Mouse commands ===
|||||||||| '''Mouse Controls for Tools''' ||
|| || Key Shortcut || Button 1 || Button 2 || Button 3 ||
|| Navigation Tool || n || Clicking and dragging pans the view across the current slice. No effect when the zoom level is 1. || Clicking once in the top half of the window increases the slice by 1, clicking in the bottom decreases the slice. Dragging up increases the slice, dragging down decreases it. ||Clicking once in the top half of the window zooms in, clicking in the bottom zooms out. Dragging up zooms in continuously, dragging down zooms out. ||
|| Select Voxel Tool || s || Clicking sets the cursor.|| Clicking adds a voxel to the selection. Sets the cursor when the button is released. Shift+click performs a flood select.||Clicking removes a voxel from the selection. Sets the cursor when the button is released.Shift+click performs a flood deselect.||
|| Edit Voxel Tool || a || Clicking sets the cursor.||Clicking edits a voxel with the Button 2 settings. Shift+click undoes a undoable voxel region. Sets the cursor when the button is released.||Clicking edits a voxel with the Button 3 settings.||
|| Edit Segmentation Tool || g ||Clicking sets the cursor. If the ROI Volume Count display option is on, displays the ROI volume in the Tools Window.|| Clicking paints a segmentation voxel. Shift+click performs a flood fill. Shift+Ctrl+click sets the color to the color of the voxel clicked. Sets the cursor when the button is released.|| Clicking erases a segmentation voxel (sets to label 0). Sets the cursor when the button is released. Shift+click performs a flood erase.||
|| Edit Control Points Tool || c || Clicking sets the cursor. || Clicking makes a new control point. Sets the cursor when the button is released.|| Clicking removes nearest control point. Sets the cursor when the button is released.||
|| || '''Mouse Controls for Zooming''' ||
|| Control+Button 1: || Zoom in, doubling the zoom level||
|| Control+Button 2: || When zoomed in, sets the cursor and re-centers the view around the new cursor without changing the zoom level. ||
|| Control+Button 3: || Zoom out, halving the zoom level||
=== 2.0 Menus ===
'''2.1 File''' <
>
|| Load Main Volume...||Loads the Main volume from a directory of COR- files.||
||Load Aux Volume...||Loads the Auxiliary volume from a directory of COR- files.||
||Import Main Volume from File...||Reads a specified file as the Main volume.||
||Import Aux Volume from File...||Reads a specified file as the Aux volume.||
||Load Transform for Main Volume...||Loads an LTA or XFM file to use as the display transform for the Main volume.||
||Load Transform for Aux Volume...||Loads an LTA or XFM file to use as the display transform for the Aux volume.||
||Unload Transform for Main Volume||Removes the display transform for the Main volume.||
||Unload Transform for Aux Volume||Removes the display transform for the Main volume.||
||Save Main Volume||Saves the Main volume in its original COR- file directory.||
||Save Main Volume As...||Saves the Main volume in a new directory.||
||Load Main Surface...||Loads a surface overlay (e.g. orig.?h, white.?h, pial.?h), looking for other configurations and loading them available.||
||Load Surface Configuration||Loads an alternate (Original or Pial) surface configuration.||
||Unload Surface||Removes the surface and all configurations.||
||Load Overlay Data...||Reads in coregistered functional data for in-plane overlay.||
||Load Time Course Data...||Loads in coregistered functional data for graphing over multiple time points.||
||Save Overlay Registration||If registration has been enabled, this will save the registration to the register.dat file.||
||Load Segmentation...||Loads a segmentation, requiring a COR- file directory and a color lookup table file.||
||Save Segmentation||Saves the segmentation in its original COR- file directory.||
||Save Segmentation As...||Saves the segmentation in a new directory.||
||Load Label...||Reads in a cortical label file as the selection.||
||Save Label As...||Saves the selection as a cortical label file.||
||Load Head Points....||Loads a head points transform file and a list of MEG/EEG sensor points.||
||Save Head Point Transform||Saves an edited head points transform file.||
||Save Head Points||Saves head points.||
||Save Control Points||Saves control points to control.dat file. (Done automatically.)||
||Quit||Exits the program.||
'''2.1.1 Load surface configuration''' <
>
||Original Vertices||Load the Original vertex set for an existing surface||
||Pial Vertices||Load the Pial vertex set for an existing surface||
'''2.1.2 Transforms''' <
>
||Load Transform for Main Volume...||Load a display transform for the Main anatomical volume.||
||Load Transform for Aux Volume...||Load a display transform for the Aux anatomical volume.||
||Unload Transform for Main Volume||Unload a display transform from the Main anatomical volume.||
||Unload Transform for Aux Volume ||Unload a display transform from the Aux anatomical volume.||
'''2.1.3 Label''' <
>
||Load Label...||Load a label file and add it to the current selection.||
||Save Label As... ||Save the current selection as a label file.||
'''2.1.4 GCA''' <
>
||Load GCA||Load GCA volumes.||
||Save GCA||Save GCA volumes.||
||Unload GCA||Unload GCA volumes.||
'''2.1.5 Head points''' <
>
||Load Head Points...||Load a list of head points.||
||Save Head Point Transform||Save a modified head point transform (overwrites existing).||
||Save Head Points||Save list of head points.||
'''2.1.6 DTI''' <
>
||Load DTI Volumes...||Load DTI volumes.||
'''2.1.7 Edit''' <
>
||Undo Last Edit||Undoes the last volume or segmentation edit.||
||Take Snapshot of Volume||Makes a copy of the current Main volume.||
||Restore Volume to Snapshot||Restores the Main volume to the saved copy.||
||Clear Label / Selection||Clears the current selection.||
||Clear Undo Volume||Clears the Undo Volume.||
'''2.2 View''' <
>
||View Configurations||Shows a submenu of view configurations.||
||Tool Bars||Shows a submenu of available toolbars. Check or uncheck the toolbar in this submenu to show or hide the toolbar.||
||Information||Shows a submenu of available information area items such as coordinate labels. Check or uncheck the item in this submenu to show or hide the item.||
||Configure...||Shows a submenu of viewing characteristics that can be configured.||
||Anatomical Volume||Check to display the anatomical volume.||
||Main Volume||Toggle between showing the Main or Aux volume.||
||Aux Volume|| ||
||Maximum Intensity Projection||Check to display the maximum intensity projection of the current volume, or the highest values in the current plane for each voxel.||
||Main Surface||Check to display the Main surface configuration.||
||Original Surface||Check to display the Original surface configuration.||
||Pial Surface||Check to display the Pial surface configuration.||
||Surface Vertices||Check to display the surface vertices on top of the surface overlay.||
||Interpolate Surface Vertices||Check to use interpolation to draw surface vertices. Uncheck to use projection.||
||Functional Overlay||Check to show the functional overlay volume.||
||Functional Scale Color Bar||Check to show the color scale bar for the overlay.||
||Mask to Functional Overlay||Check to mask the anatomical volume to valid functional overlay space.||
||Show Histogram Percent Change||Check to show the window displaying changes in VLI label volumes.||
||Segmentation Overlay||Check to show the segmentation overlay.||
||Segmentation Label Volume Count||Check to count the volume of a label in the segmentation when clicking with the left mouse button when the Edit Segmentation Tool is selected.||
||Selection / Label||Check to show the selection.||
||Head Points||Check to show the head points.||
||Control Points||Check to show the control points.||
||Cursor||Check to show the cursor.||
||Axes||Check to show the coordinate space axes.||
||Undoable Voxels||Check to show the undoable voxels in the Undo Volume.||
'''2.2.1 View configurations''' <
>
||Single View||Displays one pane with a single orientation.||
||Multiple Orientations||Displays four panes, allowing all orientations to be viewed at the same time around the cursor.||
||Mosaic||Displays a 4x4 grid of different slices in the same orientation.||
'''2.2.2 Tool bars''' <
>
||Main||Check to display the Main toolbar, which has the following controls: Tool Selector (Navigation, Select Voxels, Edit Voxels, Edit Segmentation, Edit Control Points), View Configuration (Single, Multiple, Mosaic), Surface Display (Main, Original, Pial), Current Volume (Main, Aux)||
||Navigation||Check to display the Navigation toolbar, which has the following controls: Orientation (Coronal, Horizontal, Sagittal), Slice number, Zoom Out, Zoom In, Zoom Level, Save Point, Go To Saved Point, Linked Cursors||
||Reconstruction||Check to display the Reconstruction toolbar, which has the following controls: Brush shape (Circular, Square), 3D brush, Radius, Make Snapshot , Restore to Snapshot, !TkTimer on||
'''2.2.3 Information''' <
>
||Volume Index Coordinates||Check to show the volume index coordinates (0..255).||
||Volume RAS Coordinates||Check to show the RAS coordinates. The origin is at the center of the volume.||
||Volume Scanner Coordinates||Check to show the scanner coordinates, usually the RAS coordinates.||
||MNI Coordinates||Check to show the MNI Talairach coordinates. This was the old Talairach coordinate system, but has been replaced by a slightly modified version.||
||Talairach Coordinates||Check to show the Talairach coordinates, determined by the talairach.xfm file for a subject. May not be available if this file is missing.||
||Volume Value||Check to show the value of the Main volume voxel.||
||Aux Volume Value||Check to show the value of the Aux volume voxel.||
||Functional Overlay Index Coordinates||Check to show the functional overlay volume index coordinates.||
||Functional Overlay RAS Coordinates||Check to show the functional overlay RAS coordinates. The origin is at the center of the functional volume.||
||Functional Overlay Value||Check to show the value of the functional overlay volume voxel.||
||Segmentation Label||Check to show the name of the ROI in the Main segmentation that the voxel is a part of.||
||Aux Segmentation Label||Check to show the name of the ROI in the Aux segmentation that the voxel is a part of.||
||Head Point Label||Check to show the name of the head point nearest the cursor or mouse.||
||Surface Distance||Check to show the distance from the last cursor location to the present mouse or cursor location. (Used in setting surface distance values.)||
'''2.2.4 Configure...''' <
>
||Brightness / Contrast...||Opens a dialog box in which you can set the brightness and contrast of the Main and Aux volumes.||
||Cursor...||Opens a dialog box in which you can change the color and shape of the cursor.||
||Surface...||Opens a dialog box in which you can change the color and line width of each surface configuration.||
||Functional Overlay...||Opens a dialog box in which you can change various characteristics of the functional overlay.||
||Time Course Graph...||Opens a dialog box in which you can change various characteristics of the time course graph.||
||Segmentation Display...||Opens a dialog box in which you can change the overlay opacity of the segmentation display.||
||DTI Display...||Opens a dialog box in which you can change the overlay opacity of the DTI display.||
'''2.3 Tools''' <
>
||Navigate||Changes the current tool to the Navigation Tool.||
||Select Voxels||Changes the current tool to the Select Voxels Tool.||
||Edit Voxels||Changes the current tool to the Edit Voxels Tool.||
||Edit Segmentation||Changes the current tool to the Edit Segmentation Tool.||
||Edit Control Points||Changes the current tool to the Edit Control Points Tool.||
||Configure Brush Info...||Opens a dialog box in which you can change the size, shape, and depth of the brush.||
||Configure Volume Brush...||Opens a dialog box in which you can change the threshold and color values for the Edit Voxels Tool.||
||Configure Segmentation Brush...||Opens a dialog box in which you can change the color and fill settings for the Edit Segmentation Tool.||
||Configure Flood Select...||Opens a dialog box in which you can change the parameters for the flood action of the Select Voxels Tool.||
||Save Point||Saves the current cursor so that [[FsTutorial/Tools|tksurfer]] can use its Go To Point function to go to that point.||
||Goto Saved Point||Sets the cursor to the one last saved in [[FsTutorial/Tools|tksurfer]] for this subject.||
||Goto Point...||Opens a dialog box in which you can enter specific numerical values in multiple coordinate systems and go to that point.||
||Volume||Opens a submenu of tools and commands for anatomical data.||
||Surface||Opens a submenu of tools and commands for surface data.||
||fMRI||Opens a submenu of tools and commands for to functional data.||
||Head Points||Opens a submenu of tools and commands for EEG/MEG head point data.||
||Save RGB...||Saves the contents of the Display Window to an RGB file.||
||Save RGB Series...||Opens a dialog box in which you can tell tkmedit to automatically scroll through a series of slices and save their images to RGB files.||
'''2.3.1 Volume''' <
>
||Threshold Volume...||A tool for changing all Main volume values above or below a specific value to a new value.||
||Flip Volume...||A tool for flipping the Main volume, creating a mirror image.||
||Rotate Volume...||A tool for rotating the Main volume any number of degrees around a main axis.||
||Smart Cut||A tool for setting large sections of the Main anatomical volume to 0. See the Working With Data section for details.||
'''2.3.2 Surface''' <
>
||Show Nearest Main Vertex||Sets the cursor to the point of the nearest vertex on the Main surface configuration.||
||Show Nearest Original Vertex||Sets the cursor to the point of the nearest vertex on the Original surface configuration.||
||Show Nearest Pial Vertex||Sets the cursor to the point of the nearest vertex on the Pial surface configuration.||
||Show Nearest Main Surface Edge||Sets the cursor to the point of the nearest interpolated vertex on the Main surface configuration.||
||Show Nearest Original Surface Edge||Sets the cursor to the point of the nearest interpolated vertex on the Original surface configuration.||
||Show Nearest Pial Surface Edge||Sets the cursor to the point of the nearest interpolated vertex on the Pial surface configuration.||
||Find Main Vertex...||Opens a dialog in which you can enter a vertex index on the Main surface. The cursor will be set to that index.||
||Find Original Vertex...||Opens a dialog in which you can enter a vertex index on the Original surface. The cursor will be set to that index.||
||Find Pial Vertex...||Opens a dialog in which you can enter a vertex index on the Pial surface. The cursor will be set to that index.||
||Set Vertex Distance at Cursor||Sets the value in the Surface Distance information field for the closest vertex in the Main surface.||
||Average Vertex Positions...||Opens a dialog in which you can execute a command to average surface vertex positions in the Main surface.||
'''2.3.3 fMRI''' <
>
||Select Contiguous Voxels by Func Value||Selects contiguous voxels to the cursor whose corresponding functional values are greater than or equal to the functional value at the cursor.||
||Select Contiguous Voxels by Threshold||Selects contiguous voxels to the cursor whose corresponding functional values are greater than or equal to the minimum functional threshold value.||
||Select Functional Voxel||Selects an entire functional voxel.||
||Register Functional Overlay...||A tool for aligning (registering) the functional overlay data with the anatomical data.||
||Restore Overlay Registration||Restores the overlay registration to its original value.||
||Set Registration to Identity||Sets the overlay registration matrix to the identity matrix, removing all transformations.||
||Graph Current Selection||Graphs the average of all voxel values in the selection in the Time Course graph window.||
||Print Time Course Summary to File...||Creates a file containing a table version of the time course information for the current voxel or selection.||
||Save Time Course Graph to Postscript File...||Saves the contents of the Time Course graph window to a Postscript file suitable for printing or including in other documents.||
'''2.3.4 Segmentation''' <
>
||Select Current Label||Selects all the anatomical voxels in the segmentation label under the cursor.||
||Recompute Segmentation||Recomputes the Main segmentation using the Main anatomical volume and the GCA volume.||
||Graph Current Label Average||Graphs the average time course for all the anatomical voxels in the segmentation label under the cursor. Only works with a time course loaded.||
'''2.3.5 Head points''' <
>
||Restore Head Points||Restores the head points registration to its original value.||
||Edit Current Head Point Label...||Edits the label of the head point closest to the cursor.||
||Register Head Points...||A tool for aligning the head point data with the anatomical data.||
=== 3.0 File name substitution ===
Whenever a file name is required to load or save data, the following system is used. First, on startup, tkmedit attempts to acquire a User Home Directory and a Subject Home Directory. The User Home Directory is always the current directory from which tkmedit was launched. The Subject Home Directory is based on the way in which the anatomical data was loaded. If the default tkmedit loading method is used, it is the concatenated contents of $SUBJECTS_DIR and the subject name. If the -f switch is used, it is the value of that parameter.
If the first character of the file name is ~ (tilde) or . (period), it is substituted with the Subject Home Directory or User Home Directory, respectively. If the first character is another alphanumeric character, a default location directory is prepended to the file name. If the first character is / (slash), it is left alone. This behavior is summarized below:
||''If the first character of FILENAME is....''||''The final file name is...''||
||~ (tilde)||SubjectHomeDir/FILENAME||
||. (period)||UserHomeDir/FILENAME||
||/ (slash)||FILENAME||
||other character||SubjectHomeDir/Subdirectory/FILENAME||
...where FILENAME is the file name that was input.
The subdirectory used in the last substitution depends on the file type being loaded, and is appropriate for the standard NMR center directory structure. These are:
||Data Type||Subdirectory||
||Functional data||fmri||
||Head Points||bem||
||Surface||surf||
||Anatomical||mri||
||ROI/Label||label||
||RGB||image/rgb||
||Control Points (control.dat)||tmp||
||Edit (edit.dat)||tmp||
||Segmentation||mri||
||Color Table||$CSURF_DIR||
||Label||label||
||Anatomical Transform||mri/transforms||
=== 4.0 Command line options ===
'''4.1 Script''' <
>
To automatically run a script, use the -tcl option, passing a script name. Tkmedit still requires anatomical data to be loaded before doing anything.
tkmedit -tcl SCRIPT_NAME
'''4.2 Anatomical volume''' <
>
There are two ways to load anatomical data from the command line. The first is the default tkmedit mode for loading COR- volumes.
tkmedit SUBJECT IMAGE_TYPE
Where SUBJECT is a subject directory relative to the value of the SUBJECTS_DIR environment variable, and IMAGE_TYPE is a subdirectory of ${SUBJECTS_DIR}//mri. i.e.
tkmedit T1
looks in ${SUBJECTS_DIR}//mri/T1. If there is a COR- volume in this directory, or another kind of readable data, it will be loaded as the Main anatomical volume.
Another way to load anatomical data is with an explicit path or file name using the -f switch:
tkmedit -f PATH/TO/DATA/[FILENAME]
This method looks in the given directory or file for any recognizable data. It will be loaded as the Main volume.
The Aux volume can be loaded with the -aux switch, i.e.
tkmedit T1 -aux wm
This looks in ${SUBJECTS_DIR}//mri/wm for a COR- volume.
Note that tkmedit will not load without specifying a Main anatomical volume with the subject/image type method or the -f method.
'''4.3 Surface''' <
>
To load a surface from the command line, add the name after the subject:
tkmedit IMAGE_TYPE SURFACE
or
tkmedit -f /path/to/volume/data SURFACE
'''4.4 Functional volume''' <
>
Overlay data is loaded with the -overlay switch and time course data with the -timecourse option, with the concatenated path and stem as the argument i.e.:
tkmedit -overlay DATA_DIRECTORY/STEM -timecourse DATA_DIRECTORY/STEM
where STEM is the portion of the bfloat file data that comes before the _xxx slice number. i.e. the stem of a file set named minsig_000.bfloat through minsig_015.bfloat is minsig.
To enable functional registration, pass -register on the command line with no arguments.
To specify a registration file that is not in the same directory as the functional volume, use the -overlay-reg or -timecourse-reg option with the registration file as the argument, i.e:
tkmedit -overlay DATA_DIRECTORY/STEM -overlay-reg /PATH/TO/REGISTRATION_FILE.DAT
To load an offset volume for the Time Course volume, specify it the same way as the Time Course volume but with the -timecourse-offset switch:
tkmedit -timecourse-offset DATA_DIRECTORY/STEM
'''4.5 Segmentation''' <
>
Use the -segmentation switch to load a COR- volume representing a segmentation. A color file is also necessary.
tkmedit -segmentation COR_DIRECTORY COLOR_FILE
The COR_DIRECTORY is the directory of the COR- files and the COLOR_FILE is the file to use as a color lookup table.
You can specify the opacity of the segmentation overlay with the -segmentation-opacity option:
tkmedit -segmentation COR_DIRECTORY COLOR_FILE -segmentation-opacity 0.6
'''4.6 Head Points''' <
>
Use the -headpts switch to load a head points file. This is a file of points indicating MEG/EEG sensor placement. A transform file is also required and can be specified on the command line.
tkmedit -headpts POINTS_FILE TRANSFORM_FILE
=== 5.0 Crash recovery ===
If tkmedit segfaults (makes a memory access violation), and it will, and the user has edited the Main volume, the volume will be saved in the /tmp directory. This can be reloaded by loading the volume from that directory, i.e.
'''''tkmedit -f /tmp'''''