-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleITK not working with any data type, be it 3D or 2D #592
Comments
Your image is a multi-component vector image, it's pixel type is "vector of 16-bit unsigned integer". Perhaps the image is an RGB image? You can get the number of components with img.GetNumberOfComponentsPerPixel() or looking at the image's meta-data via "print(img)". The first filters only support scalar images, and not vector images. You could select the first components with
You can not cast a vector image to s scalar, try casting to |
Thank you for responding. Yes the image is a grayscale TIFF image. My original image is a "Leica Image Format, .lif" file. SimpleITK does not support that I believe so I used bio-formats in ImageJ to export it to a multi-layered TIFF file, and that is what I am using as input here. Is there a better way to handle this? Below is the output of
Thanks |
Yes, reading microscopy image formats can be tricky. We are actively working on getting SCIFIO (bio-formats) to work better with SimpleITK, and improve the ability to read microscopy file formats. Using SCIFIO, right now requires compelling SimpleITK's master branch with some custom configuration flags. Here is a recent discussion: https://discourse.itk.org/t/reading-images-via-scifio-handle-5-d-images/918/3 I am not sure you need to convert the file with ImageJ/FIJI. You image is still a multi-component image, which is the original source of the error message. It appears the you expect the image to just be grayscale but it's actually a multi-component image. I'd recommend loading the original image, and running the I suspect that there was a conversion problem going form a 16-bit to 8-bit data. We need to know the range of values of the original input image. |
Thanks for the reply @blowekamp
By original file, do you mean the original .lif file? I tried that and followed your method that you gave in your link above but got the following:
Im happy to provide this, can you please let me know what you mean or how I can determine the range of values? Thanks for your help |
Thank you for your questions. If your problem is not resolved you are welcome to reopen the issue. |
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
andimageio
Ive found out thatSimpleITK
is the best way to handle volumetric images but the problem is that none of the functions seem to work for my image.After reading the image in, I can easily convert it to
numpy
and even display it usingsitk.Show()
so its loading up properly. but any function I use on it such as:gives the warning:
I tried casting to to any other datatype as well but I keep getting errors again:
I tried a 2D variation as well of the above:
but this time I got the error:
Any idea what may be causing this?
Thanks
The text was updated successfully, but these errors were encountered: