ZEISS Microscopy Knowledge Base
Help
ZEISS Microscopy Knowledge Base

Creating freely XY oriented sub volumes

This guide explains how to create a sampling volume (ROI) freely oriented along X and Y axis.

The application uses a Python script to create single or contiguous sub-regions that can be used as ROI for further analysis. 

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

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'

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 Script Editor.
    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
Python code screenshot showing red-outlined USER SETTINGS block with TAG_DESCRIPTOR 'Manual', FIRST_PLANE 3, LAST_PLANE 10
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.

USER SETTINGS code: TAG_DESCRIPTOR="Manual", FIRST_PLANE=3, LAST_PLANE=10, COMPUTE_MAIN_BOX=False

  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
  4. SIZE_IN_VOXELS defines if the size of the Sub-Volume is expressed in metric unit (True) or it is calculated from the reference ROI size (False).
    Text lines: SIZE_IN_VOXELS = False, SIZE_BOX_HOR = 10.0, SIZE_BOX_VER = 30.0
  5. SIZE_BOX_HOR and SIZE_BOX_VER defines the Sub-Volume XY size in microns. The sizes are referred to a single box.
    SIZE_IN_VOXELS must be True to create the box in microns.
    Note: NUM_BOX_LENGHT and NUM_BOX_WIDTH are also involved in the metric Sub- Volume creation.
    Examples:
    SIZE_IN_VOXELS = True
    NUM_BOX_LENGHT = 1
    NUM_BOX_WIDTH = 1
    SIZE_BOX_HOR = 10 (microns)
    SIZE_BOX_VER = 30 (microns)
    Long teal rectangular slab divided into equal segments on black background
    SIZE_IN_VOXELS = True
    NUM_BOX_LENGHT = 3
    NUM_BOX_WIDTH = 2
    SIZE_BOX_HOR = 5 (microns)
    SIZE_BOX_VER = 10 (microns)
    Six colored rectangular blocks arranged in two rows on a black background

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