Up to TkMeditGuide

Back to TkMeditWorkingWithData

Continue to TkMeditControlPoints

Anatomical Volumes

The anatomical volume is the core data type of TkMedit. TkMedit cannot be started without loading an anatomical volume. Anatomical volumes are displayed in grayscale, with or without interpolation.

Main and Aux Volumes

TkMedit can hold two anatomical volumes in memory at the same time, called the Main volume and the Aux volume. Although it can not display them together at the same time, clicking on a voxel in one volume will display that value at that voxel in both volumes.

The Main volume is considered the central data object in TkMedit. All other data is displayed relative to the Main volume. The subject name and Main volume name are displayed in the title bar of the Display Window. If an Aux volume is loaded, its name is displayed in parentheses next to the Main volume name in the title bar.

If both volumes are loaded, you may select which volume is displayed by choosing Main Volume or Aux Volume in the View menu, or by pushing in the appropriate button ( Icons/TkMedit/icon_main_volume.gif or Main and Icons/TkMedit/icon_aux_volume.gif for Aux) on the Main Toolbar. The currently shown volume will be surrounded by double asterisks in the title bar, and its value in the Tool Window is shown in double asterisks. If only the Main volume is loaded, asterisks will not be displayed.

You can go to a specific location in the volume by using the Tools->Goto Point... command, or by typing the coordinates into one of the fields in the Tools Window where the coordinates are displayed and pressing the return key.

Loading Volumes

You must load a Main Volume to start TkMedit from the command line. You can also load an Aux volume from the command line with the -aux option. Once TkMedit is started, you can load a new Main Volume with the File->Load Main Volume... command, and an Aux Volume with the File->Aux Volume->Load Aux Volume... command. Additionally, you can Control+right click the Main and Aux Volume buttons on the toolbar, or click and hold with the right button to show a menu of availble volumes for the current subject.

Display Transform

Display transforms can be applied to each volume to transform its position. This transform only affects the way the volume is drawn in the Display Window. All coordinates displayed in the Tools Window will not be affected by this transform.

The file must be an LTA (*.lta) or XFM (*.xfm) transform type. To load a transform for the Main volume, choose File->Transforms->Load Transform for Main Volume... from the menu and enter the file name of the transform. To unload it, choose File->Transforms->Unload Transform for Main Volume. There are corresponding items for the Aux volume.

Display Options

There are options for configuring the brightness and contrast of each volume. Choose View->Configure->Brightness / Contrast... to open a dialog with sliders for brightness, contrast, min, and max values for botht the Main and Aux volumes. Brightness and contrast work how you would expect. Min and max affect the min and max values displayed for the volume. In between those values there are 255 possible colors, so decreasing the range with these sliders increases the granularity of the colors.

You can change the sampling method via the View->Anatomical Sampling method, which affects how smooth the voxels appear. Nearest Neighbor will not perform any color interpolation at all and voxels will look pixelated. However, this is the fastest display option. Trilinear performs trilinear sampling and is slow but provides a smoother image. Sinc is the slowest but smoothest option.

You can also change the resampling method, confusingly named and very different from the sampling method. The resampling method determines how the volume is resampled into the coordinate space. RAS uses the RAS transform that is in the volume header. Slice ignores the RAS transform. This can be useful if you want to see the volume in an untransformed state.

You may also turn off the volume display by unchecking View->Anatomical Volume. This is useful if you want to look at other types of data with the anatomical volume in the background. Neither the Main nor Aux volume will be displayed if this item is not checked.

You can display a maximum intensity projection by checking the View->Maximum Intensity Projection item. This displays the voxel with the highest value in the current orientation, and is the same for every slice in an orientation.


Editing is done with the Edit Tool which can be activated by pushing the Icons/TkMedit/icon_edit_volume.gif button in the Main Toolbar, by choosing Tools->Edit Voxels, by pressing the 'a' key.

There are settings for two 'colors' for this tool, each bound to a button when this tool is active. These settings can be choosing Tools->Configure Volume Brush.... This tool, along with the other editing tools, uses the global brush settings available in Tools->Configure Brush Info... and in the Reconstruction Toolbar. These include the shape of the brush ( Icons/TkMedit/icon_brush_circle.gif circular or Icons/TkMedit/icon_brush_square.gif square), its radius, and whether or not it acts in all three dimensions ( Icons/TkMedit/icon_brush_3d.gif ). You can also select whether your edits affect only the Main volume or both the Main and Aux volumes. (Most users will only want to edit one volume.)

Note that if the Main volume is the only target and even if the Aux volume is visible, the Main volume will still be edited, and vice versa. This is useful for users who want to edit one volume but use a different volume as a visible template or guide.

This brush uses a threshold that allows you to specify which voxel values to be affected. This allows you to change ranges of values in an area to a new value, which is useful in cleaning up large anatomical areas.

There are a few other operations you can use to edit the volume. In the Tools->Volume menu there are commands for Thresholding, Flipping, and Rotating the volume. These are self-explanatory and can be used to fix misoriented data. These operations only affect the Main volume only.

The Smart Cut command is designed for removing entire chunks of volume based on the position of the cursor. It will create a cutting plane perpendicular to the current viewing orientation based on the closest edge of the window and remove everything from that plane to the edge. For example, if you place the cursor near the bottom-middle of the screen and activate the command, it will remove everything from the cursor to the bottom edge.


There are three ways to undo an edit. All of them only work with the Main volume, as it is the only one that can be edited. The first is with the standard Edit->Undo Last Edit menu item. This action will undo the last edit, and is the quickest and easiest way to undo single edits.

Another way is to use the Snapshot Volume tool in the Tools->Volume menu. Take a snapshot of the volume to save a copy of its contents in memory by choosing Edit->Take Snapshot of Volume. To restore the volume to this state, use the Edit->Restore Volume to Snapshot tool. This method is ideal for making milestone versions of the the volume state. There are buttons for these commands on the Reconstruction Toolbar: Icons/TkMedit/icon_snapshot_save.gif for taking a snapshot, and Icons/TkMedit/icon_snapshot_load.gif for restoring to it.

The third way is to use the Undo Volume. This can be envisioned as a separate volume containing all the voxels that have been changed. You can view these voxels by checking View->Undoable Voxels; they will be drawn with a blue highlight. By holding down the shift key and clicking with mouse button 2 with the Edit Voxel tool active on an undoable voxel in Display Window, you can undo all contiguous undoable voxels, like an undo flood fill. This is best suited for undoing contiguous areas of voxels.


After all your careful edits, you will want to save the changes to your data. TkMedit can write anatomical volumes out as COR- files or as .mgh or .mgz volumes (the latter is recommended). Choose File->Save Main Volume to overwrite the original source volume or File->Save Main Volume As... to specify a new location. If you want to write a COR volume, specify a directory in which to write the files, otherwise enter a file name that ends in .mgh or .mgz. You can save the Aux volume with corresponding commands in the File->Aux Volume submenu.

TkMeditGuide/TkMeditWorkingWithData/TkMeditAnatomicalVolumes (last edited 2011-01-24 15:00:04 by LouisVinke)