junxnone / tio

Log
Other
10 stars 5 forks source link

Medical Segmentation Decathlon #896

Open junxnone opened 3 years ago

junxnone commented 3 years ago

Reference

Brief

Tasks

Num Tasks Description
01 BrainTumour 4 维 = 3维 + Time(T1 / T1-Gd / T2 / T2-FLAIR)

image

Read image

import nibabel as nib
from nilearn import image
import matplotlib.pyplot as plt
%matplotlib inline

img_path = 'Task01_BrainTumour/imagesTr/BRATS_001.nii.gz'
label_path = 'Task01_BrainTumour/labelsTr/BRATS_001.nii.gz'

img = nib.load(img_path).get_fdata()
label = nib.load(label_path).get_fdata()

print(f'image shape {img.shape}')
print(f'label shape {label.shape}')

plt.figure(figsize=(10,10))
plt.subplot(121)
plt.imshow(img[:,:,60,2],cmap='gray')
plt.title('image')

plt.subplot(122)
plt.imshow(label[:,:,60], cmap='gray')
plt.title('label')

image

import itk
from itkwidgets import view
import itkwidgets
nii = nib.load(img_path).get_fdata()[:,:,:,0]
viewer = view(nii,cmap=itkwidgets.cm.grayscale)
viewer
image image
image image
junxnone commented 3 years ago

898 #591