ZEISS Microscopy Knowledge Base
Help
ZEISS Microscopy Knowledge Base

Creating XYZ matrix of sub-volumes

This guide explains how to create a sampling volume (ROI) as a XYZ matrix of boxes. The application uses a Python script to create single or contiguous sub-regions that can be used as ROI for further analysis. The unique limit is related to the sampling volume shape. Only regular 3D boxes are available.

Opening the working dataset

  1. Select Open... from the file menu.
    File menu showing Open... option highlighted with CTRL+O shortcut
  2. Select the dataset from the file browser.
    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)​.
    Note: The dataset is visualized according to the current rendering setting parameters. Refer to the arivis Pro Help for more details.

Software GUI with 3D volumetric rendering of green and red segmented objects on a grid, left-side tool panels and color scale

Loading the Python script

  1. Open Python Script Editor. From the Extra menu, select Script Editor.
    Extras menu dropdown listing Preferences..., Plug-in Manager, Task Monitor, Run Script..., Script Editor
  2. Load the Divide_Scope Python Script.
    Note: The script name can change according to the new version released. The latest script is: DivideScope RevE (3_4).py.
    Script Editor - Script1 title bar showing menus File, Edit, View, Script
  3. Browse the folder on which the file has been saved.
    File menu with 'Open...  Ctrl+O' highlighted, 'New  Ctrl+N' above, 'Open Sample' and 'Close  Ctrl+F4' below

Python script code usage rights:The user has the permission to use, modify and distribute this code, as long as this copyright notice remains part of the code itself: Copyright(c) 2021 arivis AG, Germany. All Rights Reserved.

Commented script header showing 'NAME: Divide Scope' and highlighted 'Copyright(c) 2021 arivis AG, Germany.'

Setting the script features

In order 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.

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.

Code snippet showing SIZE_BOX_X = 2000.0 SIZE_BOX_Y = 2000.0 SIZE_BOX_Z = 700.0Magenta rotated rectangular prism on black background

  • SIZE_BOX_X = the X axis size of each box . The value is expressed in µm.
  • SIZE_BOX_Y = the Y axis size of each box . The value is expressed in µm.
  • SIZE_BOX_Z = the Z axis size of each box . The value is expressed in µm.

Code snippet with PRESERVE_EDGES = True and comment about OPTION_PRESERVE_EDGES

  • PRESERVE_EDGES = This option sets the boxes touching / non touching feature. If TRUE, the boxes edges are not contiguous to each other (2 pixels space in between).
    Note: The volume sizes (XYZ) are divided by the single box XYZ size. The integer number of boxes fitting in the volume is computed. It may happen that the boxes don't cover the whole sample volume.

Code lines with TAG_SEGMENTS = "Manual" and TAG_BOXES = "Heatmap"

  • TAG_SEGMENTS = defines the segments TAG to be used to compute the boxes. It is used as alternative of the standard method (whole volume). If empty, the default method (whole volume) is used.
    Code line showing TAG_SEGMENTS = ""
  • TAG_BOXES = defines the TAG assigned to the created boxes.
    Code screenshot showing TAG_BOXES = "Boxes"
  • TAG_SEGMENTS = “”
    3D colored grid of square boxes on black background
  • TAG_SEGMENTS = “Manual”
    Two-panel image: left green object and red structures; right red arrow to 3D colored box grid with red structures
    Note: If the TAG_SEGMENTS is set to an existing TAG, all the objects belonging to it are used to create the boxes matrix. Specifically, the bounding box volume of each object is taken as the reference volume that is divided into boxes.

Running the Python script

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

Toolbar with Run Script button and Hide Output Pane, tabs labeled Skeketon_RevB.py and Free-Oriented Sub-...

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

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

Toolbar with Run Script button and Show Output Pane option

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

Impressum
Carl-Zeiss-Strasse 22
73447 Oberkochen
Germany
Legal