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 shortcut CTRL+O
  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.

Tilted grid with colored blob objects; left panel shows 'Blob Finder 2' and 'Segment Filter'

Loading the Python script

  1. Open Python Script Editor. From the Extra menu, select Script Editor.
    Menu bar 'Extras' 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.
    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

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.

Code screenshot showing commented copyright line: Copyright(c) 2021 arivis AG, Germany. All Rights Reserved.

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 3D slanted rectangular box on a 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 boxes edges not overlapped

  • 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 showing 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 showing TAG_SEGMENTS = ""
  • TAG_BOXES = defines the TAG assigned to the created boxes.
    Code line showing TAG_BOXES = "Boxes"
  • TAG_SEGMENTS = “”
    Tilted 3D wireframe containing colored square boxes in purple, cyan, yellow and green on black background
  • TAG_SEGMENTS = “Manual”
    Left: red segmented objects and large green rounded volume; right: wireframe box with multicolored grid and red arrow pointing right
    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, Hide Output Pane button, and filename Skeleton_RevB.py

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

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

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

Impressum
Carl-Zeiss-Strasse 22
73447 Oberkochen
Germany
Legal