This function is composed of two other function calls: one that calls a function loading the data, and another which preprocesses the data to the required format.
# TODO: Need to check if any more proprocessing would be required besides summing the tracts!
This function loads a nifty file and returns its volume and header information
Args:
file_paths (list): List containing the input data and target labelled output data
orientation (str): String detailing the current view (COR, SAG, AXL)
file_path (str): Path to the desired file
Returns:
volume (np.array): Array of training image data of data type dtype.
label_map (np.array): Array of labelled image data of data type dtype.
header (class): 'nibabel.nifti1.Nifti1Header' class object, containing image metadata
xform (np.array): Array of shape (4, 4), containing the adjusted voxel-to-world transformation for the spatial dimensions of the resampled data
Raises:
ValueError: "Orientation value is invalid. It must be either >>coronal<<, >>axial<< or >>sagital<< "
"Orientation value is invalid. It must be either >>coronal<<, >>axial<< or >>sagital<< ")
returnvolume,header
defload_and_preprocess(file_paths,orientation):
"""Load & Preprocess
This function is composed of two other function calls: one that calls a function loading the data, and another which preprocesses the data to the required format.
# TODO: Need to check if any more proprocessing would be required besides summing the tracts!
Args:
file_paths (list): List containing the input data and target labelled output data
orientation (str): String detailing the current view (COR, SAG, AXL)
Returns:
volume (np.array): Array of training image data of data type dtype.
label_map (np.array): Array of labelled image data of data type dtype.
header (class): 'nibabel.nifti1.Nifti1Header' class object, containing image metadata