# SlicerMONAIAuto3DSeg: automatic segmentation in 3D Slicer with MONAI Auto3DSeg # (SegResNet) models -- whole body and abdominal CT organs, vertebrae, mediastinal # anatomy, whole head MRI, brain tumours (BraTS), prostate, intracranial haemorrhage # and more (33 models in Resources/Models.json). Inference runs in a separate # PythonSlicer process. # # PURE-SCRIPTED: nothing to compile. Upstream pip-installs MONAI and its extras and # gets PyTorch through the PyTorch extension; here they are RPMs (Patch0). The model # weights are not packaged: the module downloads the chosen model from the project's # GitHub release into ~/.MONAIAuto3DSeg and shows its licence (most are CC BY 4.0). %global commit 9cdf2df4e8b3a5351ad11a3f934b0c13ffb15cca %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260319 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 %global qtsm %{slicer_inst}/lib/%{slicer_subdir}/qt-scripted-modules Name: 3dslicer-monaiauto3dseg Version: 0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: MONAI Auto3DSeg automatic segmentation for 3D Slicer License: MIT URL: https://github.com/lassoan/SlicerMONAIAuto3DSeg Source0: %{url}/archive/%{commit}/SlicerMONAIAuto3DSeg-%{shortcommit}.tar.gz # - SlicerPythonDependencies.setupPythonRequirements(): check that MONAI (>= 1.3) and # the extras inference uses import, with a dnf hint, instead of # pip_install("monai[fire,pyyaml,nibabel,pynrrd,psutil,tensorboard,skimage,itk,tqdm]>=1.3"), # which upstream runs every time (tensorboard is training-only). # - Inference-server toggle: check fastapi/uvicorn/python-multipart/slowapi/psutil # instead of pip-installing them; slowapi is not packaged, so the server reports it. Patch0: 3dslicer-monaiauto3dseg-fedora-packages.patch BuildArch: noarch # Inference runs in a child process found as shutil.which("PythonSlicer"), which # 3dslicer ships from 5.12.4-14. Requires: 3dslicer >= 5.12.4-14 # EXTENSION_DEPENDS PyTorch: setupPythonRequirements() uses PyTorchUtils. Requires: 3dslicer-pytorch Requires: python3-torch Requires: python3-monai >= 1.3 Requires: python3-fire Requires: python3-pyyaml Requires: python3-nibabel Requires: python3-pynrrd Requires: python3-psutil Requires: python3-scikit-image Requires: python3-itk Requires: python3-tqdm Requires: python3-packaging Requires: python3-requests Requires: python3-numpy %description SlicerMONAIAuto3DSeg segments medical images automatically with MONAI Auto3DSeg models: CT organs of the whole body and abdomen, vertebrae, mediastinal anatomy, whole-head MRI, brain tumours, prostate MRI and more. Inference runs in a separate process, so Slicer stays responsive. MONAI and PyTorch come from Fedora packages; Fedora's PyTorch has no CUDA support, so inference runs on the CPU, or on AMD GPUs through ROCm. Models are downloaded on first use into ~/.MONAIAuto3DSeg; the module shows each model's licence. %prep %autosetup -n SlicerMONAIAuto3DSeg-%{commit} -p1 %build # Pure-scripted: nothing to compile. %install # Install exactly what MONAIAuto3DSeg/CMakeLists.txt lists, at the paths # slicerMacroBuildScriptedModule uses. _dir=MONAIAuto3DSeg; _mod=MONAIAuto3DSeg; _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"); 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 24 || { echo "ERROR: installed $_n $_mod files, expected 24 (8 scripts, 16 resources)" >&2; exit 1; } ( cd %{buildroot} && find . \( -type f -o -type l \) | sed 's|^\.||' ) > %{_builddir}/monaiauto3dseg.files %files -f %{_builddir}/monaiauto3dseg.files %license LICENSE %doc README.md UsingStandardTerminology.md %changelog * Sat Oct 10 2026 Morgan Hough - 0-0.1.20260319git9cdf2df4 - Initial package. SlicerMONAIAuto3DSeg on python3-monai / python3-torch; no pip (Patch0).