nibabel-skill

Load and validate NIfTI files, inspect affines, and convert voxel coordinates.

78|3|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroClaw --skill nibabel-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nibabel-skill
Source: https://github.com/CUHK-AIM-Group/NeuroClaw/tree/main/skills/nibabel-skill
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroClaw --skill nibabel-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires nibabel, numpy, pandas, and includes scripts (resource) components.

What problem does it solve?

This skill provides a nibabel-based, low-level neuroimaging I/O toolkit for loading, validating, and manipulating NIfTI images and reading FreeSurfer geometry/annotations.

Core Features & Use Cases

  • NIfTI loading, shape and affine inspection, and saving derived images
  • Voxel/world coordinate conversion and atlas/FreeSurfer I/O
  • Lightweight, nibabel-centric utilities to seed downstream neuroimaging workflows

Quick Start

Demonstrate a nibabel workflow by loading a NIfTI, inspecting its shape and affine, and saving a derived image.

Frequently Asked Questions about nibabel-skill

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

FAQPage Schema
How do I inspect a NIfTI file's shape and affine matrix using Python?

NIfTI affine inspection uses nibabel to load the image and return both the voxel array shape and the 4x4 affine matrix mapping voxel indices to world coordinates, enabling geometry validation for neuroimaging workflows.

How do I convert voxel coordinates to world coordinates in neuroimaging?

Voxel-to-world coordinate conversion applies the NIfTI image's affine matrix to voxel indices, yielding spatial coordinates in the anatomical reference frame. This requires loading the NIfTI file with nibabel and numpy to perform the matrix multiplication.

How do I save a modified NIfTI image and export coordinate tables?

Saving a modified NIfTI image uses nibabel to write a derived .nii copy preserving the affine header, while coordinate tables can be exported to CSV using pandas, generating structured outputs for downstream neuroimaging analysis.

Do I need pandas to work with NIfTI files in this workflow?

Pandas is only required if you need to export coordinate or metadata tables to CSV format. Core NIfTI loading, shape validation, and affine inspection rely on nibabel and numpy, making pandas an optional dependency for data export tasks.

What's the best way to validate NIfTI geometry before running atlas analysis?

Validating NIfTI geometry involves loading the image with nibabel to check the shape against expected dimensions and inspecting the affine matrix for correct spatial orientation. This ensures atlas alignment before coordinate-based analysis.