from_nifti

Import in python using from mcot.core._scripts.to_dataframe import from_nifti

mcot.core._scripts.to_dataframe.from_nifti(img: Union[str, nibabel.nifti1.Nifti1Image, numpy.ndarray], mask: Union[None, str, nibabel.nifti1.Nifti1Image, numpy.ndarray] = None, name='nifti') → pandas.core.frame.DataFrame[source]

Converts a NIFTI image into a pandas dataframe

Parameters:
  • img – NIFTI image
  • mask – masks which voxels to actually include (default: any non-zero voxels)
  • name – column name
Returns:

pandas dataframe with unmasked voxels