ZEISS Microscopy Knowledge Base
Help
ZEISS Microscopy Knowledge Base

Performing objects density (heat-map) and object distribution gradient plotting (profile)

This guide explains how to perform the Objects density distribution analysis per volume unit (heat-map).

The same workflow can be used to evaluate the Objects count' distribution gradient along a specific direction (gradient profile). The application uses a Python script to create the contiguous sub-regions (sampling volume) and a pipeline to count the objects and to compute its density per volume unit (single sub-region) or the distribution along the longest direction of the sub-regions structure.

The evaluated Objects can be any biological structures like Cells, Nuclei, Neurons, as well as any small structures like Vesicles, Protein clusters, Mitochondria, and etcetera. The sampling volume can describe and limiting any anatomical regions inside the sample.

The unique limits is related to the sampling volume shape, only regular 3D boxes are available.

Tilted multicolored segmented rectangle with green speckles inside and two green clusters below on black background

Opening the working dataset

  1. Select the Open... item from the file menu.
    File menu showing Open... option highlighted with shortcut CTRL+O
  2. Select the dataset from the file browser.
    Note: The dataset is visualized according to the current rendering setting parameters. Refer to the arivis Pro Help for more details.

Software window showing 3D grid with three green volumes with red and blue spots and a left-side control panel

The dataset is a multi dimensional, discrete, representation of your real sample volume. It can be structured as a Z series of planes (Optical sectioning) of multiple channels (dyes) in a temporal sequence of time points (located in several spatial positions).​
Usually, the dataset shows a single experimental situation (a complete experiment can be composed by several datasets). The datasets are available as graphic files saved in plenty of file formats (standard formats as well as proprietary formats)​.

Drawing the reference ROI

  1. Switch the Viewing area from 4D to 2D view mode.
    Toolbar with icons: blue rectangle, grid, cube, information 'i', and presentation screen
  2. Select the Draw Objects tool.
    Toolbar with pointer cursor, yellow circle icon, hand icon, circular arrow and blue tool icon
  3. Select the Brush tool.
    Toolbar with save disk, close X, undo arrow, cursor and drawing tool icons
  4. Draw the 2D ROI over any Z plane. Use the Erase Brush to correct the ROI if necessary.
    Black background with clustered red circular spots and a large translucent blue elongated shape outlined in cyan
  5. Press the green icon to confirm the ROI.
    Small toolbar with new document icon, green check mark and red X
    Red elongated rounded ROI inside a white rectangular selection over blue and red speckled circular spots
    The TAG Manual is now available in the data table.
    Tag panel showing Tags: 1 and a checked Manual checkbox

Loading the Python script

  1. Open Python Script Editor. From the Extra menu, select the Script Editor item.
    Menu bar 'Extras' dropdown listing Preferences..., Plug-in Manager, Task Monitor, Run Script..., Script Editor
  2. Load the Free-Oriented Sub-volume Python Script.
    Window title 'Script Editor - Script1' with menu items File Edit View Script
  3. Browse the folder on which the file has been saved.
    File menu with 'Open... Ctrl+O' highlighted and items New Ctrl+N, Open Sample, Close Ctrl+F4
Screenshot of Python script showing header, imports (arivis, numpy, skimage) and USER SETTINGS INPUT_CHANNEL=4
Python script code overview

Only the parameters located in the USER SETTING area can be modified. Don’t change any other number, definition or text in the code outside this dedicated area.

Setting the script features

To define the contiguous sub-regions (sampling volume) features, few parameters of the script should be adjusted to match your analysis needs. These parameters are located in the code area labeled as USER SETTING.

Code screenshot: USER SETTINGS — FIRST_PLANE=-1, LAST_PLANE=-1, COMPUTE_MAIN_BOX=False, NUM_BOX_LENGHT=14, NUM_BOX_WIDTH=2

  1. Set the Z planes range.
    FIRST_PLANE defines the lower Z plane of the sub-regions ROI.
    LAST_PLANE defines the higher Z plane of the sub-regions ROI.
    The values of -1 set the Z planes range equal to the whole volume depth (total number of Z Planes available).
    Diagonal row of translucent colored rectangular boxes with scattered blue point cloud on black background
  2. COMPUTE_MAIN_BOX = True enables the creation of an additional ROI having the same sizes of the total subregions ROI size.
    Code snippet showing COMPUTE_MAIN_BOX = False
  3. NUM_BOX_LENGHT defines the number of sub-regions along the main axis (the longest one). NUM_BOX_WIDTH defines the number of sub-regions along the minor axis (the shortest one).
    Code snippet showing NUM_BOX_LENGHT = 14 and NUM_BOX_WIDTH = 2
    Note: Set the number of sub-regions accordingly to the total size of the reference ROI. Don’t create boxes too small.

Examples:

NUM_BOX_LENGHT = 10
NUM_BOX_WIDTH = 1

Stacked colored rectangular boxes arranged diagonally with scattered blue dot points on black background

NUM_BOX_LENGHT = 10
NUM_BOX_WIDTH = 2

Multicolored segmented rectangular prism on black background with scattered blue dots

Running the Python script

Run the Free-Oriented Sub-volume Python Script pressing the Run Script button or pressing the F5 key.

Toolbar with Run Script button, Hide Output Pane button, and filename Skeleton_RevB.py

Context menu showing Run Script F5 and Run File CTRL+F5

Note: Activate, if not already displayed, the Output Panel. The status of the script execution (errors including) will be visualized here.

Toolbar with Run Script button and Show Output Pane

Script output panel showing starting script..., Script is running..., time: 1.34400010109, script finished.

Building the analysis Pipeline

The pipeline have to be created according to the user analysis requirements as well as the sample typology. The sample labeling, the imaging technique (Fluorescence, EM, Tomography, bright-field ...) and the image characteristics are important to drive the pipeline setup. The knowledge of the biological structures under evaluation, it’s behavior and the expected features' trend are also important as well. All the above information should be used to build a target driven pipeline. The achieve the application note goals, only a couple of operators are mandatory. As described here below.

Flowchart 'Typical Pipeline workflow' with left operator blocks and right boxes 'Input ROI', 'Import Document Objects', 'Store Objects'.

The Operators are grouped in several categories. Each category includes the functions that perform specific tasks, ordered by their usage. Here below a short summary.

Purpose

Application

Voxels Operator

The group includes the operators that interact directly with the voxels. Typically, spatial filters, Intensity normalization, intensity range equalization and so on.

Sample Noise removal, background subtraction, Intensity disomogenity correction, details enhancement, edges detection (e.g. membrane), morphological math.

Segmenter Generation

The group includes the threshold operators used to detect and create the segments. Automatic and manual method, machine learning approach, watershed and proprietary algorithms are available.

Structures identification. Nuclei, Neurons, small spots (Blob Finder), Cells, Vessels, Filaments (Watershed, Region Growing) or microstructures (Machine learning) can be detected using the appropriate method or a combination of them.

Segmenter Operators

The group includes the operators that interact directly with the segments. Feature filtering, morphology, Compartmentalization, distance measurements and more can be applied.

