Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move dlabelIO functions from tigr_parc to ciftify #152

Open
edickie opened this issue May 11, 2021 · 0 comments
Open

move dlabelIO functions from tigr_parc to ciftify #152

edickie opened this issue May 11, 2021 · 0 comments

Comments

@edickie
Copy link
Owner

edickie commented May 11, 2021

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:

  • 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant