# Convert 4 channel Blue, Green, Red, Yellow to RGB?

I have 4 color channels for Nikon microscope images (nd2 file format), where one of the color channels is (1, 1, 0) which corresponds to yellow. How do I handle the 4th channel? I'm assuming that I need to convert all the channel to RGB.

edit retag close merge delete

opencv does not have any means to read or decode this format. you'll probably need some 3rd party lib like nd2reader

( 2018-06-11 10:39:07 -0600 )edit
1

I actually use nd2reader to read the file formats, the question, is how to convert these 4 color channels into a visibie/usable image.

( 2018-06-11 10:41:02 -0600 )edit

i looked around a bit, but could not find any information about the format, or pixel structure, sorry, no idea.

and btw, opencv uses bgr, not rgb.

( 2018-06-11 10:50:19 -0600 )edit

The image is read as a normal numpy matrix of Y by X, so I can make (Y, X, channel) 3 color RGB images easily usable with opencv or any other packages. Problem is, I still haven't found anything on the yellow (1, 1, 0) channel.

( 2018-06-11 10:52:22 -0600 )edit

It seems you are dealing with a multispectral image (more than the 3 basic channels). It's probably because you can have some interesting data in the yellow wavelength.

In this case use the different channels to process the image. Take the image as a combination of 4 single band images and see what can you do with it.

To display, you can ignore the yellow channel, and use the RGB part (a subarray of the original image). If the size of the array is im[w,h,4], then (if I'm not mistaken):

im_rgb=im[:,:,:3]

( 2018-06-11 12:44:02 -0600 )edit

I would like to conver the RGBY to RGB, so instead of [Y,X,4] I'd have [Y,X,3]. The only thing I can think of is getting the intensity of the yellow channel, and replacing the red and green channels with an equal value so the resulting viewed image has yellow it.. however, then I lose any single channel red and green information.

( 2018-06-11 13:03:53 -0600 )edit
1

For processing, use the 4 channels. Use the Y channel to detect the position of those fluorescent DNA probes.

To display, use the first 3 channels. Do not replace the R and G channels with the Y value. Just forget the Y channel.

( 2018-06-12 03:18:46 -0600 )edit

Sort by ยป oldest newest most voted

Please mention that in which format are you in. Are you trying to say that you are in CMY domain and you want to convert it into RGB domain. For coversion from RGB to CMY you need to do 1 - RGB in matrix form.

more

( 2018-06-12 00:07:38 -0600 )edit

I am in the RGB domain, I have a normal [Y, X, 3] RGB image, so red, green, and blue channels.. but I also have an extra channel [Y,X, 1] which is color intensity of yellow which is identified by the nikon system as RGB channel (1, 1, 0) so it is comprised of both Red and Green. Ultimiately, this is not it's own color space, it is used for FISH (fluorescent in situ hybridization) Wikipedia

( 2018-06-12 00:24:53 -0600 )edit

Official site

GitHub

Wiki

Documentation