Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Mri Preprocessing

ASecurity

Structural and functional MRI preprocessing — bias correction, skull-stripping, registration, and QC with fMRIPrep-style pipelines.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsrustgobashdebugging

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill mri-preprocessing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mri Preprocessing?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Mri Preprocessing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-mri-preprocessing/badge)](https://www.skillsdirectory.com/skills/aicodedecode-mri-preprocessing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: mri-preprocessing
description: Structural and functional MRI preprocessing — bias correction, skull-stripping, registration, and QC with fMRIPrep-style pipelines.
category: scientific
---

## Overview

mri-preprocessing covers the unglamorous but decisive early steps of MRI analysis: converting
DICOMs, correcting intensity inhomogeneities, skull-stripping, tissue segmentation, and registering
brains to templates — plus the QC discipline that catches the misregistrations and artifacts that
would otherwise become "results."

Good preprocessing is invisible; bad preprocessing is the paper. This skill focuses on structural
(T1/T2) and the preprocessing half of functional pipelines, with fMRIPrep as the recommended
reference implementation.

## When to use

- Setting up a new MRI study: sequence choices that affect preprocessing (fieldmaps, multiband,
  resolution).
- DICOM to BIDS conversion and dataset organization.
- Structural preprocessing: bias field correction, skull-stripping, segmentation, surface
  reconstruction.
- Functional preprocessing: motion correction, susceptibility distortion correction, coregistration,
  normalization.
- QC: visual checks, automated reports, exclusion criteria.
- Troubleshooting: failed skull-strips, bad normalizations, ghosting, dropout.

## Core concepts

- **BIDS first.** Organize data in Brain Imaging Data Structure before anything else
  (`sub-01/ses-01/anat/sub-01_T1w.nii.gz` + JSON sidecars). Every major tool reads BIDS; ad-hoc
  folder layouts break reproducibility and collaboration.
- **Bias field correction.** Scanner inhomogeneities create smooth intensity gradients (N4ITK).
  Correct before segmentation — tissue classifiers assume uniform intensities per tissue class.
- **Skull-stripping.** Removing non-brain tissue (antsBrainExtraction, HD-BET, SynthStrip).
  Failures are common with lesions, atrophy, or unusual anatomy — always inspect; a bad brain
  mask poisons everything downstream.
- **Segmentation.** GM/WM/CSF probability maps (FAST, Atropos) feed normalization, nuisance
  regression (CompCor), and volumetry. Partial-volume effects at tissue boundaries are
  unavoidable at typical resolutions — interpret thin cortical findings cautiously.
- **Susceptibility distortion correction.** EPI images warp where the field is inhomogeneous
  (orbitofrontal cortex, temporal poles). A fieldmap or reverse-phase-encoding acquisition
  (TOPUP) unwarpes them; without it, "activations" can be mislocalized by centimeters.
- **Coregistration and normalization.** Functional→structural (boundary-based registration is
  the gold standard), structural→template (MNI152 via ANTs SyN). Check every subject visually —
  normalization failures are silent and common in lesioned or pediatric brains.
- **Motion.** Six-parameter rigid-body realignment; framewise displacement quantifies it.
  Scrubbing/censoring high-motion volumes is standard, but motion correlates with group
  (patients move more) — censoring can bias group comparisons, so report motion by group.
- **fMRIPrep as default.** It implements the community-consensus pipeline with per-subject HTML
  reports. Use it unless you have a specific reason not to, and cite its boilerplate methods text.

## Practical workflow

1. **Convert and validate.** `dcm2niix` → BIDS; run the BIDS validator. Fix naming now — renaming
   mid-project breaks provenance.
2. **Collect fieldmaps.** Acquire blip-up/blip-down EPI or a fieldmap sequence; preprocessing
   without distortion correction is a known-weakness choice, documented as such.
3. **Run fMRIPrep.** One command per dataset with consistent template and output spaces. Keep the
   working directory for debugging.
4. **QC every subject.** Read the HTML reports: brain mask outlines, coregistration edges,
   normalization warps, carpet plots, FD traces. Reject or flag failures with written criteria.
5. **Derivatives.** Use the preprocessed outputs + confound files (motion, CompCor, FD) as inputs
   to GLM, connectivity, or MVPA — never re-derive preprocessing inside the analysis script.
6. **Document.** Pipeline name + version, template, and exclusion counts go in the methods; share
   the boilerplate text fMRIPrep generates.

Example command sketch:
```bash
dcm2niix -b y -z y -o bids/ dicoms/
fmriprep bids/ derivatives/ participant --fs-license-file license.txt \
  --output-spaces MNI152NLin2009cAsym:res-2 --use-syn-sdc warn
```

## Common pitfalls

- Skipping distortion correction and mislocalizing frontal/temporal results.
- Trusting automated brain masks without visual inspection.
- Normalizing lesioned brains to a healthy template without cost-function masking.
- Motion scrubbing that differentially removes patient data.
- Mixing template spaces across studies (MNI152 variants differ by millimeters — enough to matter).
- Re-running preprocessing with tweaked parameters until results look "better" (preprocessing
  degrees of freedom are still degrees of freedom — preregister the pipeline).

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →