Editing NIFTI images¶
The orthographic view has an edit mode which allows you to edit the values contained in NIFTI images. You can enter edit mode in any orthographic view via its settings menu, e.g. Settings ⇒ Ortho View 1 ⇒ Edit mode.

Overview¶
Important: When you are in edit mode, the currently selected overlay (assuming that it is a NIFTI image) is the default target for all editing operations. Whenever you draw, erase, fill, select, copy, or paste voxels, you will be doing so with respect to the currently selected image.
When you use select mode, you may use the Target image setting to specify an alternate target for fill and paste operations.
Create a mask/copy!¶
If you are worried about destroying your data, you may wish to create a copy of your image, and edit that copy:
Create an empty 3D copy of the currently selected image (useful for creating mask images) through the action toolbar.
- Create a full copy of the currently selected image via the Overlay ⇒ Copy menu option.
Save your changes¶
When you have made changes to an image, or created a mask/ROI image, don’t
forget to save them via the Overlay ⇒ Save menu item, or the
floppy disk button on the overlay list.
Editing modes¶
You can choose to work in one of two primary editing modes:
Draw mode In this mode, clicking, or clicking and dragging on an image, will immediately change the voxel values in the image. This mode will be familiar to you if you are used to editing images in FSLView.
Select mode In this mode, editing images is a two-step process:
- Select the voxels you wish to change.
- Change the value of the selected voxels.
Editing tools¶
When you are editing an image, you can choose from one of four main interaction tools which control what the mouse does when you click, or click and drag on the image:
Navigate This tool is identical to using the ortho view outside of edit mode - it simply allows you to view the image, and change the displayed location.
Pencil In draw mode, this tool allows you to change voxel values to the current fill value. In select mode, this tool allows you to add voxels to the current selection.
Eraser In draw mode, this tool allows you to erase voxels (set their value to zero). In select mode this tool allows you to remove voxels from the current selection.
Select by intensity This tool (only available in select mode) allows you to automatically select voxels based on their intensity.
Draw mode¶
When you first enter edit mode, you will be in Draw
mode. In draw mode, you can:
Use the navigate tool to change the display location.
Use the pencil tool to change voxel values.
Use the eraser tool to erase voxels.
![]()
Use the undo and redo buttons to undo/redo changes that you have made to the currently selected image.
Draw mode will be familiar to you if you are used to editing images in FSLView. Select the pencil tool, then click, or click and drag, on the image. When you release the mouse, the values of all of the highlighted voxels will be replaced with the current fill value (which can be changed on the edit toolbar).
You can use the eraser tool in a similar manner - click, or click and drag on the image. When you release the mouse, the values of the highlighted voxels will be replaced with zero (or with the current erase value - see the edit settings panel).
The pencil/eraser size can be adjusted with the Selection size control on the edit toolbar. You can also hold down the ⌘ and ⇧ keys and spin the mouse wheel to increase/decrease the pencil size.
The buttons allow you to switch between using a 2D selection
region in slice, and using a 3D selection which extends across multiple
slices.
Select mode¶
Select mode offers more flexibility than draw mode, but is slightly more involved. In select mode,
editing an image is a two-step process:
- Select the voxels you wish to change. You can do this in one of two ways:
- By manually drawing your selection with the pencil
and eraser
tools.
- By using the select by intensity tool
to automatically select voxels based on their intensity.
- Change the value of the selected voxels by filling or erasing.
In select mode, you can select voxels in one image, and then apply that selection to another image [*] - you can do this simply by selecting, in the overlay list, the image you wish to apply the selection to, or by using the Target image setting, on the edit toolbar.
This means that you can, for example, select a lesion in a T1 image, and then fill in the voxels for that lesion in a corresponding mask image. You can also copy the values of all voxels in a selection, and paste them into another image - see the section on copying and pasting for details.
[*] | As long as the newly selected image has the same dimensions, resolution and orientation as the previous one. |
Manual selection¶
In select mode, the pencil and eraser
tools are respectively used to select and deselect voxels.
Using the pencil tool, left-clicking will select voxels under the selection cursor. Selected voxels are highlighted in pink (you can change the selection colour in the edit settings panel). Left clicking with the eraser tool will remove voxels from the selection [†].
You can adjust the selection cursor size via the Selection size control in the edit toolbar, or by holding down the ⌘/⌃ and ⇧ keys and spinning the mouse wheel.
By default, the selection cursor is a 2-dimensional rectangle in the current
slice, but it can be made into a 3-dimensional cuboid by changing to a 3D
selection, via the buttons on the edit toolbar.
At any point, you can discard your current selection with the Clear
selection button on the action toolbar - clicking this will deselect all voxels.
Once you are happy with your selection, you can fill, erase, or copy it with the buttons on the action toolbar. See the sections on changing voxel values, and copying and pasting for details.
[†] | In fact, when you are using the pencil tool, right-clicking will deselect voxels. Similarly, with the eraser tool, right-clicking will select voxels. So you do not need to continually switch between the pencil and eraser tools - simply use both mouse buttons. |
Select by intensity¶
As an alternate to manually drawing the selection, voxels can be selected
automatically based on their intensity/value. You can do this with the select
by intensity tool , accessed through the edit toolbar.
With the select by intensity tool, left-clicking on a voxel (the seed) will result in all voxels that have a value similar to that voxel being selected [‡]. The threshold by which voxels are considered to be similar can be changed via the Intensity threshold on the edit toolbar [§].
Various settings, accessed via the edit toolbar, are available to constrain the voxels which will be selected when you use the select by intensity tool:
The region can be limited to the current slice, or the entire image, via the 2D/3D buttons.
The region be limited to a radius by clicking the Limit to radius button. You can adjust the search radius via the Search radius control on the edit toolbar [¶].
The search can be restricted to adjacent voxels by pushing the Local search button. When local search is enabled, voxels which are not adjacent to an already-selected voxel (using a 6-neighbour connectivity scheme) are excluded from the search.
[‡] | In a similar manner to manual selection, you can remove voxels from the selection with the right mouse button. |
[§] | You can also change the intensity threshold by holding down the ⌘/⌃ and ⇧ keys and spinning the mouse wheel. |
[¶] | The search radius can be also be changed by holding down the ⌥ and ⇧ keys, and spinning the mouse wheel. |
Changing voxel values¶
Once you are happy with your selection you can change the value of the selected voxels in one of the following ways:
The values of all selected voxels can be replaced with the current fill value, by clicking the Fill selection button. The current fill value can be modified via the Fill value control on the edit toolbar.
The values of all selected voxels can be erased (set to zero) by clicking the Erase selection button.
Remember that, once you have made a selection on the currently selected image, you can apply that selection to a different image (with the same dimensions/resolution/orientation), either via the Target image setting on the edit toolbar, or simply by selecting the other image in the overlay list. This feature is most useful with the select by intensity tool - you can make a selection based on the intensities in one image, but then change the values of voxels within that selection in another image.
Copying and pasting¶
The copy and paste
buttons on
the action toolbar allow you to copy
voxel values from one image, and paste them into another image:
- Once you have selected some voxels in an image, either manually or with the select by intensity
tool, click the copy button
. The values of all voxels in the selection are copied to an internal clipboard.
- Select a different image, which has the same dimensions, resolution, and orientation as the previously selected image.
- Click the paste button
. The voxel values from the first image will be pasted into the newly selected image.
Edit mode toolbars and panels¶
When you enter edit mode, two toolbars are added the ortho view you are working in:
- The edit toolbar, along the top, allows you to control how editing/selections are performed.
- The action toolbar, down the left hand side, allows you to perform various actions related to editing.
The edit toolbar¶
The edit toolbar allows you to change the editing mode, to choose the editing tool, and to configure some options and settings:

