CerebNet.datasets.utils

CerebNet.datasets.utils.bounding_volume_offset(img, target_img_size, image_shape=None)[source]

Find the center of the non-zero values in img and returns offsets so this center is in the center of a bounding volume of size target_img_size.

CerebNet.datasets.utils.filter_blank_slices_thick(data_dict, threshold=10)[source]

Function to filter blank slices from the volume using the label volume :param dict data_dict: dictionary containing all volumes need to be filtered :return:

CerebNet.datasets.utils.load_talairach_coordinates(tala_path, img_shape, vox2ras)[source]

Load talairach coordinates from file.

CerebNet.datasets.utils.map_label2subseg(mapped_subseg, label_type='cereb_subseg')[source]

Function to perform look-up table mapping from label space to subseg space

CerebNet.datasets.utils.map_size(arr, base_shape, return_border=False)[source]

Resize the image to base_shape.

CerebNet.datasets.utils.normalize_array(arr)[source]

Normalize the data array to [0, 1].