# Voxel Editing

Voxel editing is similar to that found in a image editing program.

## Voxel Operations

This section provides voxel operations for editing the voxels. Tooltips on each of the controls describe their operations. For a functional volume, a voxel is on when its value is non-zero; off is zero. For a label volume, a voxel is on when its label is not ???; off is the label ???.

- On - When the mouse is clicked, the voxel under the mouse is set to the value. If any of the brush values are greater than one, surrounding voxels are also set. One can also drag the mouse with the CTRL (Command on Apple) and SHIFT keys down to turn multiple voxels on.
- Off - Just like On but turns voxels off (set to 0 or the ??? label)
- Dilate - If the voxel under the mouse is in a region, the region is enlarged by adding one voxel around the region's edges (makes an island bigger).
- Erode - If the voxel under the mouse is in a region, the region is reduced in size by removing one voxel from around region's edges (makes an island smaller).
- Fill 2D - If the voxel is off and the voxel and its neighbors that are off are filled until reaching other on voxels (fills a lake). This only affects the viewed slice.
- Fill 3D - Like Fill 2D but filling continues into slices in the viewed plane.
- Remove 2D - The voxel under the mouse and all of its connected neighbors with the same value are set to off (removes an island).
- Remove 3D - Like Remove 2D execept that connected neighbors in slices along the plane are also turned off.
- Retain 3D - The voxel under the mouse and all of its connected neighbors stay the way they are. All other voxels are set to off.

- Undo - Revert the last operation.
- Redo - Reapplies the last operation that was undone
- Reset - Resets volume's voxels to their values when the volume was created or loaded.

## Options

The options allow creating a new volume file, adding a new map to an existing volume file, setting the brush (number of voxels affected by a mouse click), and the value to which voxels are set.

### File

- New - Click this button to create a new volume file. The new volume file is inserted into the top layer and is ready for editing.
- Add - Add a new layer to the volume file in the top layer. The new layer is ready for editing.
- Lock - Prevents editing of the top layer. Click the button to unlock the top layer so that voxels are editable.

### Brush

The brush determines the voxels turned on or off when using the mouse when the Operation is set to On or Off. When 1, only the voxel under the mouse changes its value. When 3 (5, 7, 9, ...), the voxel under the mouse and the adjacent voxels in the 2 (4, 6, 8, ...) neighboring slices are turned on or off.

- P - Sets the brush thickness for the parasagittal axis.
- C - Sets the brush thickness for the coronal axis.
- A - Sets the brush thickness for the axial axis.

### Value

- Numeric value - For editing a functional volume. Voxels are set to this value when the Operation is On, Dilate, Fill 2D, or Fill 3D.
- Label value - For editing a label volume. Voxels are set to this value when the Operation is On, Dilate, Fill 2D, or Fill 3D. Clicking the button displays a dialog that allows selection editing of label (name and color) values.

## Create Volume Dialog

The Create Volume dialog is used to create a new volume file for editing. It is important that this new volume has the same spatial characteristics (dimensions, origin, and spacing) as the anatomical volume that servers as the underlay volume. This enures that there is one-to-one correspondence between the volume that is edited and the anatomical volume that is under the edited volume.
To create a new volume:

1. Set the name of the volume file. Click the Select button to set the correct directory for the volume file.
2. Set the Volume Type to either Label (most common) or Functional.
3. Set the Number of Maps (usually 1).
4. In the Voxels section, click the File button to display a dialog containing all volume files in memory. Select the anatomical volume that will serve as the underlay for voxel editing. This will set the correct values for the dimensions, origin, and spacing.
5. In the Voxels section, click the Resample button to change the spacing (size of voxels) with automatic update of Dimensions and Origin while maintaining the same voxel extent.