:topic: Color Mapping Controls .. index:: triple: DREAM3D-NX; Quad View; Color Mapping .. _QuadViewColorMapping: Color Mapping Controls ####################### **In this section we describe how to configure the data array coloring and slab projection settings in the Quad View module.** The **Controls Panel** on the right side of the Quad View module provides a set of controls for selecting which data array to display, how to map it to color and opacity, and how each slice plane is projected. All four windows use the same color mapping simultaneously. .. figure:: Images/40_ColorMapping/ColorMappingControls.png :alt: Color Mapping Controls Color Mapping Controls in the Controls Panel Thick Slab Mode ================= The **Thick Slab** checkbox enables slab projection mode in Windows 2–4. Instead of displaying a single thin slice through the data, each window renders a projection through a slab of voxels, which can reveal features that are not fully visible in a single slice. When **Thick Slab** is enabled, three blend mode options become available to control how values are combined across the slab depth: - **Mean Blend**: Each pixel shows the average value of all voxels sampled along the projection ray through the slab. - **Min Intensity Blend**: Each pixel shows the minimum value encountered along the projection ray. This is useful for highlighting low-intensity structures. - **Max Intensity Blend**: Each pixel shows the maximum value encountered along the projection ray. This is commonly used in medical imaging to highlight high-intensity structures such as bright vessels. Data Array Selection ====================== The **Array** drop-down selects which cell data array in the loaded geometry is used for coloring the slice planes and volume rendering. Only arrays associated with the geometry's cell data are listed. The **Component** drop-down selects which component of the array is displayed. For single-component (scalar) arrays this shows ``Scalar``. For multi-component arrays (for example, vector or tensor data) the drop-down lists: - **Magnitude** as the first entry — selecting it computes :math:`\sqrt{\sum_i c_i^2}` over all components per voxel and uses the resulting scalar field for coloring and volume rendering. - Each individual component, listed by index, so a single component can be selected for display. .. figure:: Images/40_ColorMapping/ArrayComponentDropdowns.png :alt: Array and Component Drop-Down Selectors Array and Component Selectors .. figure:: Images/40_ColorMapping/MagnitudeComponentOption.png :alt: Magnitude Component Option Component drop-down expanded for a multi-component array, with Magnitude shown as the first entry above the per-component indices. .. note:: When switching between arrays the per-array color preset, opacity transfer function, and custom data range are preserved. Returning to a previously displayed array restores its color customizations without re-applying defaults. Color Preset Toolbar ====================== Below the array and component selectors is a row of action buttons for managing the color transfer function: - **Reset** (|reset|): Reverts the color and opacity transfer function to the default state for the current color preset. - **Edit** (|colorpreset|): Opens the **Select Preset** dialog so you can browse and apply a named color preset (for example, *2hot*, *Black-Body Radiation*, *Blue Orange*) to the color map. Favorite presets can be starred for quick access and filtered via the search bar at the top of the dialog. .. figure:: Images/40_ColorMapping/ColorPresetPicker.png :alt: Select Preset Dialog The Select Preset dialog opened by the **Edit** button. - **Invert** (|invert|): A toggle button. When active (pressed), the currently selected color map is reversed so that the minimum value maps to the color that would normally correspond to the maximum, and vice versa. Click the button again to release it and restore the original color map order. - **Scale to Data** (|scaletodata|): Sets the data range minimum and maximum to the actual minimum and maximum values found in the selected array and component across the full dataset. .. figure:: Images/40_ColorMapping/ColorPresetToolbar.png :alt: Color Preset Toolbar Color Preset Toolbar Opacity and Color Transfer Function Editor ============================================ The large interactive graph in the Controls Panel combines three elements into a single view: - **Histogram bars** showing the distribution of voxel values in the active data array. The bars are colored according to the active color map so that the relationship between value and color is immediately visible. - **Opacity curve** (a line with draggable control points) mapping each data value to an opacity level (0 = fully transparent, 1 = fully opaque). - **Color gradient bar** (bottom strip) showing the current color transfer function, with draggable color control points. .. figure:: Images/40_ColorMapping/TransferFunctionEditor.png :alt: Opacity and Color Transfer Function Editor The Histogram, Opacity Curve, and Color Bar The **?** button above the editor opens its navigation help without covering the histogram. Use **Alt/Option + scroll wheel** to zoom around the pointer (a plain wheel is passed to the surrounding Controls Panel), or use **Ctrl/Command+=** and **Ctrl/Command+-** to zoom around the chart center. Left-drag empty chart space to pan. Right-click for **Zoom In**, **Zoom Out**, **Reset View to Data**, **Box Zoom Mode**, and **Reset Min/Max**. Press **Z** to enter Box Zoom (shown by a mode label and crosshair cursor), drag a selection rectangle, and press **Escape** to cancel. A successful selection automatically returns to Pan mode; a selection that is too small leaves Box Zoom active for another attempt. Editable points and range handles take priority when the pointer is over them, and editing is suspended while Box Zoom is active. Opacity Curve Interaction --------------------------- **Add a control point** Double-click in the histogram area at the desired data value and opacity level. A new control point is inserted. **Move a control point** Left-click and drag a control point. Interior points can be moved both horizontally (data value) and vertically (opacity). The first and last points are locked horizontally and can only be moved vertically. **Remove a control point** Middle-click on a control point to remove it. The first and last points cannot be removed. Color Bar Interaction ----------------------- **Add a color control point** Double-click in an empty area of the color bar. A new point is created at the clicked position and a color picker dialog opens so you can choose its color. If you cancel the dialog, the point is removed. **Edit a color control point** Double-click on an existing color control point to open the color picker and change its color. **Select a color control point** Single-click on a color control point to select it (shown with a blue highlight ring). Press **Enter** or **Return** to open the color picker for the selected point. **Remove a color control point** Select the point then press **Delete** or **Backspace**, or middle-click the point. The first and last color points cannot be removed. A minimum of two color points is always maintained. **Deselect** Left-click (without dragging) on empty space in the histogram area to deselect the currently selected color point. Range Lines (Custom Data Range) --------------------------------- Two vertical yellow lines with triangular handles at the top of the histogram define the active data range. The region outside the range lines is dimmed. Dragging a range line rescales the color and opacity mapping so that the full color gradient is compressed into the range defined by the two lines. **Drag a range line** Left-click and drag one of the yellow handles or lines to adjust the minimum or maximum of the custom range. All four windows update in real time as you drag. **Reset range** Right-click the histogram and select **Reset Min/Max** to restore the range lines to the full data extent. Keyboard and Mouse Reference ------------------------------ The following table summarizes all mouse and keyboard interactions in the histogram/opacity editor: +-------------------------------+----------------------------------------------------+ | Input | Action | +===============================+====================================================+ | Left-click + drag point | Move an opacity or color control point | +-------------------------------+----------------------------------------------------+ | Left-click + drag range line | Adjust custom data range boundary | +-------------------------------+----------------------------------------------------+ | Left-click + drag empty space | Pan the visible histogram range | +-------------------------------+----------------------------------------------------+ | **Alt/Option** + scroll wheel | Zoom the histogram view in/out (centered on | | | cursor position) | +-------------------------------+----------------------------------------------------+ | **Ctrl/Command+=** or **+** | Zoom in around the chart center | +-------------------------------+----------------------------------------------------+ | **Ctrl/Command+-** | Zoom out around the chart center | +-------------------------------+----------------------------------------------------+ | **Z** | Toggle Box Zoom Mode | +-------------------------------+----------------------------------------------------+ | Left-drag in Box Zoom | Zoom to the selected rectangle, then return to Pan | +-------------------------------+----------------------------------------------------+ | **Escape** | Cancel Box Zoom and restore Pan mode | +-------------------------------+----------------------------------------------------+ | Double-click histogram area | Add a new opacity control point | +-------------------------------+----------------------------------------------------+ | Double-click color bar | Add a new color control point (opens color picker) | +-------------------------------+----------------------------------------------------+ | Double-click color point | Edit color of existing point (opens color picker) | +-------------------------------+----------------------------------------------------+ | Middle-click on point | Remove an opacity or color control point | +-------------------------------+----------------------------------------------------+ | **Delete** / **Backspace** | Remove the selected color control point | +-------------------------------+----------------------------------------------------+ | **Enter** / **Return** | Open color picker for selected color point | +-------------------------------+----------------------------------------------------+ | Left-click empty space | Deselect the selected color point | +-------------------------------+----------------------------------------------------+ | Right-click | Open the navigation and range context menu | +-------------------------------+----------------------------------------------------+ **Reset View to Data** restores navigation zoom and pan. **Reset Min/Max** separately restores the yellow editable range handles to the full data extent. Hovering over histogram bars shows the data value and bin count at the pointer. .. note:: While the editor or its help popup has keyboard focus, **Ctrl/Command+=** and **Ctrl/Command+-** control chart zoom instead of the application font size. .. |colorpreset| image:: Images/40_ColorMapping/Preset.svg .. |invert| image:: Images/40_ColorMapping/invert.svg .. |scaletodata| image:: Images/40_ColorMapping/ScaleToData.svg .. |reset| image:: Images/40_ColorMapping/Reset.svg