I'm trying to perform a skull stripping with simpleITK in python. I'm using the StripTsImageFilter function as follows:
#upload data
# Path of nii img
path = r'C:\Users\Kate\Jupyter\DataThesis\PROGRESSION\0003\fet.nii.gz'
# Read the .nii image with SimpleITK:
img = sitk.ReadImage(path)
#read atlas and atlasmap
#Obtained from 3DSlicer documentation: https://www.slicer.org/wiki/Documentation/Nightly/Modules/SwissSkullStripper
atlas = sitk.ReadImage(r'C:\Users\Kate\Jupyter\thesis\atlasImage.mha')
atlasMask = sitk.ReadImage(r'C:\Users\Kate\Jupyter\thesis\atlasMask.mha')
#Skull stripping
#https://www.istb.unibe.ch/e43946/e43949/e158631/e187931/pane187932/e187939/files187941/article_eng.pdf
brainMask = sitk.StripTsImageFilter(img, atlas, atlasMask)
I get the error 'AttributeError: module 'SimpleITK' has no attribute 'StripTsImageFilter'' I have tried implementing img.StripTsImageFilter and tried using sitk.SkullStrip.StripTsFilter as well.
Does anyone know how to solve this?
StripTsImageFilter is a 'remote' module for ITK. So it is not wrapped by SimpleITK and is not even built by default in ITK.
To gain access to it in Python you're going to have to use ITK's Python wrapping, and you're going to have to build ITK-Python yourself, since it is not in the pre-build ITK-Python on PyPi.