Useful Functions#

Module to handle abstracted functionalities

Attributes#

Functions#

make_path(paths)

Creates a new path in local system by joining paths, and making any new directories, if

abbreviate_region(region_name)

Converts long region names to their associated abbreviations.

build_label_map(region_names)

Builds a BIDS compliant label map. Loop through CTAB and convert names to

weighted_series_sum(→ numpy.ndarray)

Sum a 4D image series weighted based on time and re-corrected for decay correction.

weighted_series_sum_over_window_indices(...)

Computes a weighted series sum over a specified window of indices for a 4D PET image.

read_plasma_glucose_concentration(→ float)

Temporary hacky function to read a single plasma glucose concentration value from a file.

convert_ctab_to_dseg(ctab_path, dseg_path[, column_names])

Convert a FreeSurfer compatible color table into a BIDS compatible label

capitalize_first_char_of_str(→ str)

Capitalize only the first character of a string, leaving the remainder unchanged.

str_to_camel_case(→ str)

Take a string and return the string converted to camel case.

nearest_frame_to_timepoint(...)

Returns a step function that gets the index of the frame closest to a provided timepoint

get_average_of_timeseries(→ ants.ANTsImage)

Get average of a 4D ANTsImage and return as a 3D ANTsImage.

coerce_outpath_extension(→ str)

Coerce a path to the same absolute path with a provided filetype extension.

Module Contents#

petpal.utils.useful_functions.FULL_NAME = ['Background', 'CorticalGrayMatter', 'SubcorticalGrayMatter', 'GrayMatter', 'gm', 'WhiteMatter',...#
petpal.utils.useful_functions.SHORT_NAME = ['BG', 'CGM', 'SGM', 'GM', 'GM', 'WM', 'WM', 'CSF', 'B', 'ST', 'NB', 'L', 'BS', 'CBM']#