12. Layers

FireVoxel document windows may contain multiple image layers, similarly to PhotoShop and similar image processing software. Layers are images of the same matrix dimensions and resolution (voxel size) overlaid on top of each other. Layers may be created by the user or by FireVoxel commands. Layers can be manipulated and transformed using various commands, moved between compatible documents (of the same resolution and matrix size), and exported to external files.

A document may contain different types of layers in various combinations. There is no (practical) limit on the number of layers, although with many high-resolution layers in the same document, processing may become slow.

12.1. Layer types

12.1.1. Image layers

Image layers contain 3D or 4D images created by medical imaging acquisitions. These images typically consist of voxels stored as 16-bit integers displayed as grayscale levels.

12.1.2. ROI layers

ROI layers (segmentation masks) are 3D or 4D images with binary values: 1 within selected areas and 0 elsewhere. The zero value voxels are transparent. The filled voxels have a uniform color and their opacity is set by the alpha value.

12.1.3. Real-valued layers

Results of arithmetic operations on images and parametric maps reside in real-valued data layers that are displayed in pseudocolor (color map). Their opacity is set by the alpha value.

12.2. Layer Control Panel

12.2.1. General description

Layer Control panel displays the layers in the document and their properties and allows the user to manipulate them with an array of command (Fig. 12.1).

To open the Layer Control panel, double-click anywhere on the document window. Layer Control is accessible only when there are images open in FireVoxel. The panel can be positioned anywhere on the screen, over the FireVoxel main window or outside. If several document windows are open, the Layer Control shows the layers in the active window; clicking another window makes the Layer Control panel display the layers in that window. The Layer Control can remain open while the user is working with several documents.

Layer Control Panel

Fig. 12.1 Layer Control Panel.

The top bar of the Layer Control panel displays the name of the active document window and the name and dimensions of the active layer, as well as the total number of visible layers.

The Layer Control panel displays the layers as a table, in which each row contains a layer and columns contain layer properties.

12.2.2. Layer name and renaming layers

