# SlicerDentalSegmentator: fully automatic segmentation of dental CBCT and CT # (maxilla, mandible, teeth, mandibular canal, ...) with a pretrained nnU-Net # model, run through the SlicerNNUNet module. # # PURE-SCRIPTED: nothing to compile. nnU-Net and PyTorch come through # 3dslicer-nnunet (python3-nnunetv2, python3-torch). The pretrained weights # (Zenodo 10.5281/zenodo.10829675, CC-BY-4.0, about 220 MB) are not packaged: the # module downloads them from the project's GitHub release on first use, into # $XDG_DATA_HOME/DentalSegmentator/ML (Patch0). %global commit 05f2d57820a2eac0f2f021c408dccf51b545834d %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260522 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 %global qtsm %{slicer_inst}/lib/%{slicer_subdir}/qt-scripted-modules Name: 3dslicer-dentalsegmentator Version: 1.0.0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: Automatic dental CBCT/CT segmentation for 3D Slicer (nnU-Net) License: Apache-2.0 URL: https://github.com/gaudot/SlicerDentalSegmentator # main as indexed by the Slicer ExtensionsIndex (after v1.0.0-alpha). Source0: %{url}/archive/%{commit}/SlicerDentalSegmentator-%{shortcommit}.tar.gz # - nnUnetFolder(): weights in $XDG_DATA_HOME/DentalSegmentator/ML, not the module's # Resources/ML. That is in the read-only, shared qt-scripted-modules tree, and # downloadWeights() rmtree()s and recreates the folder. # - _installOpenAnatomyExtension(): no Extensions Manager download (its catalog would # serve upstream binaries); the glTF-export error names 3dslicer-openanatomy instead. Patch0: 3dslicer-dentalsegmentator-fedora.patch BuildArch: noarch Requires: 3dslicer # EXTENSION_DEPENDS NNUNet: SegmentationLogic/InstallLogic, nnunetv2, torch. Requires: 3dslicer-nnunet # Weights lookup on the project's GitHub releases. Requires: python3-pygithub Requires: python3-requests Requires: python3-numpy # glTF export of the segmentation. Recommends: 3dslicer-openanatomy %description SlicerDentalSegmentator segments dental CBCT and CT images automatically (maxilla and upper skull, mandible, upper and lower teeth, mandibular canal) with a pretrained nnU-Net model, through the SlicerNNUNet module. The model weights (CC-BY-4.0) are downloaded on first use into $XDG_DATA_HOME/DentalSegmentator/ML. nnU-Net and PyTorch come from Fedora packages. Fedora's PyTorch has no CUDA support, so segmentation runs on the CPU (slow), or on AMD GPUs through ROCm. %prep %autosetup -n SlicerDentalSegmentator-%{commit} -p1 %build # Pure-scripted: nothing to compile. %install # Install what DentalSegmentator/CMakeLists.txt lists, at the paths # slicerMacroBuildScriptedModule uses, except: # - Testing/*: the self tests need SlicerPythonTestRunner (not packaged), and a # top-level "Testing" package in the shared qt-scripted-modules would collide. # - Resources/Icons/start_icon.png: byte-identical to, and owned by, 3dslicer-nnunet # (required above); both upstreams install it into the same shared Resources/Icons. _dir=DentalSegmentator; _mod=DentalSegmentator; _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 -e '^Testing/' -e '^Resources/Icons/start_icon.png$'); 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 11 || { echo "ERROR: installed $_n $_mod files, expected 11" >&2; exit 1; } ( cd %{buildroot} && find . \( -type f -o -type l \) | sed 's|^\.||' ) > %{_builddir}/dentalseg.files %files -f %{_builddir}/dentalseg.files %license LICENSE.txt %doc README.md %changelog * Sat Oct 10 2026 Morgan Hough - 1.0.0-0.1.20260522git05f2d578 - Initial package. SlicerDentalSegmentator on 3dslicer-nnunet; weights per user, no Extensions Manager download (Patch0).