# Newest tag is release-1.1.10; master is one commit past it and is what the # ACES tree builds from. configure.ac still says 1.1.1. %global commit 239a1a21676f598bb716f5b5237da191953218d0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20120308 Name: classify Version: 1.1.10 Release: 1.%{date}git%{shortcommit}%{?dist} Summary: Tissue classification for MINC volumes # COPYING: the classic MNI/BIC permissive notice, Vasken Kollokian 1997. # docs/civet-licensing.md (tier 1). License: HPND URL: https://github.com/aces/classify 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 # libminc 2.x dropped volume_io's allocation tracker; classify calls it from a # debug-only branch. See docs/upstream/mni-libminc2-api-drift.md Patch0: classify-libminc2-no-alloc-tracker.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: make BuildRequires: perl-interpreter BuildRequires: EBTKS-devel BuildRequires: libminc-devel BuildRequires: netcdf-devel BuildRequires: zlib-devel # %%check syntax-checks the driver scripts. BuildRequires: perl-MNI BuildRequires: perl(Getopt::Tabular) # insect and classify_clean are MNI::Startup scripts driving the MINC tools. Requires: perl-MNI Requires: perl(Getopt::Tabular) Requires: minc-tools %description classify assigns each voxel of a MINC volume to a tissue class, by one of several classifiers: nearest neighbour (ann, knn), Bayesian, fuzzy and hard c-means, and minimum distance. It is the tissue classification step of the MNI/BIC pipelines and of CIVET. The package also provides insect (Intensity-Normalized Stereotaxic Environment for Classification of Tissues), the driver that runs a full classification, and classify_clean, plus the sample tag sets the classifiers train on. %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 # The axis macros are wanted in both languages here: cleantag.cc and the # classifiers index coordinates as X, Y, Z and never use those names as # variables (checked), unlike N3 whose C++ names two matrices X and Y. export CXXFLAGS="%{optflags} -std=gnu++17 -fpermissive -I%{_includedir}/libminc \ -include $(pwd)/compat_minc.h -DMNI_COMPAT_AXIS_MACROS" # The MNI configure probes are pre-C99 and GCC 14+ makes their constructs hard # errors, so they fail to compile and configure reports the libraries missing. # Demote them, as bicpl, N3 and inormalize 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 -DMNI_COMPAT_AXIS_MACROS" %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. Run the binaries and syntax-check the drivers: they # are generated by sed from .in files, so a broken substitution would ship # silently. inormalize's lgmask reached %%check with a Perl construct removed # in 5.22 that way. ./classify -help 2>&1 | grep -qi 'usage\|classify' || ./classify 2>&1 | grep -qi 'usage\|classify' for f in scripts/insect scripts/classify_clean; do test -f "$f" && %{__perl} -c "$f" done %files %license COPYING %doc AUTHORS ChangeLog NEWS README %{_bindir}/classify %{_bindir}/voldiff %{_bindir}/insect %{_bindir}/classify_clean %{_bindir}/cleantag %{_datadir}/classify/ %changelog * Thu Sep 24 2026 Morgan Hough - 1.1.10-1.20120308git239a1a2 - Initial package, from the tip of upstream master. CIVET/MNI tier 1 (docs/civet-licensing.md); the fifth of the eight permissive components.