Skip to content

Add button to check and install Meshroom dependency#580

Open
sadhana-r wants to merge 4 commits into
mainfrom
542_meshroom_installer
Open

Add button to check and install Meshroom dependency#580
sadhana-r wants to merge 4 commits into
mainfrom
542_meshroom_installer

Conversation

@sadhana-r

@sadhana-r sadhana-r commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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

Comment on lines +15 to +18
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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@sadhana-r sadhana-r force-pushed the 542_meshroom_installer branch from e5881e3 to e3511f7 Compare June 22, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread OpenLIFULogin/OpenLIFULogin.py
Comment thread OpenLIFULib/OpenLIFULib/meshroom_install_cli.py Outdated
Comment on lines +125 to +127
destination = Path(args.destination)
work_dir = Path(args.work_dir)
url = args.archive_url
Comment on lines +1273 to +1275
self._meshroom_install_controller = None
self._checkMeshroomStatus()

@sadhana-r

Copy link
Copy Markdown
Contributor Author

To programtically enable GPU acceleration, it seems like the following registry key: HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences could be used, which overrides the NVIDIA control panel setting. Similar to how we set the PATH variable by editing the registry key.
But this may only work on modern Windows machines, so for now, I left this as something that the user has to do manually.

self.ui.installMeshroomPushButton.setText(f"Meshroom {version_str}")
else:
self.ui.installMeshroomPushButton.setEnabled(True)
self.ui.installMeshroomPushButton.setText("Install Meshroom 2025")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The button text would also need to be updated if updating meshroom.

@sadhana-r sadhana-r requested a review from ebrahimebrahim June 22, 2026 18:19
@ebrahimebrahim ebrahimebrahim linked an issue Jun 30, 2026 that may be closed by this pull request
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.

Add a Meshroom installer to the Login module

2 participants