Hey guys recurrently I get into this situation. I have a gray scale medical image, but when I load the image inside 3D slicer… the image appears BLUE!
Take a look. It is like this:
I guess it is a secondary capture, stored as a color image. Older ITK versions did not always read color channels correctly, but current version should work well. Does the image appear correctly if you use the latest Slicer Preview Release?
It seems that ITK’s BMP reader still mixes up the channels if you use transparency. You can fix the order using this code snippet:
volumeNode=slicer.util.loadVolume(r'c:\Users\andra\OneDrive\15-14-49.bmp')
a=slicer.util.arrayFromVolume(volumeNode)
a[:]=a[:,:,:,[1,2,3,0]] # reorder color channels
slicer.util.arrayFromVolumeModified(volumeNode)
BMP is a very old file format that and transparency was never widely used or supported by applications. I would recommend to switch to the much more widely used png file format. I’ve submitted a bug report to ITK, but I will not be surprised if they don’t fix a very rarely used feature of an ancient file format.