data_fiso = noddi_data.get_fiso().transpose(1, 0, 2)[::-1, ::-1] data_ficvf = noddi_data.get_ficvf().transpose(1, 0, 2)[::-1, ::-1] data_gfa = noddi_data.get_gfa().transpose(1, 0, 2)[::-1, ::-1] # data_odi[data_odi>max_y[0]] = max_y[0] # data_fiso[data_fiso>max_y[1]] = max_y[1] # data_ficvf[data_ficvf>max_y[2]] = max_y[2] # data_gfa[data_gfa>max_y[3]] = max_y[3] slice_use = 22 prediction_1d = predict.golkov_multi(data_full, n_directions).transpose(1, 0, 2, 3)[::-1, ::-1] prediction_2d = predict.model_2d(data_full, n_directions).transpose(1, 0, 2, 3)[::-1, ::-1] prediction_raw = predict.model_raw(data_raw, n_directions).transpose(1, 0, 2, 3)[::-1, ::-1] prediction_raw_new = predict.model_raw_new(data_raw, n_directions).transpose( 1, 0, 2, 3)[::-1, ::-1] montage_1 = np.concatenate( (data_odi[:, :, slice_use], data_fiso[:, :, slice_use], data_ficvf[:, :, slice_use], data_gfa[:, :, slice_use] / 0.5), axis=1) montage_2 = np.concatenate( (prediction_1d[:, :, slice_use, 0], prediction_1d[:, :, slice_use, 1], prediction_1d[:, :, slice_use,
data_fiso = noddi_data.get_fiso() data_ficvf = noddi_data.get_ficvf() data_gfa = noddi_data.get_gfa() # data_md = noddi_data.get_md() # data_ad = noddi_data.get_ad() # data_fa = noddi_data.get_fa() data_odi[data_odi > max_y[0]] = max_y[0] data_fiso[data_fiso > max_y[1]] = max_y[1] data_ficvf[data_ficvf > max_y[2]] = max_y[2] data_gfa[data_gfa > max_y[3]] = max_y[3] # data_md[data_md>max_y[4]] = max_y[4] # data_ad[data_ad>max_y[5]] = max_y[5] # data_fa[data_fa>max_y[6]] = max_y[6] prediction = predict.model_2d(data_full, n_channels, loss_type=loss_type) slice_use = 25 montage_top = np.concatenate( (data_odi[:, :, slice_use], data_fiso[:, :, slice_use], data_ficvf[:, :, slice_use]), axis=1) montage_bottom = np.concatenate( (prediction[:, :, slice_use, 0], prediction[:, :, slice_use, 1], prediction[:, :, slice_use, 2]), axis=1) montage_combine = np.concatenate( (montage_top, montage_bottom, abs(montage_top - montage_bottom)), axis=0)
directions = [128, 64, 32, 24, 16, 8] seeds = [100, 225, 300, 325, 400, 425, 500, 525, 600] for patient_number in test_cases: for n_directions in directions: noddi_data = noddistudy.NoddiData(patient_number) max_y_path = "/v/raid1b/egibbons/MRIdata/DTI/noddi/max_y_2d.h5" max_y = readhdf5.read_hdf5(max_y_path, "max_y") data_full = noddi_data.get_full() prediction_2d = predict.model_2d(data_full, n_directions, random_seed=400) hf = h5py.File( "/v/raid1b/egibbons/MRIdata/DTI/noddi/processing/%s_%i_directions_2d.h5" % (patient_number, n_directions), "w") hf.create_dataset("predictions", data=prediction_2d) hf.close prediction_1d_res = predict.model_1d(data_full, n_directions, random_seed=400) hf = h5py.File( "/v/raid1b/egibbons/MRIdata/DTI/noddi/processing/%s_%i_directions_1d_res.h5" % (patient_number, n_directions), "w")