Closed J-Yash closed 4 years ago
I stumbled across this the other day and had to use imageio
as a workaround. Note that if you save starry_night_ants
as a nii.gz
file, you can then read it back in using ants.image_read
. I have this on my list of things to fix but just haven't gotten to it yet.
So I tried using your suggested method to get the ANTs image but plotting that using ants.plot() still plots noise. Is there another way I could plot this ANTs image?
Even though the plotting is buggy, does the ants.registration() method work fine on such RGB images?
It works for me.
>>> starry_night = ants.image_read("starry_night.nii.gz")
>>> ants.plot(starry_night.vector_to_rgb())
Even though the plotting is buggy, does the ants.registration() method work fine on such RGB images?
Multi-component images, including RGB, have to be split up and any components beyond the first would need to be plugged into the multivariate_extras
argument of ants.registration
.
That solves my issue. Thank you. Although I was curious: Does using an RGB image lead to better registration? Or simply converting my image to grayscale(Or simply using one channel) and then doing the registration would give similar results?
Medical imaging doesn't typically utilize RGB images so we don't have direct experience. However, since the RGB channels are highly correlated and since our go to metric is cross- correlation, you probably won't gain much using all three channels separately.
That's very helpful. Thank you.
I am trying to read an rgb image(.jpg) and plot it using ants.plot() but it does not plot the image properly and instead plots noise. Here is my image : (This is just a sample image I am using to test plotting of rgb images)
Code to read/plot image :
im = ants.image_read(PATH_TO_IMAGE)
im.plot()
The image that is being plotted looks like this:
The ANTsImage object header using
print(im)
gives:Is there a specific way to use rgb images in ANTs? Please advise.
Thank you.