# Newest tag is release-1.0.20; master has moved past it and is what the ACES # tree builds from, so package the tip as the other MNI components here do. # configure.ac still says 1.0.4. %global commit ef9e6cb00bfbbd98f5f32114e6c8e2f86517dfb2 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20190627 Name: inormalize Version: 1.0.20 Release: 1.%{date}git%{shortcommit}%{?dist} Summary: Intensity normalization for MINC volumes # COPYING: the classic MNI/BIC permissive notice, Alex Zijdenbos 2006-2007. # docs/civet-licensing.md (tier 1). License: HPND URL: https://github.com/aces/inormalize Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz # m4/ is a git submodule (BIC-MNI/mni-acmacros) and absent from the archive. Source1: https://github.com/BIC-MNI/mni-acmacros/archive/master.tar.gz#/mni-acmacros.tar.gz # Maps the pre-VIO_ volume_io spellings this code uses onto current libminc. Source2: mni-volume-io-compat.h # defined(@array), removed in Perl 5.22. Same construct as N3's drivers; see # docs/upstream/mni-perl-defined-array.md Patch0: inormalize-perl-defined-array.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: make BuildRequires: perl-interpreter # %%check syntax-checks the drivers, which use these at compile time. BuildRequires: perl-MNI BuildRequires: perl(Getopt::Tabular) BuildRequires: EBTKS-devel BuildRequires: libminc-devel BuildRequires: netcdf-devel BuildRequires: zlib-devel # nu_correct_norm, normalize_mri, lgmask and headmask are MNI::Startup scripts # that parse options with Getopt::Tabular and drive the MINC tools. Requires: perl-MNI Requires: perl(Getopt::Tabular) Requires: minc-tools %description inormalize normalizes the intensity of a MINC volume, by one of several methods: matching a ratio, a median, or the peak of the intensity histogram, optionally within a mask. It is used throughout the MNI/BIC pipelines, and by CIVET, to put volumes on a common intensity scale before further processing. The package also provides nu_correct_norm, which pairs the normalization with N3's non-uniformity correction, and the lgmask and headmask helpers. %prep %autosetup -p1 -n %{name}-%{commit} # Supply the mni-acmacros submodule that the tarball cannot carry. mkdir -p m4 tar -xf %{SOURCE1} --strip-components=1 -C m4 test -f m4/smr_WITH_BUILD_PATH.m4 %build autoreconf -ifv -I m4 # Fedora's libminc names its volume_io library libminc_io, not libvolume_io2. sed -i 's/volume_io2/minc_io/g' configure grep -q 'minc_io' configure cp %{SOURCE2} compat_minc.h export CXXFLAGS="%{optflags} -std=gnu++17 -fpermissive -I%{_includedir}/libminc \ -include $(pwd)/compat_minc.h" # The MNI configure probes are pre-C99 (mni_REQUIRE_LIB(z) assigns a function # pointer to an int, others call undeclared functions); GCC 14+ makes those hard # errors, so the probes fail to compile and configure reports the libraries as # missing. Demote them, as bicpl and N3 do. export CFLAGS="%{optflags} -std=gnu17 -I%{_includedir}/libminc \ -Wno-error=implicit-function-declaration -Wno-error=implicit-int \ -Wno-error=incompatible-pointer-types -Wno-error=int-conversion \ -include $(pwd)/compat_minc.h" %configure \ --with-minc2 \ --with-build-path=%{_prefix} \ LIBS="-lminc_io -lminc2 -lnetcdf -lhdf5 -lz -lm" %make_build %install %make_install find %{buildroot} -name '*.la' -delete %check # No test suite upstream. Check that the binary runs and that each Perl driver # at least compiles -- they are generated by sed from .in files, so a broken # substitution would otherwise ship silently. ./inormalize -help 2>&1 | grep -qi 'usage\|inormalize' for f in nu_correct_norm normalize_mri lgmask headmask; do %{__perl} -c "$f" done %files %license COPYING %doc AUTHORS ChangeLog NEWS README %{_bindir}/inormalize %{_bindir}/nu_correct_norm %{_bindir}/normalize_mri %{_bindir}/lgmask %{_bindir}/headmask %changelog * Thu Sep 24 2026 Morgan Hough - 1.0.20-1.20190627gitef9e6cb - Initial package, from the tip of upstream master. CIVET/MNI tier 1 (docs/civet-licensing.md); the fourth of the eight permissive components.