Pycortex Guide logo

Pycortex Guide

OrganizationPopular
NeuroAIHub
pycortex-guide

Domain-validated guidance for cortical surface visualization and brain surface rendering of fMRI data using pycortex: data types (Volume, Vertex, Dataset), 2D cortical flatmaps, 3D WebGL brain viewers, volume-to-surface mapping, FreeSurfer/fMRIPrep integration, ROI management, and surface analysis. Use this skill whenever the user mentions pycortex, `import cortex`, cortical surfaces, brain flatmaps, WebGL brain viewers, cortical surface mapping, or wants to visualize neuroimaging data on the cortex, even if they don't explicitly name pycortex.

Overview

PublisherNeuroAIHub
RepositoryBrainPilot
Skill namepycortex-guide
Stars
1.1K
Forks
74
Bundled files
7
LicenseAGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NeuroAIHub on GitHub. Read the source before you install it.

Installation

Install the Pycortex Guide AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/06_fMRI_Neuroimaging/pycortex-guide
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git /tmp/BrainPilot
mkdir -p .claude/skills
cp -r /tmp/BrainPilot/packages/skills/skills/06_fMRI_Neuroimaging/pycortex-guide .claude/skills/pycortex-guide
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pycortex Guide in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pycortex Guide on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pycortex Guide is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Pycortex Guide

Purpose

Encodes domain knowledge for using pycortex — a Python library for visualizing fMRI and volumetric neuroimaging data on cortical surfaces. Covers data creation, 2D flatmap rendering, interactive 3D WebGL viewers, volume-to-surface mapping, subject database management, FreeSurfer/fMRIPrep integration, and surface geometry analysis.

When to Use This Skill

Activate when the user:

  • Wants to visualize fMRI data on cortical surfaces
  • Mentions pycortex, import cortex, flatmaps, or cortical surface visualization
  • Needs to create Volume, Vertex, or Dataset objects for brain data
  • Wants to generate 2D flatmaps or 3D interactive brain viewers
  • Needs to import FreeSurfer or fMRIPrep subjects into pycortex
  • Works with volume-to-surface mapping or cortical ROIs
  • Needs to align functional data to anatomical surfaces
  • Wants to compute surface properties (curvature, thickness, geodesic distance)

Reference Files

TopicFileWhen to Read
Data typesreferences/dataset-types.mdUser creates Volume, Vertex, RGB, 2D, or Dataset objects
Visualizationreferences/visualization.mdUser wants flatmaps, WebGL viewers, exports, or screenshots
Database & subjectsreferences/database-subjects.mdUser manages subjects, surfaces, transforms, or masks
Mapping & transformsreferences/mapping-transforms.mdUser maps volume↔surface, aligns data, or works with transforms
FreeSurfer & fMRIPrepreferences/freesurfer-fmriprep.mdUser imports subjects from FreeSurfer or fMRIPrep
Surface analysisreferences/surface-analysis.mdUser computes curvature, geodesic distance, ROIs, or distortion
MNI & utilitiesreferences/mni-utils.mdUser transforms to/from MNI space or uses volume utilities

Installation

bash
pip install -U setuptools wheel numpy cython
pip install -U pycortex
# With headless rendering support:
pip install -U 'pycortex[headless]'

Requirements: Python 3.10+, Linux/macOS only. Key dependencies: numpy, scipy, matplotlib, nibabel, h5py, tornado, shapely, lxml.

Overview Pipeline

1. Import subject (FreeSurfer/fMRIPrep)  →  stored in cortex.db
2. Create data objects (Volume/Vertex)    →  wrap arrays with metadata
3. Visualize (quickflat / webgl / export) →  2D flatmaps or 3D viewers
4. Analyze surfaces (curvature, ROIs)     →  surface geometry tools

Quick Start

python
import cortex

# Create a random volume for demo subject "S1" with transform "fullhead"
vol = cortex.Volume.random("S1", "fullhead")

# 2D flatmap
fig = cortex.quickshow(vol, with_curvature=True, with_rois=True)
fig.savefig("flatmap.png")

