CIBC:Documentation:Seg3D1.x BasicFunctionality
Contents
- 1 Seg3D 1.x Documentation
- 2 Views
- 3 File
- 4 Views
- 5 Edit
- 6 Tools
- 7 Filters
- 7.1 Curvature Anisotropic Diffusion Filter
- 7.2 Median Filter
- 7.3 Discrete Gaussian Filter
- 7.4 Canny Edge Detection Filter
- 7.5 Gradient Magnitude Filter
- 7.6 Intensity Correction Filter
- 7.7 Histogram Equalization
- 7.8 Mask Data
- 7.9 Confidence Connected Filter
- 7.10 Neighborhood Connected Filter
- 7.11 Otsu Threshold Filter
- 7.12 Threshold Segmentation Level Set Filter
- 7.13 Copy Label Filter
- 7.14 Label Invert Filter
- 7.15 Combine Labels with Logical And
- 7.16 Combine Labels with Logical Remove
- 7.17 Combine Labels with Logical Or
- 7.18 Combine Labels with Logical Xor
- 7.19 Binary Dilate/Erode Filter
- 7.20 Connected Component Filter
- 7.21 Fill Holes
- 7.22 Extract Label (deprecated)
Seg3D 1.x Documentation
This page applies to Seg3D 1.x.
Many features are similar in Seg3D 2 and a manual is forthcoming. The Seg3D 2 tutorial also presents much of the user interface functionality.
Views
The name of the current view is in the upper left of each view. Clicking on the name will cycle to the next available view. Keyboard shortcuts for selecting a specific view quickly are also listed.
The views are:
2D Slice View Window
2D Slice View GUI Buttons
When a mouse enters a 2D window, these icons will appear in the lower right poriton of the active slice view.
2D Slice View Mouse Actions
Mouse Command | Action |
---|---|
Left-Button-Drag | Modify Contrast/Brightness of colormap applied to dataset. |
Middle-Button-Drag | Change slices in other views to intersect at cursor |
Wheel-Up | View next slice |
Wheel-Down | View previous slice |
Shift | Navigation Mode |
Shift-Left-Button-Drag | Pan View |
Shift-Right-Button-Drag | Zoom View in/out |
2D Slice Window Keyboard Actions
Key | Action |
---|---|
, < | Goto Previous Slice |
. > | Goto Next Slice |
= + | Zoom in |
- _ | Zoom out |
Left | Change Current Layer Down |
Right | Change Current Layer Up |
Shift-Left | Move Current Layer Down |
Shift-Right | Move Current Layer Up |
P | Punch current slice through the volume. |
C | Clear seed points |
F | Fill Polyline when Polyline Tool is active |
E | Erase Current Slice |
3D View
3D View GUI Buttons
When a mouse enters a 3D window, these icons will appear in the lower left poriton of the active slice view.
These icons have changed as of 1.8 and this portion is a little out of date.
3D View Mouse Actions
Mouse Command | Action |
---|---|
Left-Button-Drag | Pan View |
Right-Button-Drag | Zoom View |
Middle-Button-Drag | Rotate View |
Layers View
Volumes View GUI Buttons
The window that appears in the right portion of the Seg3D interface enables the user to modify the different volumes.
Icon | Name | Action |
---|---|---|
![]() |
Eye | Toggle layer view on/off |
![]() |
Add | Create a new label layer |
![]() |
Information | Show the volume information |
![]() |
Slider | Adjust the opacity of the 2D slices |
![]() |
Close | Delete the layer |
Optional bottons that may appear with a volume
Icon | Name | Action |
---|---|---|
![]() |
Solid Color | Chose the color for this label |
![]() |
Box | Currently selected for volume rendering |
File
The File menu consists of operations for getting data in and out of Seg3D.
Open Volume
This brings up a file dialog for opening a new data volume. Seg3D supports many different file formats such as vff, meta, nrrd, dicom, and image stacks. The data is converted into floats on read so as to preserve filtering integrity.
Open Session
Opens a previously written Seg3D session file containing the layers and state of the saved sesssion.
Import Segmentation
This brings up a file dialog similar to Open Volume, except that on reading the volume it is converted into unique labels based upon it's discrete values. For instance if a volume contains a segmentation such that every voxel is labeled with a 0, 1, or 2, Seg3D will read it in as 3 separate labels corresponding with those numbers.
Save Volume
Save a volume out in the specified format. Some formats do not support floating point numbers (such as vff and png) and the data will be converted down if that is the case. Also if an image file is specified it will be written as a sequence using the specified filename and then appending the sequence number to the end. For example foo.png will write as foo0001.png, foo0002.png, etc.
Save Session
Save the current state of Seg3D. In the future this will save a single zip file containing everything necessary. At the current time this saves a .ses file which is a small xml file describing the contents of the layer manager and what files the volumes are all associated with. It also saves a number of .nrrd volumes into the same directory as the .ses file which contain the actual data.
Export Segmentation
This collapses the selected labels into one discrete volume. Each voxel will be represented with one label tag which corresponds with the one that is on top in the layer manager and appears to be on top in the various views. Thus if two labels overlap the segmentation will only contain the topmost one. The labels are numbered from 1-N where N is the number of labels present. 0 is used where there are no labels present. For example exporting just one label will result in a volume containing 1 where the label is on and 0 where it is not.
Quit
All done. Leave the program.
Views
The Views menu consists of ways to select the different view panel appearances.
Two by Two
One and Three
Single
Volume Rendering
Edit
The Edit menu consists of various options to change the state of Seg3D.
Undo
This will undo the last volume related operation. As of this time the non-volume operations (such as setting the mask layer or moving seed points) cannot be undone.
Autoview All
Autoview all of the visible view panels so that the current volume fits in them.
Set Mask Label
Set the current label volume to be the mask layer. The mask layer shows up highlighted with a purple background (pink if it is both the mask layer and the current layer).
Clear Mask Label
Clear the mask label volume.
Isosurface Current Label
Isosurface the currently selected label volume and show the results in the 3D view panel. The isosurface is not automatically regenerated each time the label changes and only represents a static snapshot of when this option was selected.
Isosurface All Labels
Isosurface all of the labels. Isosurfaces are not automatically regenerated when labels change and so they only represent a static snapshot of when this option was selected. *warning* Isosurfacing all of the labels can result in a very large amount of data created and a drastic slowdown in redraw speed.
Set Volume Rendering Target
This option can be used to change which data volume is currently being volume rendered. The volume which is the current volume rendering target is marked with a little cube icon in the volume editor.
Reset Brightness/Contrast
Reset the brightness/contrast settings for the currently selected data volume.
Move Current Layer Up
Move the current volume up in the volume editor panel. This places it visually on top of the others in the various displays. This is the same as using shift-left.
Move Current Layer Down
Move the current volume down in the volume editor panel. This places it visually underneath the other volumes in the various displays. This is the same as using shift-right.
Tools
The Tools menu contains a number of interactive tools.
Paint Brush
Paint on the currently selected label. The paint brush size can be changed with the scroll wheel or via the user interface.
The left mouse button paints, and the right mouse button erases. The Brush Erase toggle reverses the left/right mouse buttons so that left erases and right paints. The middle mouse can be used to set a seed point that can then be 2D flood filled in the last used slice window.
The f key can also be used to flood fill once the seed point is set. Other useful keys are the e key which clears the current slice, and the shift-up and shift-down key combinations, which copy the current layer up/down.
Crop Tool
Crop the current layer down to a smaller size. The new size can be selected by changing the text entries on the tool panel or by dragging the crop frame around in the slice windows.
Several of the other layer operations require that the input layers be of the same size, so to avoid trouble later on it is recommended that any cropping be done early on in a segmentation process.
Arithmetic Tool
This tool takes two images and performs a voxel by voxel arithmetic operation, which can be selected from the tool panel, producing a new image.
Flip Tool
Flip the volume around the selected axis. This tool flips the data in memory. If the data is saved, it will be saved flipped.
If the data orientation is correct but the view is not, the view can be changed using the flip up-down and flip left-right within each slice view.
Invert Tool
Inverts the voxels in the current volume. The invert tool does not work with labeled volumes.
Resample Tool
Resample the current layer into a new size. This only works on data layers.
Polyline Tool
Fill polylines. The left mouse button adds new points, the middle button erases them, and the right button inserts or moves existing points. Ctrl-left mouse can be used to move the entire polyline.
Circle the area of interest and then use the fill/erase buttons or the f key to add that region into the current label. A fill or erase takes place in the last slice window in which the polyline was edited.
Threshold Tool
Interactive sliders for thresholding a data layer. The upper and lower bounds can be set using the tool panel, or with the two sliders, or by setting seed points within the data. The user can scroll through the data and preview exactly what will become part of the new layer. The Complete button finishes the operation and creates a new label. A histogram is provided to assist in setting the desired threshold values.
NOTE: The first bin in the histogram is ignored when scaling the bins. This is because it often contains far more values than all other bins and can produce a flat histogram.
Window/Level Tool
This tool allows the user to manually set the window and level. This will override any settings done by the user using the left mouse click with in a slice window. The size of the window as well as the location of the level can be set using sliders. A histogram is provided to assist in setting the desired values.
NOTE: The first bin in the histogram is ignored when scaling the bins. This is because it often contains far more values than all other bins and can produce a flat histogram.
Move/Scale Tool
Move/Scale is used to reposition volumes and can do basic axis-aligned coregistration. For example if you have two volumes that are the same size but their spacial positions are not correct you can grab the position from one and then set it to the other. This module can also be used to set anisotropic spacings, for instance after reading image stacks where the intra-image spacing is not available to the program.
Measurement Tool
This tool reports the length of the line drawn between seed points created by left mouse clicks. Clicking on a point with the right mouse button and dragging allows seed points to be moved. The middle mouse erases seed points.
Speedline Iterate Neighborhood
Speedline Iterative Neighborhood description.
Speedline Gradient Descent
Speedline Gradient Descent description.
Speedline Regular Stop
Speedline Regular Step description.
Filters
The filters menu is divided up into three sections. The first contains data enhancement filters. The second contains filters for extracting labels from data volumes. The third contains label manipulators for combining or cleaning up label volumes.
The filters are based on the Image Tool Kit (ITK). As such, for complete and theoretic details see the specific pages with the ITK documentation for each filter.
Curvature Anisotropic Diffusion Filter
Anisotropic diffusion filtering is used to reduce noise (or unwanted detail) in images while preserving specific image features, such as edges and is based on the work of Pietro Perona and Jalhandra Malik, Scale-space and edge detection using anisotropic diffusion, IEEE Transactions on Pattern Analysis Machine Intelligence, vol. 12, pp. 629-639, 1990.
This filter is used in the Capecchi scenario to clean up the mouse paw before the Confidence Connected Filter is run to pull out bones. This particular implementation uses a modified curvature diffusion equation (MCDE).
There are three input parameters:
- Iterations: The numbers integration steps, i.e. how many iterations of the filter are to be performed.
- Time step: The appropriate time step value depends partially on the dimensionality of the image. Typical values are less than 0.250. A stable value for most 2 and 3d functions is 0.125. In general, you should keep the time step below 1/2^N, where N is the number of image dimensions.
- Conductance: The conductance controls the sensitivity of the diffusion. The smaller the value, the more features will be preserved while larger values will remove more features.
Median Filter
This is a smoothing filter which can be used to despeckle a volume. Each value in the new volume is the median of its neighbors in the old volume.
Input variable radius can be used to set radius of the kernel.
Discrete Gaussian Filter
Straightforward Gaussian blurring of the original data using discrete kernels.
The input variables set the variance and the radius of the Gaussian used in the kernel.
Canny Edge Detection Filter
This filter computes the edges using a Canny Edge Detection Filter (Canny, J. F. A computational approach to edge detection, IEEE PAMI 8(6), 679-698, November 1986).
This filter is composed of four steps:
- Smooth the input image with Gaussian filter.
- Calculate the second directional derivatives of the smoothed image.
- Non-Maximum Suppression: the zero-crossings of 2nd derivative are found, and the sign of third derivative is used to find the correct extrema.
- The hysteresis thresholding is applied to the gradient magnitude (multiplied with zero-crossings) of the smoothed image to find and link edges.
The input variables for the variance and maximum error are used in the Gaussian smoothing of the input image. See the Discrete Gaussian Filter for information on these parameters. The input threshold variable is the upper value for the hysteresis threshold, one half of that value is the lower threshold value.
To use the Canny edge detection filter on a volume, first select the Canny edge detection tool from the Advanced Filters menu. In the tools window, the Canny edge detection tool will appear, allowing you to select the layer to run the filter on, as well as an area to select the distance and minimum threshold. The distance is the distance between edges, and the threshold is the pixel intensity threshold for distinguishing edges. When the layer, distance and threshold have been selected, run the filter to create a new layer with the Canny edges displayed.
Gradient Magnitude Filter
The gradient magnitude is a measure of the rate of change in a data set, and is useful for emphasizing the boundaries of different materials.
To run this filter, select a data volume and then select the Gradient Magnitude Filter from the ITK menu. There are no parameters to set, so it will run automatically. The result is a new data volume that contains the gradient magnitude of the selected data.
Intensity Correction Filter
This filter helps to correct for the inhomogeneities often found in MRI images by suppressing low frequency background nonuniformities.
Histogram Equalization
This filter computes the histogram of the original data and then maps the data through the inverse of the histogram such that there is a maximum intensity spread. This can be a useful visual enhancement of the whole image.
Mask Data
This filter makes a copy of the data with the data minimum wherever the mask is not set. It requires a label volume to be set as the mask label.
Confidence Connected Filter
The Connected Filter selects adjacent voxels that are statistically similar to each other. It is used by selecting a data volume and the tool, then using the right mouse button to select seed points within the slice views. Once the seeds are selected, use the play button to create a new label volume (segmentation) by growing the seeds out among similar values.
Neighborhood Connected Filter
This is a flood-fill related brushing tool. Select a label volume and the neighborhood connected filter. This will activate a paint brush tool on the slice views. Paint in the area of interest and then select flood fill to expand the paint flood fill the selected region.
Otsu Threshold Filter
The Otsu Threshold filter attempts to cluster data values in a volume based upon how similar they are. To use the Otsu Threshold, first select the Otsu Threshold tool from the Data Filters menu. The tools window will then show the information on the Otsu Threshold tool. The target layer may be selected, and the number of thresholds can be selected, from zero to four different thresholding layers. Below the number of thresholds is the histogram representing the intensities of the pixels of the image. Once the filter is run, the resulting layers will appear in the layer view. There is a Wikipedia article containing a good description of what this filter computes.
Threshold Segmentation Level Set Filter
This is the itkThresholdSegmentationLevelSetFilter. It requires a data volume, a label volume with a seed area selected, and the GUI parameters about how to spread. The 'Start' button causes the filter to first calculate statistics about the data volume where the seed volume is set. Then the seed volume grows outward along data values that have similar characteristics. For example the user can paint a few relevant slices and then use this filter to grow the region between the slices. Or you can threshold conservatively to pick up blobs that you know are important, and then grow them outward to the regions which are most likely to also be important. This filter effectively runs forever so once the region has grown the desired amount the user must stop it with the cancel button. Also as a convenience the Brush Tool runs behind this filter so the user can paint on the current layer between start and stop operations to set the seeds. This filter currently does not reset when the user changes labels but rather keeps running off of the same one until it is closed. If you want to grow a new layer the workaround is to close the tool and then open it again.
Copy Label Filter
This makes a copy of the current label.
Label Invert Filter
The invert filter inverts a label volume. Select a label volume and then run the filter to invert it. It inverts in place rather than creating a new label.
Combine Labels with Logical And
This filter computes a new label that is the logical and operation on the currently selected label and the mask label. Logical and is the intersection of the two labels. This filter requires a mask label to be set.
Combine Labels with Logical Remove
This filter computes a new label that is the logical and not operation on the currently selected label and the mask label. Logical and not removes the mask label from the currently selected label (union with the inverse of the mask). This filter requires a mask label to be set.
Combine Labels with Logical Or
This filter computes a new label that is the logical or operation on the currently selected label and the mask label. Logical or is the union of the two labels. This filter requires a mask label to be set.
Combine Labels with Logical Xor
This filter computes a new label that is the logical xor operation on the currently selected label and the mask label. Logical xor is where one and only one of the two labels are located. This filter requires a mask label to be set.
Binary Dilate/Erode Filter
This filter is a binary morphological operation that works on labeled volumes. Select the label volume you want to dilate or erode and the open this tool. Set the radius and click the button for the operation you want to perform. Dilate expands the label by its radius and Erode reduces the label by its radius. Doing a Dilate followed by an Erode has a smoothing affect on the outer boundary of the label.
This filter can be applied to 3D volumes on either a slice-by-slice basis (2D) or on a volume basis (3D). This is useful when working anisotropic voxels where the Z spacing is different from the X-Y spacing.
Connected Component Filter
This filter flood fills the component containing a seed point out into it's own label. For example the user could otsu threshold the AA-Paw to pick out the bones but this results in some noise at one of the corners being selected as well. However running this filter with a seed point in the paw bone will result in just the bone being picked out. This filter can also make use of the mask label. Masks are not filled onto and can be used to limit what is selected. For example a head can be threshold filtered to pick out the skull, but the skull is attached to the interior at the base of the spine. Masking the base of the spine region and then placing a point in the skull would result in just the skull as the mask would stop the fill spread beyond the base of the spine. Prior to 1.10.0 this was the Flood Fill Copy Filter.
Fill Holes
This filter fills all the holes in a label volume. Select a label volume and then select this filter to fill all of the interior holes. It works by flood filling the outside region and then using that as a mask to set all the non-flood-filled region thus filling the holes. For now it determines the exterior as whatever lies at the 0,0,0 coordinate by default. The user can move the seed point around if desired.
Extract Label (deprecated)
This filter is no longer available. The same functionality can be achieved via Copy Label Filter or by File->Export Segmentation. This filter pulls a label volume out of a segmentation into it's own top level segmentation. It was needed for a collaborator's workflow and will most likely go away and be folded into a future volume pane change as it's not really a proper filter. Select a label volume and then select the Extract Label filter to copy it into a new segmentation.
Go back to Documentation