# QuantitativeReporting: segmentation-based measurements in 3D Slicer, saved as # DICOM SEG plus a DICOM SR measurement report (TID 1500). One scripted module. # It is IDC Browser's declared extension dependency. The DICOM SEG and TID 1500 # loaders it once carried are now core Slicer (DICOMSegmentationPlugin, # DICOMTID1500Plugin); what it adds is the module that creates the reports. # Installed file by file from upstream's CMake lists, without a CMake build (the # DentalSegmentator / IDCBrowser pattern), so it stays noarch. %global commit 1647a520d5f41dd9a771896601ec696429292cbc %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260427 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 %global qtsm %{slicer_inst}/lib/%{slicer_subdir}/qt-scripted-modules Name: 3dslicer-quantitativereporting Version: 0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: DICOM-based quantitative reporting for 3D Slicer (QuantitativeReporting) # The 3D Slicer Contribution and Software License Agreement v1.0, accepted # provisionally by the project pending a Fedora Legal determination # (ci/check-fedora-licence.py, PROVISIONAL). License: 3D-Slicer-1.0 URL: https://github.com/QIICR/QuantitativeReporting Source0: %{url}/archive/%{commit}/QuantitativeReporting-%{shortcommit}.tar.gz BuildArch: noarch # %%check only. BuildRequires: python3 Requires: 3dslicer # Upstream's EXTENSION_DEPENDS. The module imports SlicerDevelopmentToolboxUtils # at load time; PETDICOMExtension supplies the PET SUV and RWVM DICOM plugins. Requires: 3dslicer-developmenttoolbox Requires: 3dslicer-petdicom # Report export runs dcmqi's tid1500writer, found on PATH (shutil.which). Requires: 3dslicer-dcmqi Requires: python3-six %description QuantitativeReporting makes segmentation-based measurements in 3D Slicer and saves them in DICOM: the segmentation as DICOM SEG and the measurements as a DICOM Structured Report (TID 1500), with standard terminology for every segment. The reports can be read back into Slicer and by other DICOM tools. The NCI Imaging Data Commons browser declares it as a dependency. %prep %autosetup -n QuantitativeReporting-%{commit} -p1 %build %install _dir=QuantitativeReporting; _mod=QuantitativeReporting; _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 # 8 scripts + 3 resources at 1647a520; a changed list means re-check the loop. 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}/quantitativereporting.files %check # Every module parses (compile() writes no __pycache__ into the buildroot). find %{buildroot}%{qtsm} -name '*.py' -print0 | xargs -0 -n1 %{python3} -c \ 'import sys; compile(open(sys.argv[1]).read(), sys.argv[1], "exec")' # The tid1500writer lookup still tries PATH first, where 3dslicer-dcmqi puts it. grep -q 'shutil.which(name)' %{buildroot}%{qtsm}/QuantitativeReporting.py %files -f %{_builddir}/quantitativereporting.files %license License.txt %doc README.md %changelog * Mon Oct 12 2026 Morgan Hough - 0-0.1.20260427git1647a520 - Initial package, IDC Browser's extension dependency