Segmenting Images Using Contours and Masks: Advanced paint and Power Paint tools

From MIPAV
Jump to: navigation, search

Paint masks are a way of marking specific parts of an image. For example, a mask could define the specific region in a patient brain scan or location of kidney in a healthy adult. Masks could have multiple uses: for work with neurological patients, masks can help map the location and extent of an injury or some abnormality; in addition, masks can be used to understand the role of a specific area of the healthy brain when applied to functional brain images (e.g. fMRI). In MIPAV, masks are created by mapping the regions on each 2D slice of a 3D volume using a brush tool. This section describes how a user can map 2D and 3D regions of interest or create paint masks in a few simple steps using the Advanced Paint and Power Paint tools.
LoadAdvancedPaintToolsIco.jpg -Load Advanced Paint Tools
LoadPOwerPaintToolIco.jpg -Load Power Paint Tools

Advanced paint

This tool has been designed to provide labeled masks to associate with structures to delineate, and to perform as seamless as possible the switch between paint and masks.

Power Paint tool

The Power Paint tool has three options

  1. Object processing, to delete entire regions of paint, and fill any hole (in 2D or 3D images, with any specified connectivity)
  2. Morphology, to erode or dilate the paint mask (in 3D, 2.5D, and 2D images)
  3. Import/Export, to quickly transform paint to VOIs or masks

The Power Paint tool works either on the original image or its triplanar viewer.

To run the Advanced Paint tool,

1 Open an image of interest.
2 Go to the image slice that you want to edit.
3 On the Paint toolbar, click the Load Advanced Paint Tools icon;
4 This opens the Multiple Paint Tools dialog box.
5 Here, use the dialog box options to create a one or multiple paint masks (paints). For dialog box options, refer to Figure 1.
6 Draw the paint mask by dragging the mouse cursor around the region of interest.
7 If you make a mistake, press the Erase Paint from Current Frame icon located on the Paint toolbar. This will erase your mask from the current slice only.
8 Repeat steps 5-7 until you have drawn the mask on the region of interest on all of the slices.
9 Choose Save masks.
10 Open the next image you wish to view. Repeat until you have collected region of interest information for all of the images you want to process.

Multiple Paint Tools dialog box options

Figure 1. Multiple Paint Tools dialog box options
Paint mask palette
Advanced Paint uses a color palette that contains a limited number of colors and each color is described explicitly in the palette. The palette colors themselves are the same as MIPAV uses for stripped LUT. By default, a value from 1 to 24 assigned to each palette button identifies which of the colors in the palette to use. When you click any Paint Mask Palette button, e.g. the button 1, both - the button and the paint brush - appear highlighted with the color assigned to that button. This might remind you of painting by numbers.

PaintMaskPalette.jpg

Options
Number of masks
By default, the Paint Mask Palette shows 24 buttons which represent 24 predefined colors (from 1 to 24). And these 24 colors can be applied to 24 masks.
You can change the number of displayed colors by changing the size of the color button. In order to do that, simply enter desired numbers in the Number of Masks control, and then press Resize. For example,
PaintMaskPaletteNumberofMasks.jpg will display 4*6=24 palette buttons
PaintMaskPaletteNumberofMasks32.jpg will display 4*8=32 palette buttons
Changing a mask number
You can change the number assigned to the palette button or the mask number by right clicking on the palette button. This opens the Change Mask Number dialog box. In the dialog box, enter the mask number which you would like to assign to the mask, and then press Change. The mask with the new number appears in the same place on the Paint Mask Palette.

ChangeMaskNumberPalette.jpg

ChangeMaskNumber.jpg

Show Label text
Expands the dialog box so that it shows paint colors and corresponding labels.
You can edit the label text (by default, all labels are marked as "Label n" where n is a number of a color) and also select which labels to save.
And you can also lock the paint, so that it cannot be overwritten by the Paint to Mask operation.

LabelList.jpg

