Python API Reference¶
These are the classes and functions in pycortex.
Most commonly used modules¶
quickflat¶
|
Show a Volume or Vertex on a flatmap with matplotlib. |
|
Create a PNG of the VertexData or VolumeData on a flatmap. |
|
Save an svg file of the desired flatmap. |
webgl¶
Makes an interactive viewer for viewing data in a browser
|
Creates a webGL MRI viewer that is dynamically served by a tornado server running inside the current python process. |
|
Creates a static webGL MRI viewer in your filesystem so that it can easily be posted publically for sharing or just saved for later viewing. |
dataset¶
Contains classes for representing brain data in either volumetric or vertex (surface-based) formats for visualization.
|
Encapsulates a 3D volume or 4D volumetric movie. |
|
Contains two 3D volumes for simultaneous visualization. |
|
Contains RGB (or RGBA) colors for each voxel in a volumetric dataset. |
|
Encapsulates a 1D vertex map or 2D vertex movie. |
|
Contains two vertex maps for simultaneous visualization. |
|
Contains RGB (or RGBA) colors for each vertex in a surface dataset. |
|
Wrapper for multiple data objects. |
All the other modules¶
align¶
Contains functions for making alignments between functional data and the surface, or, finding where the brain is.
|
Open GUI for manually aligning a functional volume to the cortical surface for subject. |
|
Create an automatic alignment using the FLIRT boundary-based alignment (BBR) from FSL. |
|
Tweak an alignment using the FLIRT boundary-based alignment (BBR) from FSL. |
anat¶
Contains functions for making a whitematter mask
|
|
|
|
|
Voxelize the whitematter surface to generate the white matter mask |
database¶
Contains a singleton object db of type Database which allows easy access to surface files, anatomical images, and transforms that are stored in the pycortex filestore.
|
Surface database |
freesurfer¶
Contains functions for interfacing with freesurfer
|
Retrive paths for all surfaces for a subject processed by freesurfer |
|
Run Freesurfer’s autorecon-all command for a given freesurfer subject |
|
Perform flattening of a brain using freesurfer |
|
Imports a subject from freesurfer |
|
Imports a flat brain from freesurfer |
|
Show a surface from a Freesurfer subject directory |
|
Make fiducial surface (halfway between white matter and pial surfaces) |
|
|
|
|
|
|
|
Read freesurfer surface file |
|
Load freesurfer curv file for a freesurfer subject |
|
|
|
|
|
|
|
|
|
mapper¶
|
Maps data from epi volume onto surface using various projections |
|
mni¶
Functions for finding MNI transforms for individual subjects and transforming functional data and surfaces to and from MNI space.
|
Compute transform from the space specified by xfm to MNI standard space. |
|
Transform data in volumedata to MNI space, resample at the resolution of the atlas image. |
|
Transform the surface named surfname for subject called subject into MNI coordinates. |
|
Transform data in volarray from MNI space to functional space specified by xfm. |
polyutils¶
|
Represents a single cortical hemisphere surface. |
|
Used to compute distortion metrics between fiducial and another (e.g. |
segment¶
Controls functions for segmentation of white/gray matter and other things in the brain.
|
Run the first initial segmentation for a subject’s anatomy (in Freesurfer). |
|
Initializes an interface to make white matter edits to the surface. |
|
Initializes an interface to make pial surface edits. |
|
Initializes an interface to cut the segmented surface for flatmapping. |
surfinfo¶
Contains functions for computing various surface properties. Mostly wrappers for functions in polyutils.Surface and polyutils.Distortion.
|
Compute smoothed mean curvature of the fiducial surface for the given subject and save it to outfile. |
|
Compute distortion of flatmap relative to fiducial surface and save it at outfile. |
|
Compute cortical thickness as the distance between corresponding pial and white matter vertices for the given subject. |
|
Compute a Tissot’s indicatrix for the given subject and save the result to a file. |
|
utils¶
Contain utility functions
|
Add new flatmap image to the ROI file for a subject. |
|
Resamples data from anatomical space into epi space |
|
Return an epi space mask of the given ID from freesurfer’s automatic segmentation |
|
Gets a colormaps |
|
Gets the cortical mask for a particular transform |
|
|
|
Creates ctm file for the specified input arguments. |
|
Create a dropout Volume showing where EPI signal is very low. |
|
Returns a binary mask of the left and right hemisphere surface voxels for the given subject. |
|
Return a mask for the given ROI(s) |
|
Return a dictionary of roi masks |
|
Return vertices for the given ROIs, or all ROIs if none are given. |
|
Get the distance (in mm) from each functional voxel to the closest point on the surface. |
|
Makes an .ogv movie |
|
|
volume¶
Contains functions for working with volume data
|
Unmask the data, assuming it’s been masked. |
|
Turns volume data into a mosaic, useful for quickly viewing volumetric data with radiological convention (left side of figure is right side of subject). |
|
Resample an epi volume data into anatomical space using scipy. |
|
Resamples data from anatomical space into epi space |
|
Resamples epi-space [data] into the anatomical space for the given [subject] using the given transformation [xfm]. |
|
Resamples anat-space data into the epi space for the given [subject] and transformation [xfm] |
|
|
|
Display a maximum intensity projection for the data, using three subplots |
|
Create a classic “glass brain” view of the data, with the outline |