Changelog¶
0.2.4 (2026-02-21)¶
Validation: Radiomic Feature Stability Analysis (D3)¶
New
validation/radiomics_stability.pymodule — quantitative assessment of micro-architectural signal fidelity across preprocessing architectures (native-first vs atlas-first). Implements IBSI-compliant radiomic feature extraction comparison using:Coefficient of Variation (CV): per-feature normalised dispersion across subjects, $CV_i = (\sigma_i / \mu_i) \times 100%$.
ICC(3,1): two-way mixed-effects intra-class correlation to isolate variance introduced by the preprocessing architecture.
Stability classification: features with ICC ≥ 0.85 and CV ≤ 10% are classified as highly stable.
Paired Wilcoxon signed-rank test on CV distributions with Benjamini–Hochberg FDR correction for multiple comparisons.
New statistical utilities in
validation/stats.py:coefficient_of_variation(),wilcoxon_signed_rank(),benjamini_hochberg().Phase D extended with D3 endpoint —
run_phase_d()now acceptscomparator_dirto trigger radiomics stability analysis. Results are stored inPhaseDResults.radiomics_stabilityand serialised to a separateradiomics_stability_<dataset>.json.Figure 6b (
figure6b_radiomics_stability): ICC vs CV scatter coloured by IBSI feature class, per-class stacked bar (stable vs unstable), and CV distribution box plots with Wilcoxon annotation.Table 5 (
table5_radiomics_stability): per-class summary with N features, % stable, median ICC, and median CV for both pipelines.Updated
PHASE_D_ENDPOINTSinvalidation/config.pyto formally describe D3.run_all.pynow passescomparator_dirthrough to Phase D.
Packaging¶
vasari-autois now on PyPI (vasari-auto>=0.1.0). The[vasari]optional dependency now installs from PyPI instead of requiring a direct git URL.vasari-autois a fork of the original by Ruffle et al. (2024), maintained for OncoPrep integration.pyradiomicsdependency switched from git URL to PyPI release (pyradiomics>=3.0), fixing PyPI upload rejection for direct references.Fixed
_pop()inworkflows/outputs.py— now handles plain strings (not just lists), preventing aTraitErrorwhenCopyXFormflattens single-element lists in the N4/ATROPOS sub-workflow.
Bug Fixes¶
Fixed
test_nninteractive::test_workflow_graph_is_connected— updated expected node count from 6 to 5 afterresample_seg_to_stdwas removed in the deferred registration refactor (0.2.3).
0.2.3 (2025-02-21)¶
Pipeline Reordering: Deferred Template Registration¶
Template registration is now deferred until after segmentation when
--run-segmentationis enabled. The whole-tumor mask (binarized, dilated by 4 voxels with a 6-connected structuring element) is passed to ANTs SyN as a cost-function exclusion mask (-x), preventing pathological tissue from distorting the diffeomorphic warp. This preserves global geometry for atlas-based analyses (VASARI) and template-space derivatives.Tumor segmentation no longer resamples to template space internally. The
tumor_seg_stdoutput has been removed from bothinit_anat_seg_wf()andinit_nninteractive_seg_wf(). Template-space resampling is now performed inbase.pyafter the deferred registration, using the topology-preserving transform.VASARI now receives the template-space segmentation from the deferred registration block (
resample_seg_to_stdinbase.py) instead of from the segmentation workflow’soutputnode.tumor_seg_std.Radiomics operates on the native-space segmentation, consistent with Pati et al. (AJNR 2024) — intensity normalization and SUSAN denoising are applied inside the radiomics workflow, after segmentation.
Added
skip_registrationparameter toinit_anat_preproc_wf()andinit_anat_fit_wf(). WhenTrue, Stage 5 (template registration) is skipped entirely, and buffer nodes emit empty lists for transforms.Added
_create_dilated_tumor_mask()helper function inbase.pyfor generating the cost-function exclusion mask.
Pipeline Order (with segmentation enabled)¶
Anatomical preprocessing (N4, skull-strip, co-registration) — no template registration
Tumor segmentation (native space)
Radiomics feature extraction (native-space mask, with histogram normalization + SUSAN denoising)
Deferred template registration (ANTs SyN with dilated tumor mask as cost-function exclusion)
Resample tumor segmentation to template space (nearest-neighbor)
VASARI feature extraction (template-space mask)
0.2.2 (2025-02-19)¶
Features¶
VASARI section in subject HTML report — the master subject report (
sub-XXX.html) now includes a “VASARI” section after Radiomics, containing the automated VASARI feature assessment table and the AI-generated radiology report. Both are collated from figures-directory reportlets and conditionally rendered with a navbar link.Group-level ComBat harmonization — new
analysis_level = groupstage removes scanner/site batch effects from radiomics features across an entire cohort using neuroCombat (Fortin et al., NeuroImage 2018), following the methodology of Pati et al. (AJNR 2024).Operates on participant-level radiomics JSON outputs; writes harmonized per-subject (or per-session)
*_desc-radiomicsCombat_features.jsonfiles.Auto-generates batch CSV from BIDS sidecars (
--generate-combat-batch) usingManufacturer,ManufacturerModelName, andMagneticFieldStrength(fields that survive anonymization).Extracts age and sex from JSON sidecars (
PatientAge/Age,PatientSex/Sex) with fallback toparticipants.tsv; forwards them as biological covariates preserved by ComBat.Longitudinal auto-detection: when multiple sessions per subject are found, each session is treated as a separate observation. If subjects cross batches (scanned at different sites), subject identity is added as a categorical covariate; otherwise, sessions are treated as independent observations with within-subject variance naturally preserved.
Group-level HTML report (
group_combat_report.html) with summary cards (observations, batches, features, variance change), batch distribution table, longitudinal mode indicator, and output file listing.New CLI flags:
--combat-batch,--combat-parametric,--combat-nonparametric,--generate-combat-batch.New module:
oncoprep.workflows.groupwith public APIrun_group_analysis()andgenerate_combat_batch_csv().
SUSAN denoising — pure-Python SUSAN non-linear noise reduction (
SUSANDenoisinginterface) applied after histogram normalization in the radiomics workflow. Edge-preserving smoothing reduces noise while maintaining tumor boundary detail.Template-space tumor segmentation resampling — the native-space tumor segmentation is resampled into the chosen template space (MNI152 or SRI24) using ANTs
ApplyTransformswith nearest-neighbor interpolation. Note: as of 0.2.3, this resampling moved from the segmentation workflows tobase.pyas part of the deferred registration block.VASARI atlas space selection —
init_vasari_wf()accepts anatlas_spaceparameter ('mni152','MNI152NLin2009cAsym', or'SRI24') and passes the pre-resampled segmentation directly to vasari-auto, skipping its internal ANTs SyN registration entirely.Bundled atlas masks — anatomical atlas ROI masks for MNI152 and SRI24 are now shipped inside OncoPrep at
data/atlas_masks/{mni152,sri24}/. Helper functionsget_atlas_dir()andget_atlas_reference()resolve TemplateFlow-style space names to the correct local directory.
vasari-auto upstream fixes¶
Fixed
ATLAS_AFFINEcrash: vasari-auto loaded the MNI reference brain from a CWD-relative path (atlas_masks/MNI152_T1_1mm_brain.nii.gz) at module-import time, causingFileNotFoundErrorwhen run from any other directory. Now resolved via__file__-relative path.Added
template_spaceparameter toget_vasari_features()— accepted values:'mni152','MNI152NLin2009cAsym','MNI152NLin6Asym','SRI24'. Defaults to'mni152'.Atlas masks are now organised into
atlas_masks/{mni152,sri24}/subdirectories with per-space reference brains.pyproject.tomlupdated to includeatlas_masks/**/*.nii.gzin the package distribution (previously missing from installs).__init__.pyswitched to lazy import via__getattr__to avoid loading heavy dependencies (ANTs, scipy, sklearn) at package-import time.utils.pyregister_to_mni()now auto-detects the reference brain filename (MNI152 or SRI24) in the atlas directory.
Documentation¶
New docs page:
usage/group_combat.md— full reference for batch CSV format, age/sex extraction, longitudinal handling, output files, CLI flags, and Python API.Tutorial Step 5 added for group-level ComBat harmonization (quick start, custom batch CSV with biological covariates, longitudinal datasets, report inspection, Python API).
README architecture diagram updated to show two-stage participant/group pipeline with group-level ComBat stage.
README features table updated with ComBat harmonization and SUSAN denoising entries.
CLI reference updated with group-level ComBat flags.
Sphinx toctree updated to include
usage/group_combat.
Tests¶
TestGroupComBat— 8 tests for cross-sectional ComBat (collection, filtering, Combat-file exclusion, harmonization, site-effect reduction, error handling, flatten/unflatten roundtrip).TestLongitudinalComBat— 5 tests for longitudinal ComBat (per-session collection, participant filtering, harmonization run, report content, cross-sectional report verification).TestBatchCsvGeneration— 4 tests for batch CSV generation (basic output, age/sex from sidecars,participants.tsvfallback, per-session rows).
Bug Fixes¶
MPS crash in nnInteractive subprocess — Apple Metal/MPS device initialization aborts when called inside a Nipype
forkserverworker process (triggered by a macOS update). Fixed via three layers: (1)run_without_submitting=Trueon the segmentation node keeps it in the main process where MPS works; (2)_in_subprocess()CPU-fallback safety net in the interface; (3)--nprocs 1automatically selects theLinearplugin.VASARI radiology report DerivativesDataSink path error —
Could not build path with entitiesforsuffix='report'with.html/.txtextensions. Addedsuffix<report>to_ONCOPREP_EXTRA_PATTERNSin the figures BIDS pattern and setdatatype='figures'on the radiology sinks.Ambiguous radiology sink entities —
ds_radiology_htmlandds_radiology_txtpreviously shared the samedesc='vasariRadiology'; the text sink now usesdesc='vasariRadiologyText'to prevent path collisions.Fixed
_import_vasari_auto()in OncoPrep — no longer requires CWD manipulation or temporary symlinks; uses a straightforward import now that vasari-auto resolves paths correctly.
Housekeeping¶
Added VASARI references to
REFERENCESstring: Ruffle et al. 2024 (VASARI-auto) and Gutman et al. 2013 (original VASARI feature set).Removed dead code:
src/oncoprep/reports/package (unusedreport.pyandtemplate.html.j2— report generation usesutils/collate.py).Consolidated
base.pyimports at top of file, removed unusedinit_anat_reports_wfimport — fixed all 11 ruff errors.Removed unused imports in
interfaces/nninteractive.py(Optional) andworkflows/nninteractive.py(Path).
0.2.1 (2025-02-18)¶
Features¶
nnInteractive default segmentation — the
--default-segflag now uses nnInteractive (Isensee et al., 2025; arXiv:2503.08373), a zero-shot 3D promptable foundation model trained on 120+ volumetric datasets. No Docker containers are required; model weights (~400 MB) download automatically from HuggingFace on first use.Fully-automated seed-point generation via multi-modal anomaly scoring (T1ce enhancement × T2 anomaly × FLAIR hyperintensity) with adaptive percentile thresholding.
Three-step segmentation: ET on T1ce, NCR via hole-filling, WT on FLAIR.
White-matter negative prompt heuristic for reducing ET false positives.
New documentation page:
usage/segmentation.md.Methods boilerplate —
--boilerplatenow writesCITATION.mdandCITATION.htmlto the logs directory and prints the full methods text to stdout. UsesLiterateWorkflow.visit_desc()to recursively aggregate descriptions from every sub-workflow.Separate references section in HTML reports — references are rendered in their own
<div id="references">section with a dedicated nav link, keeping the Methods section concise.--reports-onlynow builds the workflow graph (without heavy template fetching) so thatvisit_desc()produces the full boilerplate, then generates per-subject HTML reports with figures, methods, and references.Added workflow description (
__desc__) to the nnInteractive segmentation workflow, citing Isensee et al. (2025).All
@citation_keyreferences used in workflow descriptions are now resolved to full bibliographic entries (13 references covering Nipype, ANTs, N4, HD-BET, SynthStrip, FSL FAST, TemplateFlow, PyRadiomics, and more).
Temporarily Disabled¶
MRIQC integration (
--run-qc) is temporarily disabled in this release. The CLI flag is accepted but ignored with a deprecation warning. Tests for MRIQC have been removed. Integration will be re-enabled in a future version once upstream compatibility issues are resolved.
Bug Fixes¶
Fixed broken Nipype connections for the Docker-based segmentation path (
--default-segnot set):base.pynow conditionally wires preprocessed modalities (t1w_preproc,t1ce_preproc, etc.) toinit_anat_seg_wfand raw BIDS images toinit_nninteractive_seg_wf, instead of applying nnInteractive-style field names to both paths.Fixed stale
inputnodefield names (t1w_preproc→t1w, etc.) in the integration testtest_workflow_runs_end_to_end.Moved
_pick_firsthelper below all top-level imports inbase.pyto fix E402 (module-level import not at top of file).Removed
os.environ['PYTORCH_ENABLE_MPS_FALLBACK']side-effect atinterfaces/nninteractive.pyimport time; the variable is now set only inside_init_session().Removed stale
brain_maskentry frominit_nninteractive_seg_wfdocstring (the field is not part of the workflow’s inputnode).Replaced unused
from nipype import Workflowwithfrom niworkflows.engine.workflows import LiterateWorkflow as Workflowinworkflows/nninteractive.py.Fixed single-subject workflow description mentioning “functional data” (OncoPrep processes anatomical data only).
Suppressed misleading “ANAT Stage X” logger messages during
--reports-onlyand--boilerplate(no actual processing occurs).
0.2.0 (2025-02-11)¶
Features¶
Integrated MRIQC for no-reference image quality control (
--run-qcCLI flag)New
init_mriqc_wf()andinit_mriqc_group_wf()Nipype workflow factoriesNew
MRIQCandMRIQCGroupNipypeCommandLineinterfacesAutomatic QC gating with configurable IQM thresholds (SNR, CNR, CJV, EFC, FBER, QI1)
Optional
mriqcextra dependency (pip install oncoprep[mriqc])
Deprecations¶
oncoprep.workflows.metricsmodule deprecated in favour ofoncoprep.workflows.mriqcinit_qa_metrics_wf(),init_snr_metrics_wf(),init_coverage_metrics_wf(),init_tissue_stats_wf(), andinit_registration_quality_wf()emitDeprecationWarningand return stub workflowsWill be removed in 0.3.0
Changes¶
CLI flag renamed from
--run-mriqcto--run-qcUpdated documentation: README, quickstart, tutorial, CLI reference, and API docs
0.1.0 (Unreleased)¶
Initial release.
Features¶
BIDS-compliant anatomical preprocessing (T1w, T1ce, T2w, FLAIR)
Multi-model ensemble tumor segmentation (14 BraTS Docker models)
Segmentation fusion (majority voting, SIMPLE, BraTS-specific)
Radiomics feature extraction via PyRadiomics
FreeSurfer surface processing with GIFTI/CIFTI-2 output (planned)
DICOM → BIDS conversion (
oncoprep-convert)fMRIPrep-style HTML quality-assurance reports
Docker and Singularity/Apptainer support
PBS and SLURM job script compatibility