kmeans

Generates data-driven brain parcellations from neuroimaging features using K-means clustering.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Researchers often need data-driven brain region partitions instead of predefined atlases, but configuring voxel-wise or ROI-wise clustering pipelines from raw neuroimaging data is error-prone. This Skill provides model-level guidance for running K-means brain parcellation workflows with proper preprocessing delegation. ## Core Features & Use Cases - Data-Driven Parcellation: Partition voxels, vertices, or ROI features into parcel label maps from functional or structural neuroimaging features. - Workflow Delegation: Coordinates with fmri-skill, smri-skill, and nilearn-tool for feature preparation, masking, and parcel export. - Use Case: A researcher with preprocessed resting-state fMRI data wants a 200-parcel group-level functional atlas; this Skill guides feature matrix preparation, K-means fitting, and export of parcel labels and cluster summaries. ## Quick Start Ask the assistant to run a K-means brain parcellation with 200 clusters on your preprocessed fMRI image list and group mask, exporting the parcel label map to an output directory.

Frequently Asked Questions about kmeans

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

FAQPage Schema
How do I perform brain parcellation with K-means on fMRI data?

Prepare a voxel-wise or ROI-wise feature matrix from preprocessed fMRI data, choose a target parcel count, then fit K-means to assign each spatial unit to a parcel. The workflow exports a parcel label map and cluster summaries through the Nilearn-based reference script.

What inputs does K-means brain parcellation require?

It requires a preprocessed feature matrix or aligned neuroimaging image list and a target cluster count. Optional inputs include a brain mask image, cohort definitions, and initialization parameters.

Can K-means parcellation be used for disease subtyping?

No, this Skill is specific to spatial brain parcellation. For subject-level disease subtyping, use the subject-subtyping skill, which wraps the maintained implementation in models/subtyping/.

What are the limitations of K-means for brain parcellation?

K-means requires a fixed cluster count and is sensitive to initialization, preprocessing choices, and feature definition. Resulting parcellations may vary across cohorts and may not align with standard anatomical atlases.

When should I use K-means instead of a predefined brain atlas?

Use K-means when you want data-driven region partitioning rather than an existing atlas, need parcel labels for downstream connectivity or decoding analysis, or prefer a classical unsupervised baseline over deep learning methods.