Skip to content

Instantly share code, notes, and snippets.

@thewtex
Created November 4, 2015 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewtex/ce403fef7bc09ca5392d to your computer and use it in GitHub Desktop.
Save thewtex/ce403fef7bc09ca5392d to your computer and use it in GitHub Desktop.
import itk
# unsigned short
PixelType = itk.US
Dimension = 3
image = itk.Image[PixelType, Dimension].New()
start = itk.Index[Dimension]()
start[0] = 0
start[1] = 0
start[2] = 0
size = itk.Size[Dimension]()
size[0] = 200
size[1] = 200
size[2] = 200
region = itk.ImageRegion[Dimension]()
region.SetSize(size)
region.SetIndex(start)
image.SetRegions(region)
image.Allocate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment