コード例 #1
0
ファイル: data_utils.py プロジェクト: Zeigar/quickNAT_pytorch
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
コード例 #2
0
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