I was wondering what channel storage order SimpleITK uses. Is it interleaved (i.e. rgbrgbrgb...) or not (rrr...ggg...bbb...), and is it configurable? This is relevant when using an existing image buffer to interface with another system.
I did do an experiment and it looks like SimpleITK interleaves channels by default. So the remaining question: is this configurable? The system I am interfacing with supports both orders and I cannot predict what kind of data I will receive. It would be easiest to tell ITK what I have. Does ITK support both orders? If not, can ImportImageFilter (or something similar) do the conversion for me or do I have to do it myself?
You are correct that SimpleITK stores RGB or vector images with the channels interleaved. If you have an image of [x,y,z,c], where the last channel is the color, this would be considered a 4D Image in SimpleITK. We have limited support for 4D Images, which includes reading, writing, and using the ExtractImageFilter( 4D->3D), and JoinSeries (3D->4D). If you find something missing to convert 4D images please let us know.
I recently had to convert a 4D image into a 3D vector image: