Add button to check and install Meshroom dependency#580
Conversation
| MESHROOM_VERSION = "2025.1.0" | ||
| MESHROOM_WINDOWS_URL = "https://zenodo.org/records/16887472/files/Meshroom-2025.1.0-Windows.zip" | ||
| MESHROOM_LINUX_URL = "https://zenodo.org/records/16887472/files/Meshroom-2025.1.0-Linux.tar.gz" | ||
| MESHROOM_EXTRACTED_DIR_NAME = "Meshroom-2025.1.0" |
There was a problem hiding this comment.
The meshroom version is defined by the MESHROOM_VERSION variable and these download links. So if updating meshroom in the future, only these variables would need to be updated.
a4714e8 to
e5881e3
Compare
e5881e3 to
e3511f7
Compare
There was a problem hiding this comment.
Pull request overview
Adds first-class Meshroom dependency detection and installation flow to the Login module so users can verify/install Meshroom (required by openlifu photogrammetry tooling) from within the application.
Changes:
- Adds a Meshroom status indicator and “Install Meshroom 2025” button to the Login module’s Optional dependencies UI.
- Implements a background (QProcess) Meshroom download/extract workflow with progress + cancel, plus PATH persistence (Windows registry).
- Adds Login-module tests covering Meshroom install CLI extraction/cancel behavior and GUI controller behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| OpenLIFULogin/Resources/UI/OpenLIFULogin.ui | Adds Meshroom status icon + install button to the “Optional” dependencies section. |
| OpenLIFULogin/OpenLIFULogin.py | Wires UI to Meshroom status detection, platform-specific install prompts, and controller kickoff; adds Meshroom install tests. |
| OpenLIFULib/OpenLIFULib/meshroom_install_gui.py | New GUI-side controller to run the install helper via QProcess with progress dialog and cancel handling. |
| OpenLIFULib/OpenLIFULib/meshroom_install_cli.py | New CLI helper to download and securely extract Meshroom archives while emitting progress events. |
| OpenLIFULib/CMakeLists.txt | Ensures the new Meshroom installer scripts are packaged with the extension. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| destination = Path(args.destination) | ||
| work_dir = Path(args.work_dir) | ||
| url = args.archive_url |
| self._meshroom_install_controller = None | ||
| self._checkMeshroomStatus() | ||
|
|
|
To programtically enable GPU acceleration, it seems like the following registry key: |
| self.ui.installMeshroomPushButton.setText(f"Meshroom {version_str}") | ||
| else: | ||
| self.ui.installMeshroomPushButton.setEnabled(True) | ||
| self.ui.installMeshroomPushButton.setText("Install Meshroom 2025") |
There was a problem hiding this comment.
The button text would also need to be updated if updating meshroom.
Addresses #542
Adds a button to the login module's "Optional" dependencies section for checking and installing Meshroom 2025.1.0.
Detects Meshroom by looking for meshroom_batch on PATH (the executable required by openlifu). Since meshroom_batch has no --version flag, the version is inferred from the parent directory name (e.g., Meshroom-2025.1.0).
The Meshroom archive is large (~10 GB on Windows, ~13 GB on Linux), so the download runs in a background QProcess with a progress dialog and cancel support - the same approach used for the sample database download. After extraction, the Meshroom directory is added to PATH using the same registry-based approach used for Android Platform Tools. On Windows, a post-install dialog provides step-by-step instructions for enabling NVIDIA GPU acceleration, based on the instructions provided here: https://github.com/OpenwaterHealth/OpenLIFU-python?tab=readme-ov-file#enable-gpu-acceleration
I also added some unit tests to the Login module.
For Review
Test it out, and review the overall design. The specifics of the progress bar/download code is mostly borrowed from the sample data functionality