# NiPreps Hack 2025
## Dates
<!--May 26-28, 2025 (pending confirmation from venue)-->
Apr 30-May 2, 2025
## Themes
### NiPost (after-preprocessing NiPreps)
Projects that consume NiPreps derivatives (minimal or full) and perform further processing.
Current efforts include fmripost-aroma, fmripost-rapidtide, fmripost-phase, fmripost-tedana.
We would also be interested in abstracting portions of these apps into a library downstream tools can use (fmripost-template and/or fmripostflows?).
**Potential side project**. A possible side project is to inspect [DeepPrep](https://deepprep.readthedocs.io) from a fit-transform compatibility perspective. Plus Feilong's surface resampling work.
**Team**
- Taylor Salo
- Matt Cieslak
- Steven Meisler
- Blaise Frederick (fMRIPost-rapidtide)
- Feilong (resampling post)
- Salim (fMRIPost-tedana)
- Ashley (fMRIPost-tedana)
- Dylan
- Andre
**Preliminary work** (TBD)
- Decide actual NiPosts to work on:
- We'll be focused on fMRIPost-rapidtide, fMRIPost-tedana, and fMRIPost-template.
- [fMRIPost-AROMA](https://github.com/nipreps/fmripost-aroma): Runs ICA-AROMA on fMRIPrep outputs, as long as MNI152NLin6Asym-space outputs were requested. Mostly functional, minus writing out to requested output spaces and ingressing minimal fMRIPrep derivatives.
- **[fMRIPost-rapidtide](https://github.com/nipreps/fmripost-rapidtide): Runs [rapidtide](https://rapidtide.readthedocs.io/en/latest/usage_rapidtide.html), a tool for estimating systemic low-frequency oscillation signals from fMRI data and applying dynamic global signal regression. Some of the skeleton is in place, but this is not operational yet. The author of rapidtide, Blaise Frederick, has been supportive of this project and has helped out.**
- [fMRIPost-phase](https://github.com/nipreps/fmripost-phase): Leverages phase data in complex-valued fMRI to produce a number of derivatives, including phase jolt/jump time series, phase regression outputs, and HighCor confounds. A lot of the code is implemented, but it's not working yet.
- **[fMRIPost-tedana](https://github.com/ME-ICA/fmripost-tedana): Applies multi-echo ICA with [tedana](https://tedana.readthedocs.io/en/stable/) to denoise multi-echo fMRI data, as long as fMRIPrep was run with the `--me-output-echos` flag. Little to no code is actually written yet.**
- [QSIRecon](https://github.com/PennLINC/qsirecon): Working tool to apply reconstruction workflows to minimally-preprocessed DWI data. Currently supports QSIPrep, UK Biobank, and HCP-YA derivatives. Hackathon goal would be to add ability to ingress dmriprep derivatives.
- Any other post-processing steps folks would like to see in a BIDS App?
- Data?
- For fMRIPost-AROMA and fMRIPost-rapidtide, we can use https://gin.g-node.org/nipreps-data/ds000005-fmriprep.
- dwidenoise integration (fmripost-phase)
- Taylor has started using his Python translation of NORDIC for now, but it would be good to switch to dwidenoise once the licensing issues are resolved.
### NiFreeze
Motion and other volume-wise artifacts are idiosyncratic to neuroimaging modalities that probe the evolution of metabolism (e.g., functional MRI, PET), physiological dynamics (e.g., ASL, contrast-enhanced MRI), or varying excitation (e.g., diffusion MRI—dMRI). The problem is generally tackled through image realignment; however, the methodological approach is substantially different depending on modalities (e.g., MRI, PET) and interest (e.g., human adult or rodent brain). We present NiFreeze, an open framework inspired by FSL’s eddy for volume-to-volume artifact estimation and outlier detection. NiFreeze generalizes the estimation process beyond a subset of dMRI schemes by enabling the interchangeability of modeling.
As eddy, NiFreeze features a “leave-one-volume-out” approach to estimating volume-wise motion, distortion, and distribution outliers. The framework relies on generative models that can predict a 3D volume that is held out from training on the remainder of the volumes in the series, thereby iteratively obtaining unbiased references. The reference is then used as the target in an image registration setup (for head motion estimation) and for distributional reference (for outlier detection). NiFreeze replicates the original implementation of eddy, which employs Gaussian processes regression to generate the references to estimate outliers, head-motion, and linear distortions derived from eddy currents. Models follow DIPY’s interface, facilitating their potential integration in already established neuroimaging analysis pipelines. This pre-registration outlines three experiments to evaluate NiFreeze’s utility across dMRI, fMRI, and PET modalities. Our methodology includes performance benchmarking and adaptation of NiFreeze for diverse neuroimaging applications. We aim to address the limitations of proprietary tools, fostering broader adoption in open science through multi-modal, multi-disciplinary convergence.
**Team**:
- Jon Haitz
- Oscar
- Martin
**Preliminary work**
- This project is run as a pre-registration/RR so the preliminary work is being described there.
### fMRIPrep pre/post extensions (rodents, infants)
Rewrite fMRIPrep-rodents using the fit-transform
model, based on current *fMRIPrep*'s codebase. Consider whether this can be achieved without forking from
fMRIPrep at this point.
**Team**:
- Eilidh
- Mathias
- Dorota
- Yibei
**Preliminary work**:
- EMN: Identify preprocessing steps with major divergencies between fMRIPrep-adults and rodents. Potentially, we could fork fmriprep as is now and add one issue there for each step that needs attention.
- EMN/OE: Paper draft. Perhaps we do not need to run it like NiFreeze as a Registered Report (RR), but try to draft some methods paper where we have some anticipation of when we are going to claim victory and what kinds of evaluations we are going to have.
- NiRodents repository overhaul. Following the identification of tasks, try to revamp NiRodents as the NiWorkflows for rodents. It'd be fair that we consider renaming NiWorkflows as NiAdults (as opposed to NiBabies and NiRodents and potentially, NiNHP).
- https://hackmd.io/eKTkPwB3RBecHAVAdmfHzQ?both
### PET NiPreps (PETPrep mostly)
PETPrep prepares PET data for pharmacokinetic modeling.
Our goal would be to adapt [petprep_hmc](https://github.com/mnoergaard/petprep_hmc)
(motion correction)
and [petprep_extract_tacs](https://github.com/mnoergaard/petprep_extract_tacs)
(coregistration, normalization, partial volume correction and segmentation)
into a fit-transform workflow, re-using/aligning as much as possible the code with that of fMRIPrep. Specific targets include TemplateFlow integration, surface derivatives,
and visual reports with methods boilerplate.
**Who to ask about this project**:
- Martin
- Oscar
- Chris
**Preliminary work** (TBD)
### MRIQC / potentially NiQC (PETQC)
This project would work on extending MRIQC to cover more modalities and improve its features.
Within scope are activities towards definition of IQMs in multi-echo fMRI, improvement/development of automatic QA/QC decisors, investigating the reliability of IQMs (e.g., introducing randomness *à la Chatelain*), improving the processing (e.g., integrating NiFreeze), improving visualizations for supported modalities, or extending all previous aspects (visualization, processing, IQMs, WebAPI/CrowdMRIQC) to new modalities (PET seems a nice target for the hack)
**Team**:
- Melanie
- McKenzie
- Celine
- Ross (WebAPI)
- Martin
**Preliminary work** (TBD)
### Subsidiary focuses:
- NiTransforms
- Nipreps fit workflows and nifreeze generate transforms.
Where feasible, we would like to encode the transforms and
their applications in a library that is not nipreps-specific.
- Reliability/LTS
- Migas/Sentry/telemetry
- WebAPI
- Rename default branch names to `main` across `NiPreps`:
- Have `master` as theirs
- Code: [nipreps/dmriprep](https://github.com/nipreps/dmriprep), [nipreps/fmriprep](https://github.com/nipreps/fmriprep), [nipreps/fmriprep-rodents](https://github.com/nipreps/fmriprep-rodents), [nipreps/micro-nipype](https://github.com/nipreps/micro-nipype), [nipreps/migas-server](https://github.com/nipreps/migas-server), [nipreps/mriqc](https://github.com/nipreps/mriqc), [nipreps/mriqcwebapi](https://github.com/nipreps/mriqcwebapi), [nipreps/nibabies](https://github.com/nipreps/nibabies), [nipreps/nirodents](https://github.com/nipreps/nirodents), [nipreps/niworkflows](https://github.com/nipreps/niworkflows), [nipreps/nondefaced-detector](https://github.com/nipreps/nondefaced-detector), [nipreps/sdcflows](https://github.com/nipreps/sdcflows), [nipreps/smriprep](https://github.com/nipreps/smriprep)
- Data: [nipreps-data/bcp](https://gin.g-node.org/nipreps-data/bcp), [nipreps-data/bcp-derivatives](https://gin.g-node.org/nipreps-data/bcp-derivatives), [nipreps-data/bootcamp-geneva-2024](https://gin.g-node.org/nipreps-data/bootcamp-geneva-2024), [nipreps-data/brain-extraction-tests](https://gin.g-node.org/nipreps-data/brain-extraction-tests), [nipreps-data/hcph-mini](https://gin.g-node.org/nipreps-data/hcph-mini). [nipreps-data/hbn-mriqc](https://gin.g-node.org/nipreps-data/hbn-mriqc), [nipreps-data/HCP101006](https://gin.g-node.org/nipreps-data/HCP101006), [nipreps-data/HCP101006-derivatives](https://gin.g-node.org/nipreps-data/HCP101006-derivatives), [nipreps-data/tests-nifreeze](https://gin.g-node.org/nipreps-data/tests-nifreeze)
- CM: Many GHA workflow files have the `master` name hard-coded as the target branches, so maybe prior to renaming both `main` and `master` should be added.
- The links in https://www.nipreps.org/ pointing to specific examples of files will need to be changed as well.