- Editing mode These buttons allow you to switch between draw mode and select mode.
- Edit tool These buttons allow you to choose the current tool - navigate, pencil, eraser or select by intensity.
- 2D/3D mode You can toggle between selecting voxels in the current slice (2D), or selecting voxels across multiple slices (3D).
- Limit to radius (only available in select mode) This button allows you to limit the select by intensity search to a specific radius (specified via the Search radius).
- Local search (only available in select mode) This button allows you to limit the select by intensity search to adjacent voxels only.
- Selection size This setting controls the selection cursor size, when drawing, or manually selecting voxels.
- Fill value This setting controls the fill value used when editing voxel values.
- Intensity threshold (only available in select mode) This setting controls the threshold used when using the select by intensity tool.
- Search radius size (only available in select mode) This setting controls the size of the search radius, when the Limit to radius setting is enabled.
- Target image (only available in select mode) This setting allows you to choose a target, or destination image for fill/paste operations. Voxels will be selected according to the currently selected overlay, but the selection will be applied to the current target image.
The action toolbar¶
The action toolbar contains buttons allowing you to perform various editing actions.

- Edit settings panel This button opens the edit settings panel, which contains all options related to editing.
- Copy image This button creates an empty 3D copy of the currently selected image, and adds it to the overlay list.
- Cursor follows mouse By default, when you draw/select or erase/deselect voxels using the pencil or eraser tools, the currently displayed location will update as you move the mouse. This button allows you to disable this behaviour.
- Undo This button undoes the most recent change to the currently selected image.
- Redo This button re-does the most recently undone change to the currently selected image.
- Show/hide selection (only available in select mode) This button allows you to turn on and off the selection overlay.
- Clear selection (only available in select mode) This button clears the current selection, i.e. all voxels are deselected.
- Fill selection (only available in select mode) This button fills the current selection - the value of all selected voxels is set to the current fill value.
- Erase selection (only available in select mode) This button erases the current selection - the value of all selected voxels is set to zero.
- Copy selection (only available in select mode) This button copies the current selection - the values of all selected voxels are copied to an internal clipboard.
- Paste selection (only available in select mode) This button pastes the selection on the clipboard into the currently selected image (if it has compatible dimensionality).
The edit settings panel¶
The edit settings panel can be opened via the spanner button
on the action toolbar.

In FSLeyes 0.15.1, the edit settings panel only contains a few settings in addition to those that can be accessed via the edit toolbar:
- Erase value This setting allows you to change the value to use when erasing voxels.
- Selection cursor colour This setting allows you to change the colour of the selection cursor.
- Selection overlay colour This setting allows you to change the colour of the selection overlay (only visible in select mode).
- Intensity threshold limit By default, the maximum value that the intensity threshold can be set to is determined from the image data range. If your image has an unusual data range or distribution, you may wish to use this setting to manually set the maximum intensity threshold.