# Interactive 3D viewer
cortex.webshow(vol)

# Create volume from your own data (3D numpy array)
import numpy as np
data = np.random.randn(31, 100, 100)  # must match transform shape
vol = cortex.Volume(data, "S1", "fullhead", cmap="RdBu_r", vmin=-2, vmax=2)
cortex.quickshow(vol)

# Save/load datasets
ds = cortex.Dataset(my_map=vol)
ds.save("results.hdf")
ds_loaded = cortex.load("results.hdf")

Key Data Types

ClassDescriptionKey Args
VolumeVolumetric data (3D/4D)data, subject, xfmname, cmap, vmin, vmax
VertexSurface vertex data (1D/2D)data, subject, cmap, vmin, vmax
VolumeRGBRGB per voxelred, green, blue, subject, xfmname, alpha
VertexRGBRGB per vertexred, green, blue, subject, alpha
Volume2DTwo volumes, 2D colormapdim1, dim2, subject, xfmname, vmin, vmax, vmin2, vmax2
Vertex2DTwo vertex maps, 2D colormapdim1, dim2, subject, vmin, vmax, vmin2, vmax2
DatasetContainer for multiple views**named_dataviews

Key Visualization Functions

FunctionDescription
cortex.quickshow(data, ...)2D flatmap → matplotlib Figure
cortex.quickflat.make_png(fname, data, ...)Save flatmap as PNG
cortex.quickflat.make_svg(fname, data, ...)Save flatmap as SVG
cortex.quickflat.make_gif(fname, volumes, ...)Animated GIF from volumes
cortex.webshow(data, ...)Interactive 3D WebGL viewer
cortex.webgl.make_static(path, data, ...)Static HTML 3D viewer
cortex.export.save_3d_views(vol, ...)Multi-angle PNG exports
cortex.export.plot_panels(vol, panels, ...)Multi-panel figure

Common Pitfalls

  1. Volume data shape must match the transform dimensions in the database. Use cortex.db.get_xfm(subject, xfmname) to check expected shape.
  2. Subject and transform names must exist in cortex.db before creating Volume objects. Import from FreeSurfer first.
  3. cortex.quickshow is an alias for cortex.quickflat.make_figure — they are the same function.
  4. Vertex data length must match total vertex count (left + right hemisphere). Single-hemisphere data is auto-padded with zeros.
  5. vmin/vmax default to 1st/99th percentile of data. Always set explicitly for consistent colorbars across subjects.
  6. WebGL viewer (webshow) starts a Tornado server — it blocks in scripts. Use in IPython/Jupyter or set autoclose=True.
  7. The pycortex filestore path is set in cortex.options.config. Check with cortex.database.default_filestore.
  8. For headless rendering (no display), install with pip install 'pycortex[headless]' and use cortex.export.save_3d_views(..., headless=True).
  9. cortex.db is a singleton — all operations share the same database instance.
  10. When saving datasets with pack=True, subject geometry and transforms are embedded in the HDF5 file for portability.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pycortex Guide AI skill do?

Domain-validated guidance for cortical surface visualization and brain surface rendering of fMRI data using pycortex: data types (Volume, Vertex, Dataset), 2D cortical flatmaps, 3D WebGL brain viewers, volume-to-surface mapping, FreeSurfer/fMRIPrep integration, ROI management, and surface analysis. Use this skill whenever the user mentions pycortex, `import cortex`, cortical surfaces, brain flatmaps, WebGL brain viewers, cortical surface mapping, or wants to visualize neuroimaging data on the cortex, even if they don't explicitly name pycortex.

Why use Pycortex Guide on TypingMind?

Because you install it once and use it with any model. Pycortex Guide is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pycortex Guide in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/06_fMRI_Neuroimaging/pycortex-guide. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pycortex Guide?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pycortex Guide?

As many as you like. As long as a model supports skills, you can use Pycortex Guide with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pycortex Guide AI skill free?

Yes. It is published on GitHub by NeuroAIHub under the AGPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