Re: was colour bug? - pixel data types

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/Re-was-colour-bug-pixel-data-types-tp3685234p3685236.html

Hi Mike,

Image type "RGB color" in ImageJ has 8 bits per color, so your type  
conversion in step 4 to RGB color changes it to 8 bits.
If you want to keep 16 bits/channel, you have to keep it as composite  
image.

Other programs won't correctly interpret composite images saved as  
TIFF unless they have only 3 colors, R, G, B.

To get it as 3*16 bits, you would have to do some arithmetics to  
calculate what the R, B, G values are (with 16-bit accuracy). For the  
Organs of Corti as displayed usually (R, G, B + gray), duplicate the  
4th channel (gray) and add it to the R, G, B channels. Then delete  
the gray channel.
If you want the 4th channel to appear as cyan, it should add to the R  
and B channels only.

Hope this helps,

Michael
________________________________________________________________

On 29 Mar 2011, at 10:47, Mike A wrote:

> Daniel, thanks very much for your reply.  Very informative. I tried  
> your method:
>
> "The imageJ way to do what you want is to get the single channel  
> image,
> use one of the display look up tables (the LUT button in the toolbar)
> to choose how you would like it to be shown in colour,
> then change the pixel type to RGB (or maybe 8 bit color)
> then save that as a tiff."
>
> However, when i do this it saves the tiff as an 8bit RGB and not a  
> 16bit RGB.  This happens on my stack, and also on sample stacks.  
> for example:
> 1. open organ of corti
> 2. image > color > split channels
> 3. change channel 4 to lets say magenta by clicking the "primary  
> colours" button on the "lookup tables" toolbar
> 4. change image > type from 16bit to RGB color
> 5. save as tiff
>
> The resulting tiff is an 8bit RGB image and not a 16bit RGB image.  
> Am i still missing something?
>
> Thanks for your help.
>
> Mike A
>
>
> -----Original Message----- From: Daniel James White
> Sent: Tuesday, March 29, 2011 9:04 AM
> To: ImageJ Interest Group ; [hidden email]
> Subject: Re: was colour bug? - pixel data types
>
> Hi Mike,
>
> On Mar 29, 2011, at 6:00 AM, IMAGEJ automatic digest system wrote:
>
>>
>> Date:    Mon, 28 Mar 2011 11:43:14 +0100
>> From:    Mike A <[hidden email]>
>> Subject: colour bug?
>>
>> Hi folks,
>>
>> I am using imageJ v1.45e11
>>
>> I am opening a two channel 2D stack (x,y) stack with LOCI  
>> bioformats and colour mode set to “composite”.  If I save this  
>> as .tif I get a 16bit RGB image.  great !
>
> Jolly good.
>
>>
>> However,  If i do image > colour > split channels, and save one of  
>> the channels as .tif, it comes out in greyscale in photoshop.
>
> That is what should happen. Its not as bug, its the expected  
> behaviour!
>
>>
>> Importantly, if I open my stack with LOCI with colour mode set to  
>> “default” and the split channels function checked my channels  
>> split and appear greyscale.  If i use image > colour > merge  
>> channels and select a single one of my split channels in red and  
>> “none” for the other channels with “create composite” checked  
>> nothing happens.  Basically it is not possible to save a single  
>> channel in my stack in 16bit colour.  Is this a bug?
>>
>> I presumed that I could use the merge channels option to place the  
>> channel that im interested in, in lets say, the red channel, and  
>> select none for blue/green/grey with create composite checked, to  
>> output a 16bit RGB colour file in which the channel im interested  
>> in appeared red, and blue/green were present in the 16bit rgb  
>> image but just contained zeros/no data, thus allowing me to save  
>> the channel im interested in in 16bit colour.
>
> Don't worry, you are just missing the basics of how different pixel  
> types work in imageJ and elsewhere.
>
> You can see the different pixel data types in menu command
> Image - Type
>
> The simples types are "greyscale" :
> 8 - bit, 16-bit and 32 bit.
> There is only once value per pixel.
> 8 bit holds INTEGER ONLY values in the range 0-255  (2 to the power  
> 8 different intensity levels"
> 16 bit holds INTEGER ONLY  values from 0 to ( (2 to the power 16)  
> -1 ) about 65000 and some.
> 32 bit is a floating point representation where you can have  
> numbers in a huge range with a decimal point somewhere in the number.
>
> If you have a multi channel image with n channels... there is  
> effectively n pixel values for each pixel.
> ImageJ composite image representation shows this as a channel  
> slider a the bottom of the window.
> A composite image can have channels with 8, 16 or 32 bit pixels.
>
> Another way to show a multi channel image is to use RGB pixel type,
> where there are exactly 3 values for each pixel, one for each red  
> green and blue "channels"
> BUT, RGB pixel type is 8 bit... so if you started with nice data  
> from a 12 bit or 16 bit camera,
> if you convert to RGB, then you will lose a great deal of intensity  
> resolution (which matters only for high signal:noise images)
>
> The imageJ way to do what you want is to get the single channel image,
> use one of the display look up tables (the LUT button in the toolbar)
> to choose how you would like it to be shown in colour,
> then change the pixel type to RGB (or maybe 8 bit color)
> then save that as a tiff.
>
> There is no need to use photoshop for annotation of the images, as  
> you can do all that in imageJ.
>
> For figure layout, photoshop is not well suited,
> and something like illustrator is better suited... or some other  
> open source document layout software.
>
> In fact I dont know why we have to do any layout, apart from a  
> schematic one of what goes where,
> since the publishers have to totally re do the layout for  
> publication anyway...
> reviewers need PDF, but the publishers should make that (or else  
> what are they actually for?)
>
> Actually the reviewers need the raw image data .... not some tiny  
> compressed and smashed image in an PDF.
> They must be able to get the raw image and repeat your analysis  
> from it.
>
> cheers
>
> Dan
>
>
>
>>
>> Cheers
>>
>> Mike
>
> Dr. Daniel James White BSc. (Hons.) PhD
> Senior Microscopist / Image Visualisation, Processing and Analysis
> Light Microscopy and Image Processing Facilities
> Max Planck Institute of Molecular Cell Biology and Genetics
> Pfotenhauerstrasse 108
> 01307 DRESDEN
> Germany
>
> +49 (0)15114966933 (German Mobile)
> +49 (0)351 210 2627 (Work phone at MPI-CBG)
> +49 (0)351 210 1078 (Fax MPI-CBG LMF)
>
> http://www.bioimagexd.net BioImageXD
> http://pacific.mpi-cbg.de Fiji -  is just ImageJ (Batteries Included)
> http://www.chalkie.org.uk Dan's Homepages
> https://ifn.mpi-cbg.de Dresden Imaging Facility Network
> dan (at) chalkie.org.uk
> ( white (at) mpi-cbg.de )