Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import matplotlib.pyplot as plt
import SimpleITK as sitk
from skimage.draw import ellipsoid
from math import ceil
# create our label shape
ell = ellipsoid(6, 10, 16).astype(np.int32)
ell = np.pad(ell, (16,0),'constant')
labels = sitk.GetImageFromArray(ell)