# SlicerNNInteractive: the nnInteractive promptable 3D segmentation model in 3D # Slicer. Points, boxes, scribbles and lassos (positive and negative) refine a 3D # segment interactively, either in-process ("Local" mode, needs a GPU PyTorch can # use) or against an nnInteractive server ("Remote" mode). # # PURE-SCRIPTED: nothing to compile. Upstream pip-installs nnInteractive (or the # thin client), PyTorch and scikit-image from the module. Here they are RPMs # (python3-nninteractive, python3-torch, python3-scikit-image), which the plugin # adopts at startup as a pre-existing install; Patch0 removes its pip and PyPI # paths. The pretrained checkpoints are not packaged: the plugin downloads them on # demand and shows each model's licence (CC-BY-NC-SA-4.0) in its Prompts tab; see # python-nninteractive.spec. %global commit 95a1bfae369806e0070a3887597eb92a1d0a2645 %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260714 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 %global qtsm %{slicer_inst}/lib/%{slicer_subdir}/qt-scripted-modules Name: 3dslicer-nninteractive Version: 1.0.0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: nnInteractive promptable 3D segmentation for 3D Slicer License: Apache-2.0 URL: https://github.com/coendevente/SlicerNNInteractive # main as indexed by the Slicer ExtensionsIndex; v1.0.0 is the latest tag before it. Source0: %{url}/archive/%{commit}/SlicerNNInteractive-%{shortcommit}.tar.gz # Use the RPMs, never pip or PyPI: _check_for_updates_async() returns at once (it # queried PyPI and offered newer wheels), and _prompt_install_choice() / # _offer_backend_update() say how to install with dnf instead of pip-installing. Patch0: 3dslicer-nninteractive-fedora-packages.patch BuildArch: noarch Requires: 3dslicer # The plugin supports nnInteractive >= 2.5.1, < 3.0.0 (NNINTERACTIVE_VERSION_FLOOR/CEILING). Requires: (python3-nninteractive >= 2.5.1 with python3-nninteractive < 3) Requires: python3-scikit-image Requires: python3-httpx Requires: python3-packaging Requires: python3-torch # ensure_torch_installed() prefers the PyTorch extension's PyTorchUtils when present. Recommends: 3dslicer-pytorch %description SlicerNNInteractive brings nnInteractive, a promptable 3D segmentation model, to 3D Slicer. Points, bounding boxes, scribbles and lassos, positive or negative, segment and refine a 3D structure interactively. Inference runs in-process (Local mode, which needs a GPU usable by PyTorch) or on an nnInteractive server (Remote mode). nnInteractive, PyTorch and scikit-image come from Fedora packages. The pretrained checkpoints are downloaded on first use; the plugin shows each model's licence (CC-BY-NC-SA-4.0, non-commercial). %prep %autosetup -n SlicerNNInteractive-%{commit} -p1 %build # Pure-scripted: nothing to compile. %install # Install what the module's CMakeLists.txt lists, at the paths # slicerMacroBuildScriptedModule uses -- except Testing/* (the self test and its 14 # test volumes): the module loads the test only if the file exists, and a top-level # "Testing" tree in the shared qt-scripted-modules would collide with other extensions. _dir=slicer_plugin/SlicerNNInteractive; _mod=SlicerNNInteractive; _n=0 for _f in $(sed -n '/^set(MODULE_PYTHON_\(SCRIPTS\|RESOURCES\)$/,/^ )$/p' $_dir/CMakeLists.txt \ | grep -vE '^set\(|^ \)$' | sed -e 's/^ *//' -e "s/\${MODULE_NAME}/$_mod/g" | grep -v '^Testing/'); do test -f "$_dir/$_f" || { echo "ERROR: $_mod lists $_f, which is missing" >&2; exit 1; } install -Dpm0644 "$_dir/$_f" "%{buildroot}%{qtsm}/$_f" _n=$((_n + 1)) done test "$_n" -eq 15 || { echo "ERROR: installed $_n $_mod files, expected 15" >&2; exit 1; } echo "$_mod: installed $_n listed files" ( cd %{buildroot} && find . \( -type f -o -type l \) | sed 's|^\.||' ) \ > %{_builddir}/nninteractive.files %files -f %{_builddir}/nninteractive.files %license LICENSE %doc README.md %changelog * Sat Oct 10 2026 Morgan Hough - 1.0.0-0.1.20260714git95a1bfae - Initial package. SlicerNNInteractive on the python3-nninteractive RPMs; no pip or PyPI paths (Patch0).