Skip to content

FIX: make the extension configure, package and load after the Remote rename - #42

Merged
Jules-GP merged 1 commit into
DCBIA-OrthoLab:mainfrom
pieper:fix-remote-rename-resources
Oct 21, 2026
Merged

Jules-GP merged 1 commit into
DCBIA-OrthoLab:mainfrom
pieper:fix-remote-rename-resources

Conversation

@pieper

@pieper pieper commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This change was prepared by Claude (Anthropic's AI assistant) under the direction of @pieper, in consultation with the Slicer developer team. It was configured, built and loaded in a local Slicer 5.13 build; no models or servers were exercised.

The ExtensionsIndex packaging checks for this extension fail (Slicer/ExtensionsIndex#2411, run) with:

CMake Error at SlicerMacroBuildScriptedModule.cmake:78:
  slicerMacroBuildScriptedModule(RESOURCES) given nonexistent file or directory
  'Resources/Icons/AutoCrop3D.png'

The Remote-suffix rename (#38) left CMake lists and file names out of step. CMake stops at the first error, so I configured, built and loaded the extension against a Slicer build until it worked. This PR fixes everything that turned up.

CMake configure errors

Module CMake listed File in the repo Fix
AutoCrop3DRemote Resources/Icons/AutoCrop3D.png AutoCrop3DRemote.png list ${MODULE_NAME}.png
CLICRemote Resources/Icons/CLIC.png CLICRemote.png list ${MODULE_NAME}.png
AgentRemote Resources/UI/AgentRemote.ui Agent.ui list Agent.ui (what AgentRemote.py loads)
CNERemote Resources/UI/CNERemote.ui CNE.ui list CNE.ui (what CNERemote.py loads)
MRI2CBCTRemote Resources/UI/MRI2CBCTRemote.ui MRI2CBCT.ui list MRI2CBCT.ui (what MRI2CBCTRemote.py loads)
Agent_CLIRemote Resources/UI/Agent_CLIRemote.ui Agent_CLI.ui list Agent_CLI.ui
MRI2CBCT_CLIRemote ImportLibrary.cmake names MRI2CBCT_CLI_utils MRI2CBCT_CLIRemote_utils/ use the new package name

Problems that appeared once it built and ran in Slicer

  • ServerToolsCoreLib/tls.py was never installed. It came in with the HTTPS-only change but isn't listed in ServerToolsCore/CMakeLists.txt. In the installed extension, every module that imports ServerToolsCoreLib failed with ImportError: cannot import name 'tls'. Added to the list.
  • Scripted CLI names. Agent_CLIRemote.py and CNE_CLIRemote.py sat next to Agent_CLI.xml and CNE_CLI.xml. A scripted CLI's XML must have the same base name as its script. And AgentRemote.py and CNERemote.py still called slicer.modules.agent_cli and slicer.modules.cne_cli, which are AutomatedDentalTools' module names, so with both extensions installed they would run the other extension's CLI. This PR renames the XML files to Agent_CLIRemote.xml and CNE_CLIRemote.xml, adds the "Remote" suffix to their titles to match the other modules, and updates the callers to slicer.modules.agent_cliremote and slicer.modules.cne_cliremote.

Verification (macOS arm64, Slicer 5.13 local build)

  • cmake -DSlicer_DIR=... -DBUILD_TESTING=ON configures all 25 scripted modules and the build succeeds. On main it stops at the AutoCrop3DRemote error above.
  • Built files: each CLI's .xml now lands next to its .py. The icons and .ui files listed above are present in the build tree.
  • Launching Slicer with the build tree as additional module paths shows no tracebacks. agentremote, cneremote, autocrop3dremote, clicremote, mri2cbctremote, mri2cbct_approx, agent_cliremote ("Agent_CLI Remote") and cne_cliremote ("CNE_CLI Remote") all register.
  • Not tested: running any tool against a server, the Agent/Ollama path, or your out-of-Slicer test suites. Please run those, since the CLI rename touches AgentRemote.py and CNERemote.py.

Not in this PR. The six MRI2CBCT_CLIRemote/MRI2CBCT_* scripted CLIs still have the same module names as in AutomatedDentalTools (noted in Slicer/ExtensionsIndex#2411).

🤖 Generated with Claude Code

…rename

The Remote-suffix rename (DCBIA-OrthoLab#38) left CMake lists and file names out of step, so
CMake configure failed and the ExtensionsIndex packaging checks failed:

- AutoCrop3DRemote and CLICRemote listed icons under their old names.
- AgentRemote, CNERemote, MRI2CBCTRemote and Agent_CLIRemote listed .ui files
  under new names that don't exist; the Python code still loads the existing
  Agent.ui, CNE.ui, MRI2CBCT.ui and Agent_CLI.ui, so list those.
- MRI2CBCT_CLIRemote/ImportLibrary.cmake still named the renamed
  MRI2CBCT_CLI_utils package.

Two problems only showed up once it built:

- ServerToolsCoreLib/tls.py (added with the HTTPS-only change) was not
  installed, so every module importing ServerToolsCoreLib failed to load.
- Agent_CLIRemote and CNE_CLIRemote kept their XML files as Agent_CLI.xml and
  CNE_CLI.xml. A scripted CLI's XML must match its script name, and the
  callers still used slicer.modules.agent_cli and slicer.modules.cne_cli,
  which are AutomatedDentalTools' module names. Rename the XML files, add the
  Remote suffix to their titles, and call slicer.modules.agent_cliremote and
  slicer.modules.cne_cliremote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jules-GP
Jules-GP merged commit e6e59f1 into DCBIA-OrthoLab:main Oct 21, 2026
@pieper
pieper deleted the fix-remote-rename-resources branch October 21, 2026 17:41
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