Skip to content

Conversation

@carotam
Copy link
Contributor

@carotam carotam commented May 4, 2025

Description

This PR introduces support for the Laparoscopic project alongside the existing Colon configuration, by adding three new scripts rather than modifying the originals.

Motivation

  • The existing scripts/install_and_enable_addons_render.py is tightly coupled to the Colon project’s node setup and cannot produce labels for Laparoscopic renders.
  • Rather than risk breaking Colon workflows, we’ve created parallel “laparoscopic” versions of the install-and-enable and runner scripts.

What’s Changed

  1. New install-and-enable script
  • scripts/install_and_enable_addons_render_laparoscopic.py
  • Forked from the original install script and adapted for the Laparoscopic project, whose node groups don’t allow a “material” input, so we can’t set materials programmatically as we do in the Colon project.
    Note: Both install scripts could eventually be unified behind a --project flag, pending some refactoring and testing.
  1. New single-run runner
  • scripts/run_laparoscopic_RandomiserBlender.sh
  • Duplicate of run_RandomiserBlender.sh, except it invokes the laparoscopic-specific install script.
    Future: We could merge both runners under one script with a --project flag.
  1. Batch-run utility
  • scripts/run_laparoscopic_multiple_times
  • Loops over a range of seeds to produce multiple renders and labels in one go.

How to run:

./run_laparoscopic_multiple_times \
  [NUMBER_OF_SAMPLES]  \
  [JSON_IN] \
  [BLENDER_FILE_PATH] \
  [BLENDER_FILE_PATH_LABEL]
  [PREFIX_OUTPUT_NAME]

Example to create 1000 images with labels:

  • Using the parameters from path/to/parameters.json the script will generate 1000 images and 1000 labels
./run_laparoscopic_multiple_times \
  1000 \
  "path/to/parameters.json" \
  "path/to/blender_to_render.blend" \
  "path/to/blender_to_label.blend" \
  "my_experiment"

@carotam carotam changed the title Tamen laparoscopic Add dedicated Laparoscopic rendering scripts May 4, 2025
Copy link
Collaborator

@ruaridhg ruaridhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (LGTM), thank you for your contribution. I'm happy to merge this assuming the tests pass.

@ruaridhg ruaridhg merged commit 10f356a into UCL:main May 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants