У меня проблемы с кодом. Содержимое clahe_slices3 сохранено в 3D. Я хочу, чтобы содержимое clahe_slices1 сохранялось в первом измерении, clahe_slices2 — во втором измерении, а clahe_slices3 — в третьем измерении. В clahe_slices для вашего сведения приведена форма каждого из них: clahe_slices.shape=(240,240,155) clahe_slices1.shape=(240,240,155) clahe_slices2.shape=(240,240,155) clahe_slices3.shape=(240,240,155) мой код
nifti_img = nib.load(file_path)
# Get the image data
img_data = nifti_img.get_fdata()
clahe_slices = np.zeros_like(img_data)
clahe_slices1 = np.zeros_like(img_data)
clahe_slices2 = np.zeros_like(img_data)
clahe_slices3 = np.zeros_like(img_data)
#I have filtered slides, but when editing the dimension must be specified like #this, and when I specify the dimension, it filters the other dimensions, but #it does not verify that the slide content in the other dimensions is empty, #and thus there are problems in the result.
#Because of this, I thought of applying the filter and specifying a dimension #each time, and in the end I collect the results of each dimension to obtain #correct results. Here, when I specify that, it does not save the result of #clahe_slices1 and clahe_slices2, but only the result of the last episode in #all dimensions. I'm still new to nifti anf numpy.
#Please give me a solution to this, thank you
#The code is very long and only included the important elements in
#the problem
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[2]):
# Assuming the slice dimension is the third dimension
clahe_slices[:, :, i] = clahe_slices3[:, :, i]
for i in range(img_data.shape[1]):
# Assuming the slice dimension is the second dimension
clahe_slices[:, i, :] = clahe_slices2[:, i, :]
# Example usage:
return clahe_slices
У меня проблемы с кодом. Содержимое clahe_slices3 сохраняется во всех измерениях в clahe_slices. Я хочу, чтобы содержимое clahe_slices1 сохранялось в первом измерении, clahe_slices2 — во втором измерении, а clahe_slices3 — в третьем измерении. В clahe_slices
У меня проблемы с кодом. Содержимое clahe_slices3 сохранено в 3D. Я хочу, чтобы содержимое clahe_slices1 сохранялось в первом измерении, clahe_slices2 — во втором измерении, а clahe_slices3 — в третьем измерении. В clahe_slices для вашего сведения приведена форма каждого из них: clahe_slices.shape=(240,240,155) clahe_slices1.shape=(240,240,155) clahe_slices2.shape=(240,240,155) clahe_slices3.shape=(240,240,155) мой код
[code] nifti_img = nib.load(file_path)
# Get the image data img_data = nifti_img.get_fdata() clahe_slices = np.zeros_like(img_data) clahe_slices1 = np.zeros_like(img_data) clahe_slices2 = np.zeros_like(img_data) clahe_slices3 = np.zeros_like(img_data)
#I have filtered slides, but when editing the dimension must be specified like #this, and when I specify the dimension, it filters the other dimensions, but #it does not verify that the slide content in the other dimensions is empty, #and thus there are problems in the result. #Because of this, I thought of applying the filter and specifying a dimension #each time, and in the end I collect the results of each dimension to obtain #correct results. Here, when I specify that, it does not save the result of #clahe_slices1 and clahe_slices2, but only the result of the last episode in #all dimensions. I'm still new to nifti anf numpy. #Please give me a solution to this, thank you #The code is very long and only included the important elements in #the problem 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[2]): # Assuming the slice dimension is the third dimension clahe_slices[:, :, i] = clahe_slices3[:, :, i] for i in range(img_data.shape[1]): # Assuming the slice dimension is the second dimension clahe_slices[:, i, :] = clahe_slices2[:, i, :]
# Example usage: return clahe_slices[/code]
У меня проблемы с кодом. Содержимое clahe_slices3 сохраняется во всех измерениях в clahe_slices. Я хочу, чтобы содержимое clahe_slices1 сохранялось в первом измерении, clahe_slices2 — во втором измерении, а clahe_slices3 — в третьем измерении. В clahe_slices
Ниже приведен мой код для чтения целочисленного значения, разделенного запятыми (Ascii), из файла .txt и сохранения в целочисленном массиве. И из целочисленного массива в целое число для преобразования целого числа в символ. Чтобы я мог получить...
Для сохранения растровых изображений в виде файлов (png, jpeg и т. д.) в каталоге filesDir по мере их получения и добавления ссылки в комнату для последующего извлечения.
Как избежать сохранения дубликатов растровых изображений в виде файлов png при...
Для сохранения растровых изображений в виде файлов (png, jpeg и т. д.) в каталоге filesDir по мере их получения и добавления ссылки в комнату для последующего извлечения.
Как избежать сохранения дубликатов растровых изображений в виде файлов png при...
Это код, который я использую для записи веб -камеры и сохранения его. Видео успешно сохраняется, и последняя строка также исключена, но я не могу открыть его в каталоге, поскольку он дает это: «Ошибка загрузки файла для моей webcam_new.mp4
c: \...
Это код, который я использую для записи веб -камеры и сохранения его. Видео успешно сохраняется, и последняя строка также исключена, но я не могу открыть его в каталоге, поскольку он дает это: «Ошибка загрузки файла для моей webcam_new.mp4
c: \...