Tools - DigitalHolography/Holovibes GitHub Wiki

Dev.py tools

The script works like a makefile using goals to run.

Goal Description
install install the c++ packages needed by the project and put all the cmake files to find the packages in the build dir.
cmake cmake configure step and reconfigure step (will run conan if no build dir is found).
build using the generator chosen during previous step (will run cmake if no build dir is found).
run run the latest generated executable.
pytest run integration tests using pytest.
build_ref build reference outputs for integration tests (run it only if you know for sure that it's stable.)
clean remove the build folder and the generated outputs of the integration tests.

You can run ./dev.py --help for more options.

Holo file inspector

Allow to view the header and extract/change parameters inside a .holo file. The tools can be downloaded at each releases.

The format of these files can be found here.

Benchmarking

It's a way to compare the performance of different versions of the project. It's important to run it before creating a new release. Create the [AppData]/Holovibe/[version]/benchmark folder (if it doesn't exist), benchmarking csv will be saved in this folder. Then do a clean compile in debug mode and run

dev.py run --benchmark

To compare two benchmark files use the Benchmark viewer

[!IMPORTANT] You are invited to improve the protocol, the benchmark informations gathering in the Information Worker and the BenchmarkViewer file.

Holovibes Python scripts

[!NOTE] Requirements:

  • Install python3.
  • Run pip install -r requirements.txt.

[!TIP] It is recommended to move the python/ folder from Holovibes installation directory (usually C:/Program Files/Holovibes/X.X.X/) to another place to avoid permissions issues.

convert_holo.py

From To Command
.holo .avi python3 convert_holo.py input.holo output.avi
.holo .mp4 python3 convert_holo.py input.holo output.mp4
.holo .raw python3 convert_holo.py input.holo output.raw
.raw .holo python3 convert_holo.py input.raw output.holo

[!NOTE]

  • For .avi and .mp4 you can specify the output video FPS (by default 20) with --fps 30.
  • When creating a .holo from a .raw the program will prompt the user mandatory parameters: width, height, bytes per pixel and number of frames.

add_missing_compute_settings.py

Use this script to add/remove compute_settings from .holo and .json when changes have been made in the code.

In order to add and remove keys, modify the dictionary new_key_values in the file. Here an example :

directory_path = '.'  # Change this to the directory where your JSON files are located
new_key_values = {
    ("image_rendering", "input_filter"): {"enabled": False, "type": "None"}, # Adds a key
    ("color_composite_image", "hsv", "slider_shift"): None, # Removes the key
    ("color_composite_image", "hsv", "h", "slider_shift"): {"max": 1.0,"min": 0.0}, # Adds the key
    ("color_composite_image", "hsv", "h", "frame_index", "activated"): False, # Adds the key
    ("color_composite_image", "hsv", "h", "blur"): None, # Removes the key
}

Then run this in the tests folder :

Holovibes/tests>$ ./add_missing_compute_settings.py [json_name] [holo_name]

Where json_name and holo_name are the .json and .holo that the script will modify. If you don't specify the names, it will modify all holovibes.json and all ref.holo recursively in the current folder and subfolders.

ignore some footer's variable

Sometimes, you might change some names in the footer (for example, changing 'FFT2' to 'ANGULARSP'), and so you don't want your test to crash on that. To do so, you can specify in the tests/holo.py file in the variable footer_exclude_path the path in the footer that you wan't to exclude for your testsuit. For example :

footer_exclude_path = ["root['compute_settings']['image_rendering']['space_transformation']"]

[!NOTE]

  • Don't forget to remove it after testing