detrending

Removes low-frequency drift and linear trends from preprocessed fMRI time series.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill detrending-cuhk-aim-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detrending
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/detrending
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill detrending-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw fMRI time series contain low-frequency drift and linear trends that distort connectivity, decoding, and statistical analyses. This Skill provides model-level guidance for applying classical detrending to clean BOLD signals before downstream neuroimaging workflows. ## Core Features & Use Cases - Drift and Trend Removal: Removes constant and linear temporal trends from voxel-wise or ROI-wise fMRI time series. - Confound-Aware Cleaning: Optionally combines detrending with confound regression and standardization using a confounds TSV and brain mask. - Delegation-Based Workflow: Coordinates with fmri-skill for preprocessing planning and nilearn-tool for concrete implementation via nilearn's clean_img. - Use Case: A researcher has preprocessed resting-state BOLD images and wants to remove scanner drift before computing functional connectivity matrices, producing cleaned BOLD images and QC summaries. ## Quick Start Ask the assistant to detrend a preprocessed BOLD image with a given TR and optional confounds file, delegating execution to the nilearn denoising script after confirming the preprocessing plan.

Frequently Asked Questions about detrending

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detrend fMRI time series with nilearn?

Use nilearn's clean_img function with the detrend option enabled, passing a preprocessed BOLD image, TR, and optional confounds. This Skill delegates execution to a denoising script that exports cleaned images or ROI time series.

What is detrending in fMRI preprocessing?

Detrending removes constant and linear temporal trends from BOLD time series to stabilize the signal before connectivity or decoding analysis. It is a classical non-deep-learning denoising step, not a predictive modeling method.

Does detrending remove motion and physiological confounds from fMRI data?

No, detrending alone does not remove motion or physiological confounds. It must be combined with confound regression using a confounds table to address those artifacts.

When should I use detrending instead of deep-learning denoising methods?

Use detrending when you want a transparent classical baseline for drift removal before connectivity or decoding, or when the workflow requires standardized temporal preprocessing. It is preferred when interpretability of the cleaning steps matters.

What inputs are required for fMRI detrending?

A preprocessed BOLD image or extracted time series is required, along with the repetition time (TR) for temporal cleaning. Optional inputs include a confounds TSV, a brain mask, and standardization options.