48-bit color TIFF sequence -> 16-bit gray sequence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

48-bit color TIFF sequence -> 16-bit gray sequence

Matt Holmes
This should be easy; I'm assuming that I'm missing something simple.  Especially since I'm new to imagej.

I have a folder with 100 color TIFFS, each of which is a frame from a high-speed video camera.  Each individual tiff contains 3 16-bit channels (RG&B).

When I "import > image sequence . . ."  imagej opens me a stack of 300 frames; I get the red green and blue from image 1, then the red green blue from image 2, etc.

I want to convert this to a 16-bit grayscale stack of 100 frames.  It could be a simple averaging of the three color channels, or else provide for greater control over the math by which they are combined.  

Regardless, I can find no simple way to do this.  Am I importing the sequence incorrectly?

However I do it, I don't want an intermediate step that discards more bit depth than necessary, i.e. I don't want to convert from 48-bit color to 8-bit grayscale then to 16-bit grayscale.

There was another thread that discussed this somewhat ("24 bit RGB to 16 bit gray conversion? ") but it was left unanswered in the end.

Any suggestions?  Much thanks . . .

Matt
Reply | Threaded
Open this post in threaded view
|

Re: 48-bit color TIFF sequence -> 16-bit gray sequence

Rasband, Wayne (NIH/NIMH) [E]
On Jun 7, 2012, at 12:01 PM, Matt Holmes wrote:

> This should be easy; I'm assuming that I'm missing something simple.
> Especially since I'm new to imagej.
>
> I have a folder with 100 color TIFFS, each of which is a frame from a
> high-speed video camera.  Each individual tiff contains 3 16-bit channels
> (RG&B).
>
> When I "import > image sequence . . ."  imagej opens me a stack of 300
> frames; I get the red green and blue from image 1, then the red green blue
> from image 2, etc.
>
> I want to convert this to a 16-bit grayscale stack of 100 frames.  It could
> be a simple averaging of the three color channels, or else provide for
> greater control over the math by which they are combined.

After importing the files, use the Image>Hyperstacks>Stack to Hyperstack command with the these settings:

   Order: xyczt(default)
   Channels (c): 1
   Slices (z): 3
   Frames (t): 100
   Display Mode: Grayscale

Then use the Image>Stacks>Z Project command with these settings:

   Start slice:1
   End slice 3
   Projection type: Average
   All time frames: enabled

-wayne

>  Regardless, I can find no simple way to do this.  Am I importing the
> sequence incorrectly?
>
> However I do it, I don't want an intermediate step that discards more bit
> depth than necessary, i.e. I don't want to convert from 48-bit color to
> 8-bit grayscale then to 16-bit grayscale.
>
> There was another thread that discussed this somewhat ("24 bit RGB to 16 bit
> gray conversion? ") but it was left unanswered in the end.
>
> Any suggestions?  Much thanks . . .
>
> Matt
>
> --
> View this message in context: http://imagej.1557.n6.nabble.com/48-bit-color-TIFF-sequence-16-bit-gray-sequence-tp4998937.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: 48-bit color TIFF sequence -> 16-bit gray sequence

Matt Holmes
Fantastic, that works great.  Much thanks for the help.  

For top props, can you recommend a method for doing the zproject that lets me weight the channels differently, i.e. a custom zproject with my own math on the three slices, instead of just a straight average?