Each layer is identified by its name. By default, image layers are named after the source images. ROI layers are named depending on the command that was used to create them (e.g., New ROI 3D creates layers named New ROI 3D #n, n=0, 1, 2…). To rename the layer, double-click its name, enter a new name in the text box that opens, and click OK.

12.2.3. Layer order and reordering layers

Layer Control displays the list of layers ordered from the deepest (base layer) at the top to the shallowest (closest to the viewer) at the bottom of the list. New layers are appended at the bottom of the list (that is, overlaid on top of the already existing layers). To reorder layers, click the layer name and drag it up or down on the list.

12.2.4. Active layer

The active layer highlighted in the Layer Control by a red border. The active layer can be manipulated and will be the one manipulated by default (e.g., ROI drawing will be done on the active layer). Many FireVoxel commands by default act on the active layer. To activate a layer, click on its name. If an action creates a new layer in a document, this new layer becomes active by default.

12.2.5. Layer visibility and Display Unmarked Layers

A check box in front of the layer name toggles the visibility of this layer. Unchecked layers become invisible. However, they can be made visible by checking Display Unmarked Layers box.

12.2.6. Mark\Unmark All

Marks on and off all layers. If some layers are unmarked, acts as Mark All. If all are marked, acts as Unmark All.

12.2.7. Color map and ROI layer color

A small square swatch next to the layer name shows the color map or ROI color. Color map are selected for acquired images or parametric maps. The ROI layer color is assigned by default when the ROI layer is created. The color map and the ROI color can be adjusted using ViewFilter option on the right hand side of the panel.

12.2.8. Transparency and Alpha slider

The first column after the layer name, labeled %, shows percent opacity of the layer, from fully transparent (0%) to fully opaque (100%). By default, image layers are 100% opaque and ROI layers are 20% opaque.

Alpha slider under the layer window allows changing the opacity of the active layer. Click and drag the slider to the left (towards 0%) to make the layer more transparent and to the right (towards 100%) to make it more opaque. Click on the slide to the left or right of the slider to decrease or increase the opacity in 20% increments.

12.2.9. Dynamic frames (#times)

The column labeled #times contains the number of dynamic frames in the layer. For 3D volumes, #times=1. For 4D images and ROIs, #times=number of frames.

12.2.10. Data type

The column labeled type shows the data type in the layer. Images are usually integer, parametric maps and other calculated layers are often real, ROI layers are labeled roi (binary images with voxels filled with 1s and 0s, with 0s fully transparent and 1s opacity given by the Alpha value).

12.3. Layer Control Commands

12.3.1. New ROI 3D

Create a new 3D ROI layer, which is appended at the bottom of the list of layers. The new ROI layer is named New ROI 3D #n, n=0, 1, 2… The color is assigned automatically from a sequence (red, blue, green, yellow, cyan, brown, etc.)

12.3.2. New ROI 4D

Create a new 4D ROI layer, appended at the bottom of the list and labeled New ROI 4D #n, n=0, 1, 2… The ROI size in the 4th (dynamic) dimension will be the same as the size of the base image.

12.3.3. Load DICOM

Opens browse for folder dialog to select a directory with DICOM documents. Once the folder is selected, the DICOM Tree panel is opened, as in File > Open DICOM command. Only DICOM documents with the same matrix size and resolution can be opened as a new layer. If the dimensions are incompatible, after the user clicks Load, a warning is displayed (Equal dimensions are expected) and loading files is canceled (Failed to add a new layer). If the images are compatible, Load adds them as a new layer and makes this layer active. The name of this layer will be the same as the name of the loaded DICOM images.

12.3.4. Load Image

Opens browse for file dialog allowing the user to select an image file in one of the compatible formats. The image is added as a new layer, named as the loaded file, which is made the active layer.

12.3.5. Duplicate

Duplicate the active layer. The new layer is added at the bottom of the list and named as the active layer with added _copy suffix. Both image layers and ROI layers can be duplicated.

12.3.6. Save DICOM

Save the active layer as DICOM. Opens browse for folder dialog to save the active layer as DICOM document.

12.3.7. Save Image and Save All

Save the active layer as image in one of the compatible formats. Opens file save dialog to export the active layer. Save All saves each visible layer in the document as a separate image.

12.3.8. Remove

Removes unmarked (unchecked) layers after asking the user to confirm this action (Remove all unmarked layers?). If all layers are checked, removes the active layer, also after user’s confirmation (Remove Active Layer?).

View Filter

Fig. 12.2 View Filter panel.

12.3.9. ViewFilter

Opens display options depending on the layer type:

  • For image layers (integer or real valued): grayscale or color map selection panel;

  • For ROI layers: color picker panel.

For image layers, Color Mapping radio buttons can be used to select gray scale (Color Mapping: None) or one of 8 available color maps (Fig. 12.2).

The corresponding color bar is shown on the left, with numbers indicating upper and lower limits, center, as well as the first and third quartiles. Checking Invert Scale check box reverses the order of the colors between the upper and lower limits.

The Level-Width text boxes show values of the window level (color scale center) and width (the range between the lower and upper limits). The window level and width values can be changed by entering new numbers into the respective boxes or by using the up and down arrows next to the text boxes, with the changes taking effect instantly. Clicking Default restores the default values of level and width.

12.3.10. Info

Opens Full DICOM Info panel with header information for the selected layer (Fig. 12.3).

The panel consists of 3 parts: Data Header, Element Value, and selected tags. Data Header part shows a list of header tags. Clicking each tag shows its value in the Element Value window. The selected tags part shows image properties: Name, modality, rows, columns, etc. Clicking Copy Info to Clipboard copies the information from the selected tags panel that can be then pasted into a text file and saved.

Layer Info Panel

Fig. 12.3 Layer Info Panel.

12.3.11. ROI Stats 3D

Opens ROI Stats 3D panel with statistics of the image within the ROI (Fig. 12.4).

ROI Stats 3D Panel

Fig. 12.4 ROI Stats 3D Panel.

The panel consists of the following parts:

  • Histogram – Bar plot of the distribution of voxel values and histogram controls. Controls are checkboxes and buttons that open small panels for entering values.

    Histogram Controls – Bin Width, Number of Bins (N_Bins), Range ([Min, Max]). Bin Width = (Max- Min)/N_ Bins

    For a fixed Range, Bin Width and Number of Bins are automatically adjusted if one or the other is changed. If Range is adjusted, then the Number of Bins is adjusted, but Bin Width remains fixed. ADD DETAILS

  • Full – Use the entire Range to display the histogram and calculate statistics.

  • Clip – Use values only within Range and discard the rest from display and calculation of statistics.

  • Percent (%) – Sets the lowest and highest percent values; full range from 0% to 100% by default.

  • First order features – Range and first-order moments of voxel value distribution ([Min, Max], mean, standard deviation, variance, inhomogeneity, skewness, kurtosis, and entropy) and percentiles (1, 5, 10, 25, 50, 75, 90, 95%).

  • Geometrical features – Voxel count (number of voxels in ROI), volume (ROI volume, cm3), void voxel count (number of zero-valued voxels), num blobs (number of blobs, or separate ROI sub-regions), blob mean, blob stdev, nonuniformity.

  • Segmentation\Modeling – Options to identify segments within the distribution. Used for segmentation of ROIs into subregions. ADD DETAILS

    • Method – Otsu, Zigalga, Bimodal Gauss with Ratio, Bimodal Laplace with Ratio, Bimodal Gauss PVV, Bimodal Laplace PVV, Air Threshold

    • Number of segments

    • Show model – None, All Curves, Cumulative

    • Thresholds

    • Update – Recalculate and display results

  • Save Stats – Create RoiStats3D.txt file with the summary statistics (ROI stats – Volume, Signal Min & Max, Histogram stats and histogram (Bin/Signal/Count). By default, the file is saved in FireVoxel Temp folder.

12.3.12. ROI Stats 4D

Opens ROI Stats 4D panel for a dynamic experiment (Fig. 12.5). The left side of the panel displays the plot of the average values within the ROI versus the dynamic dimension (time, b-value, echo time, etc.). The axes show the name of the variable plotted and the minimum and maximum values.

ROI Stats 4D Panel

Fig. 12.5 ROI Stats 4D Panel.

The right side of the panel shows display options and commands:

  • Display:

    • All layers – Check box allowing to plot values within all visible ROI layers. Each ROI’s data will be shown in the color of the ROI layer.

    • Median-onAverage-off – Displays the median value instead of the average?

    • Label – Name of the ROI with the ROI volume in mm3 (e.g., ROI1_1000mm3)

    • Skip Start Timepoints and Skip End Timepoints – Text boxes allowing entering the number of points to be hidden in the beginning and end of the dynamic series.

  • Commands:

    • Go to Peak – TBA

    • Go to Bolus Arrival – TBA

    • Background – Color selector allowing to change the plot background

    • Gamma-variate fit – Opens Parametric Map calculation for fitting the curve with a gamma-variate fit (for input functions)

    • Save – Open file save dialog for saving the plotted curve (time activity curve) as a text file. The file contains: curve label (from above), and tab-delimited columns (with column headers) – dynamic coordinate (e.g., time (sec)), avgVal – average signal value in the ROI, and vol_cm3.

    • Copy to clipboard – Copies the same information to clipboard for pasting into a spreadsheet or another document.

12.3.13. Attributes

Opens a panel for entering tissue T1-value (in sec).

12.3.14. Operation

Opens Layer Operations panel for pairwise operations on layers (Fig. 12.6):

Layer Operations Panel

Fig. 12.6 Layer Operations Panel.

  • Binary Operations (for ROI layers)

    • Intersect: A \wedge B

    • Union: A \vee B

    • NOT: \widetilde{A}

    • A AND (NOT B): A \wedge \widetilde{B}

    • XOR: Exclusive OR

  • Arithmetic Operations (for image and parametric map layers)

    • Abs(Diff): \lvert A – B \rvert

    • Max(0,Diff): Areas of maximum difference. ADD DETAILS

To use Layer Operations, mark two layers and unmark the rest, click Operation and then select the appropriate operation. A new layer will be created with the result of the operation, labeled [operation] result (e.g., union result).

If the user selects an operation that does not match the type of selected layers, an error message will be shown (ROI is required in this operation for binary operations or ROI is not allowed in this operation for arithmetic operations). If more than two layers are selected, an error message will be shown (Invalid number of operands for this operation). In these cases, the operation will not be performed and no new layers will be created.

12.4. Copy layers between compatible documents

Layer Control panel can be used to copy layers between layers of the same matrix dimensions and voxel size. To copy a layer from Document 1 to Document 2, open both documents in FireVoxel, open Layer Control, and click Document 1 to activate it. Next, in the Layer Control panel, click the layer of interest, and drag it anywhere over Document 2 and drop it. To verify that the layer has been copied, click Document 2 window and inspect the list of layers in the Layer Control panel. The copied layer should be added at the bottom of the list of layers. All types of layers can be copied using this method.

Alternatively, click Document 1, activate the layer in Layer Control and save it using Save Image, for example, in NIfTI format (.nii extension). Next, click Document 2, and use Load Image in Layer Control to select the just saved layer. The loaded layer will be added to the bottom of the list of layers. The name of the layer will be identical to the name of the file, including the .nii extension.