Save masks
This option allows to save a paint mask(s) to a file. It is useful to give the paint mask the name that is similar to the image file name (e.g. if the image file is x.img, then choose for the mask the name like x*.xml).
Load masks
Loads the saved mask(s) from a file.
Import from VOIs
Creates mask(s) from VOI(s) delineated on the image.
Export to VOIs
Exports mask(s) to VOI.
Hide paint
Hides the current paint.
Hide masks
Hides masks.
Collapse mask/paint
This button allows you to quickly change a mask to a paint and vise versa.
Use shortcuts
This option activates hot keys which you can use to quickly access the dialog box options. The hot keys are as follows:
Numbers from 1 to 9 can be used to switch between the first 9 paint masks
Use t to show the label text
Use c to show or hide the current paint
Use v to hide or display mask(s) painted on the image
Use s to save the mask(s)
Autosave mask
If activated, this option automatically saves (every 5 minutes) an active paint in the file named active_mask_autosave.xml; this file is stored in the image catalogue. It also saves all paints (masks) that you painted on the image in the multipaint_mask_autosave.xml file; this file is also stored in in the image catalogue.This allows you to preserve all paints and masks that you put onto the image.
Note that a paint become a mask automatically as soon as you choose another paint color in the Palette.
Close
Closes the dialog box.
Help
Displays the help for the dialog box.

To run the Power Paint tool,

1 Open an image of interest.
2 For 3D images, use the Image Slice Slider to display the slice that you want to edit.
3 On the Paint toolbar, click the Load Power Paint Tools icon.
4 This opens the Paint Power Tools dialog box.
5 Draw the paint mask by dragging the mouse cursor around the region of interest.
6 If you make a mistake, press the Erase Paint from Current Frame icon located on the Paint toolbar; or use the Erosion button. This will erase your mask from the current slice only.
7 Complete the Paint Power Tools dialog box options.
8 Repeat steps 5-7 until you have drawn all the masks that you need;
9 Choose Save masks.
10 Open the next image you wish to view. Repeat until you have collected region of interest information for all of the images you want to process.

Paint Power Tools dialog box options

Figure 2. Paint Power Tools dialog box options
Object processing
The object processing can be done for 2D and 3D images. To specify the type of the image, use the corresponding radio button.
Grow Region option can be used to grow paint inside a region of interest (e.g., VOI) of a mask. This tool works similar to the usual region growing tool, but it uses only one intensity value and the specified connectivity.
Fill Background - allows to fill the background.
Fill All Background -TBD.
Remove object - removes a selected object.
Remove All Objects - removes a selected object.
Connectivity - TBD.
Threshold specifies the upper and lover threshold for the image intensities to paint on. By default, you can paint everywhere, but if you move the sliders further in, you can see that any new paint you add will not affect the lowest or highest image intensities.

PowerPaintTools.jpg

Morphology
Morphology operations include erosion and dilation. Dilation causes objects to dilate or grow in size; erosion causes objects to shrink. The amount and the way that they grow or shrink depend upon the choice of the structuring element (ball, diamond, or cube) which you can select from the Element list box. You must also specify the dimensionality of the morphological operation - 3D, 2D or 2.5D.
Erosion and dilation options
3D, 2.5D, 2D, triplanar, 2.5D(XY), 2.5D(XZ), 2.5D(YZ),2D(XY), 2D(XZ), 2D(YZ)
Element
Choose among a ball, diamond, and cube.
Scale (mm)
TBD.
Undo last
Undoes the last operation.
Misc.
Auto Save - allows auto saving every specified time period.
Import/Export
Paint to VOI
Transforms a paint to a VOI.
VOI to Paint
Transforms a VOI to paint.
Paint to Mask
transforms a paint to mask
Mask to Paint
transforms a mask back to paint
Use short-keys
Allows using short-keys. The short-keys are g for grow, f for fill, r for remove, d for dilate, and e for erode.