def load_data(file_path, orientation): volume_nifty, labelmap_nifty = nb.load(file_path[0]), nb.load(file_path[1]) volume, labelmap = volume_nifty.get_fdata(), labelmap_nifty.get_fdata() volume = (volume - np.min(volume)) / (np.max(volume) - np.min(volume)) volume, labelmap = preprocessor.rotate_orientation(volume, labelmap, orientation) return volume, labelmap, volume_nifty.header
def load_data_mat(file_path, orientation): data = sio.loadmat(file_path) volume = data['DatVol'] labelmap = data['LabVol'] volume = (volume - np.min(volume)) / (np.max(volume) - np.min(volume)) volume, labelmap = preprocessor.rotate_orientation(volume, labelmap, orientation) return volume, labelmap