I have problems with the code. clahe_slices3 content saved in 3D. I want the content of clahe_slices1 to be saved in the first dimension, clahe_slices2 in the second dimension, and clahe_slices3 in the third dimension. In clahe_slices, here for your information is the shape of each one: clahe_slices.shape=(240,240,155) clahe_slices1.shape=(240,240,155) clahe_slices2.shape=(240,240,155) clahe_slices3.shape=(240,240,155) my code img_data = nifti_img.get_fdata(). img_data = nifti_img.get_fdata() clahe_slices1 = np.zeros_like(img_data) img_data = nifti_img.get_fdata() clahe_slices2 = np.zeros_like(img_data) img_data = nifti_img.get_fdata() clahe_slices3 = np.zeros_like(img_data) img_data = nifti_img.get_fdata() clahe_slices = np.zeros_like(img_data). for i in range(img_data.shape[0]): # Assuming the slice dimension is the first dimension clahe_slices[i, :, :] = clahe_slices1[i, :, :] for i in range(img_data.shape[1]): # Assuming the slice dimension is the second dimension clahe_slices[:, i, :] = clahe_slices2[:, i, :] for i in range(img_data.shape[2]): # Assuming the slice dimension is the third dimension clahe_slices[:, :, i] = clahe_slices3[:, :, i]
I have problems with the code. clahe_slices3 content saved in all dimensions in clahe_slices. I want the content of clahe_slices1 to be saved in the first dimension, clahe_slices2 in the second dimension, and clahe_slices3 in the third dimension. In clahe_slices,