I’ve tryied tu use SimpleITK library for filling hole in a 3D image but when I’m trying to write the image on disk, the code gives me this type of error. Can someone help me to solve this problem or know how what does it mean?
What error are you getting? Using the current version of SimpleITK 2.2.1, the code works without a problem.
Some comments on the code:
In the current version of SimpleITK there is no need to explicitly convert the pathlib.Path object to str.
The way the object oriented interface is used, creating objects and then calling the Execute method for a single use is less appropriate. Use the object oriented interface when you intend to call the same filter multiple times, otherwise use the procedural interface (i.e. output_1 = sitk.GrayscaleFillhole(image_sitk)).