I'm using SimpleITK to load in a layered tiff image, its a volumetric image having 30 planes/slices.
After playing around a lot with skimage
and imageio
Ive found out that SimpleITK
is the best way to handle volumetric images but the problem is that none of the functions seem to work for my image.
img = sitk.ReadImage(path)
After reading the image in, I can easily convert it to numpy
and even display it using sitk.Show()
so its loading up properly. but any function I use on it such as:
img_s = sitk.CurvatureFlow(img, 0.125, 5)
# or
sitk.IntensityWindowing(img)
# or
img_m = sitk.ConnectedThreshold(img, (257,419,7))
gives the warning:
sitk::ERROR: Pixel type: vector of 16-bit unsigned integer is not supported in 3D byclass itk::simple::
I tried casting to to any other datatype as well but I keep getting errors again:
img2 = sitk.Cast(img, sitk.sitkFloat32)
sitk::ERROR: Filter does not support casting from casting vector of 16-bit unsigned integer to 32-bit float
I tried a 2D variation as well of the above:
img_m = sitk.ConnectedThreshold(img2[:,:,7], [(257,419)])
but this time I got the error:
sitk::ERROR: Pixel type: vector of 64-bit float is not supported in 2D byclass itk::simple::ConnectedThresholdImageFilter
Any idea what may be causing this?
P.S. I have read the question: SimpleITK N4BiasFieldCorrection, not working with any data type and I believe this is not a duplicate as his problem is solved by casting whereas mine does not work even for casting.
Thanks