to_dataframe

Usage

Run using mc_script to_dataframe after installation or using ~ndcn0236/bin/mc_script to_dataframe on jalapeno.

Import in python using from mcutils.scripts import to_dataframe

Documentation

Converts a NIFTI/GIFTI/CIFTI file into a pandas dataframe

Each non-masked greyordinate (i.e., voxel or vertex) becomes one line in the resulting dataframe. Each file becomes a column.

The output dataframe will be stored in the feather format, which is a language agnostic format for storing tables (https://blog.rstudio.com/2016/03/29/feather/)

Functions

convert_filenames(filenames[, vol_mask, …])

Converts the list of filenames into a single pandas dataframe

dataframe_to_array(dataframe, names)

Writes a dataframe back to disc

from_cifti(filename[, basename])

Converts a cifti file into a pandas dataframe

from_gifti(img[, mask, hemisphere, basename])

Converts a GIFTI image into a pandas dataframe

from_nifti(img[, mask, name])

Converts a NIFTI image into a pandas dataframe

to_nifti(dataframe, names, reference)

Writes the data from a pandas dataframe to a NIFTI file on disc

CLI interface

add_to_parser(parser)

Creates the parser of the command line arguments

run_from_args(args)

Runs the script based on a Namespace containing the command line arguments