make a set of 3D images into a 4D image

Per Brad’s pointer to the JoinSeriesFilter, below is procedural code to do it:

import SimpleITK as sitk

img = sitk.Image([512,128,200], sitk.sitkUInt8)
print(img.GetSize())
res = sitk.JoinSeries([img]*3) #join list of three images
print(res.GetSize())
1 Like