Up to TkMeditGuide

Back to TkMeditFunctionalVolumes

Continue to TkMeditDTI


A segmentation is a volume whose values represent an index of an anatomical structure or label to which the corresponding voxel in the main anatomical volume belongs. The structures are listed in a lookup table. This table also specifies the colors the structures should appear in, and is more commonly called a color table.


Both a volume and a color table must be loaded to view a segmentation. A segmentation data file is treated the same as a normal anatomical volume, so it can be a COR- volume or any other supported file type. The color table assigns a name and color to each index. You can load both items by choosing File->Load Segmentation.... You can also control-right click the Segmentation button on the toolbar.

You can create a new segmentation with the File->New Segmentation... command. You will still need to enter a color table to use.

You can import a surface annotation with the File->Import Surface Annotation as Segmentation... command. A surface annotation is a segmentation of the surface, so that every vertex in the surface has an associated label. TkMedit will look up the corresponding voxel for each vertex and assign the label value to that voxel in a new segmentation.

Like the anatomical volumes, TkMedit can have a Main or Aux segmentation. Each can have its own color table. To load Aux segmentations use the commands in File->Aux Segmentation. As with the anatomical volumes, only the Main segmentation volume can be edited.

Display Options

Segmentations are drawn as a colored overlay in the Display Window. The colors are defined in the color lookup table file specified at load time. The opacity of the overlay can be configured in the dialog box brought up by choosing View->Configure..., Segmentation Display... or by control-left clicking ont the Segmentation button on the toolbar. The overlay can be hidden by unchecking View->Segmentation Overlay or by clicking the Segmentation button on the toolbar. You can toggle between the Main and Aux segmentations with the View->Aux Segmentation Overlay command.

If the Segmentation Label Volume Count option in the View menu is checked, when the Edit Segmentation tool is active and the left button is used to set the cursor, TkMedit will count the number of contiguous voxels in the label clicked and display the result in the Cursor Information area in the Tools Window. This operation may take anywhere from a second to minutes depending on the size of the area clicked, so be aware that TkMedit may seem unresponsive for this length of time after setting the cursor with this option activated.

You can select a segmentation label, adding to the current selection, by placing the cursor on a label and choosing Tools->Segmentation->Select Main Segmentation Label At Cursor, or the corresponding command for the Aux segementation. This goes through the entire segmentation volume and finds all voxels of the same segmentation value as the one at the cursor, and adds them to the selection.


A segmentation can be edited with the Edit Segmentation tool, which can be activated by pushing the icon_copy.gif button on the Main Toolbar, by choosing Tools->Edit Segmentation, or by pressing the 'g' key.

By clicking with button 2 with this tool, you can 'paint' a label in the segmentation. The color used can be set in the dialog box brought up by choosing Tools->Configure Segmentation Brush.... This tool is a brush tool, so it uses the global brush settings available in Tools->Configure Brush Shape... and in the Reconstruction Toolbar. Clicking with button 3 will 'erase' segementation labels (by setting the label values to 0).

The painting function is similar to the Edit Voxels tool: the clicked voxel, and those around it depending on the brush radius, are set to the value specified in the Configure Segmentation Brush dialog. Clicking on a voxel with button 2 and the control and shift key held down will set the current painting color to the color of the clicked voxel. Edits can be undone with the Edit->Undo Last Edit menu item.

A flood fill is also available, activated by shift-clicking mouse button 2 or 3. This tool fills areas with values equal to or similar to the voxel clicked. It looks for contiguous areas in the source volume to fill in the segmentation with the selected color. It is configured in the Configure Segmentation Brush dialog. It has parameters for 3D, the source volume, fuzziness, distance.

A fill can be undone with the Edit->Undo Last Edit menu item.


To save changes to a segmentation, choose File->Save Segmentation to overwrite the original segmentation volume or File->Save Segmentation As... to specify a new volume, such as an .mgh or .mgz volume, or an empty directory in which to save a COR volume.