Objects colocalization, object classification by features, objects merging or splitting, objects grouping, objects parent/child relationship and even more.

  1. Change the Input ROI operator parameters.
    Input ROI panel: ROI 'Current time point', Channels '[all channels]', Scaling '100 %', Include Z checkbox
  2. Sets the processing and analysis target space.
    Dropdown list showing options: Current View, Current Plane, Current Time Point, Current Image Set, Custom.
    Current View: The selected Z plane and the viewer area are processed.
    Current Plane: The selected Z plane is processed (XY).
    Current Time Point: The selected time point is processed (XYZ).
    Current Image Set: The complete dataset (XYZ and time) is processed.
    Custom: Allows to mix the previous methods.
    Note: Use the Custom option during the pipeline setting and testing. Set a sub volume (XY, Planes, Time Points, channels) of your dataset on which perform the trial. This will speed up the setting process.
  3. Expand the Input ROI dialog.
    Small chevron icon.
    Input ROI dialog showing ROI: Custom; Bounds: 0,0,512,512; Planes: 1-13; Time points: 1; Image set: T099_Gfp+24hdoc_mis.ims
    Bounds: Sets the analysis area edges. The whole XY bounds, the viewing area or a custom space can be applied.
    Planes: Sets the analysis planes range. A single plane, a range of planes or the whole stack can be selected.
    Time Points: Sets the analysis time points range. A single TP, a range of TPs or the whole movie can be selected.
  4. Channels: Sets the processing and analysis target channels. Selecting a single channel, all the operators in the pipeline will be forced to use it.
    Scaling: It scale the dataset reducing the size.​ The measurements will not be modified by the scaling factor.​
    Input ROI panel: ROI 'Current time point', Channels '[all channels]', Scaling '100 %', Include Z checkbox
  5. Set the Import Document Objects operator and select the TAG filter.
    Small square button with two small centered dots
  6. Click on the Manual TAG.​
    Panel titled 'Import Document Objects' with 'Tag filter:' field and 'Preserve tags on import' checkbox
  7. Use the right arrow button to move the TAG on the right table​.
    Software Input ROI panel showing ROI set to 'Current view', Channels '[all channels]', Scaling 100%
    Dialog titled 'Select tags' showing 'Available Tags' list with 'Manual' and arrow buttons
  8. Add or remove optional operators inside the pipeline.
    Analysis Operations showing 'Voxel operations' and 'Segment generation' lists including Blob Finder and Watershed
    The Analysis Pipeline panel consists of two main areas. The Pipeline area and the analysis operations list area.​
    Gray X icon button on a light square background
    The Operators can be added to Pipeline in two ways:
  9. Double click on the Operator you wish to add to the current Pipeline. The Operator will be inserted at the end of the group of operations to which it belongs. Voxel Operations are positioned before the Segment generation meanwhile Store operations are put always at the end of the Pipeline.
  10. Drag and drop the Operator you wish to add to the current Pipeline. The Operator will be automatically inserted in any place within the group of operations to which it belongs. The Operator cannot be added during the Pipeline execution.
  11. To remove an Operator from the Pipeline, press the X button located in the right side of the operator title bar.
    Grayscale toolbar with four square buttons: diagonal-slash rectangle, up chevron, three horizontal lines, and an X.

Refer to the arivis Pro Help for more details.

Running the analysis Pipeline

The pipeline can be executed step by step (back and forth). This method allows to run and undo a single Operation. Either the arrow buttons or the Operation list can be used to go through the operators list.

Toolbar reading Detect Cells or Particles with left arrow, curved arrow, dropdown triangle, blue play triangle, gray stop square

  1. Run the single operator.
    Curved black arrow icon pointing up-right on light background
  2. Optional: Undo the single operator.
    Curved black arrow icon pointing left on light background
    Note: Undo the last operator executed if you need to change the operator settings.
  3. Run the whole pipeline with no pauses.
    Blue right-pointing triangle play icon on light background
  4. Optional: Stop the pipeline execution.
    Gray square stop icon on light background

This icon, located on the right side of the operator title bar, shows the operator status.

Task running:
Gray toolbar with green square, blue icon with white circular arrow, up caret, hamburger menu, blue circular arrow

Task completed:
Toolbar with left curved arrow, blue square icon with white corner arrow, up caret, hamburger menu, green checkmark

Viewing the results

  1. Results (segments and measurements) will be stored in the dataset only if the Store Objects operator has been correctly set. Tick the option as shown below before complete the pipeline execution.
    Dialog titled Store Objects with 'Store all inputs:' and checked boxes for Segment Filter and Compartments
  1. Open the data table if not already visible.
    Menu bar showing File Extras Window Help and a row of toolbar icons including pen, wand, globe, flask
  2. Measurements are now visible in the data table​.
    Data table listing Segment #014–#020 with counts 20,33,11,21,17,5 and sum volume stats like 9,356;14,137;5,204
    Note: The spots count in the single sub-region is shown in the data table.​ The empty sub-regions are not listed.​ To get the total spots count the group statistic feature must be used. ​
    Tilted multicolored segmented rectangle with green specks, above two separate green clusters on a black background
    Small toolbar with 'Feature Columns...' button and a 'Single' view toggle

Features can be added or removed from the data table using the Feature Column command.

Impressum
Carl-Zeiss-Strasse 22
73447 Oberkochen
Germany
Legal