These functions are a combination of things that work directly on dlabel.nii images and more pure pythonic ways of doing things that are already in ciftify.niio but both ciftify.niio and tigr_parc.dlabelIO are long files so they may be better broken down.. (i.e. ciftify.niio may need to be a folder - not a file).
Functions that are specific to label files are:
DenseLabelsCIFTI - the general class that makes the nibabel representation of the file easier to work with
read_labeltable_from_ciftiheader - reads the label table from the dlabel.nii header and returns it as a pandas dataframe
write_wb_labels_txt - write from a pandas dataframe to the text file and wb_command uses for label tables
Functions that better - (pure python) ways of doing stuff that's already in ciftify.niio..
volume_from_cifti_axis: return a nibabel nifti img of the subcortical data in a cifti file
surf_data_from_cifti_axis(data, axis, surf_name): return a np.array (n_vertices,) of data from given surface in a cifti file (with one may replace ciftify.niio.load_hemisphere_data - and actually a lot of other functions around it that do variations of the same thing
decompose_cifti(img): runs above function and returns data as tuple (left, right, subcortical)
https://github.com/TIGRLab/tigr_parc/blob/master/code/tigr_parc/dlabelIO.py
These functions are a combination of things that work directly on dlabel.nii images and more pure pythonic ways of doing things that are already in ciftify.niio but both ciftify.niio and tigr_parc.dlabelIO are long files so they may be better broken down.. (i.e. ciftify.niio may need to be a folder - not a file).
Functions that are specific to label files are:
Functions that better - (pure python) ways of doing stuff that's already in ciftify.niio..