Posted by
David Strachan on
May 11, 2011; 1:24pm
URL: http://imagej.273.s1.nabble.com/Measuring-of-sponge-spicule-microscopy-images-tp3684624p3684631.html
Hi Ayse,
If I understand you correctly you can start with your binary image(8-bit
type), make a new image the same size as this with all pixels set to
white(8-bit type), then use Image - Colour - Merge Channels function.
For the red channel select the all white image, for the green channel
select your original binary image, for the blue channel again select
your original binary image, grey channel select none.
And that should result in an RGB image that has white where there was
white and Red where there was black in your original binary image.
If you do not get this, check in case that the original binary image you
have is displayed with an inverted L.U.T.
Here is a small macro below to perform the task you want.
// Questions to D.Strachan(at)Beatson.gla.ac.uk
// Start with your binary image open
if (nImages!=1){
exit("You should have only your binary image open to start
with");
}
run("8-bit");// make sure that the binary image is an 8-bit type
imageName = getTitle();
print (imageName);
// Get the dimentions of this binary image
height = getHeight();
width = getWidth();
// Create a new image of the same size and bit depth
// with all pixels set to white
newImage("white", "8-bit White", width, height, 1);
//Create a new RGB image using the All White as Red channel and your
original image as the Green and Blue
//This means that what was white, stays white, and what was black goes
red.
run("Merge Channels...", "red=white green="+imageName+"
blue="+imageName+" gray=*None*");
regards
David Strachan
The Beatson Institute for Cancer Research
Glasgow G61 1BD
* E-mail
[hidden email]
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
Lim Soon Yew
Sent: 11 May 2011 11:11
To:
[hidden email]
Subject: Re: Colorizing of binary images
Hi Ayse,
You can use "Image>Color>Edit LUT" to create your own custom lookup
table.
Best Regards,
John
________________________________________
From: ImageJ Interest Group [
[hidden email]] On Behalf Of Ayse
Turak [
[hidden email]]
Sent: Wednesday, May 11, 2011 5:52 PM
To:
[hidden email]
Subject: Re: Colorizing of binary images
Dear Arne,
thanks for that -- my one problem is that no matter what I choose, black
areas become coloured, but the areas that were once white now turn black
(or coloured if I invert the image). Is there a way to have all the
black pixels red for example, but keep the white pixels white?
sorry if this seems basic, I tried every variation of the LUT but none
of them seem to work for me
regards
Ayse
On May 4, 2011, at 19:45 , Seitz Arne wrote:
> Hi Ayse,
>
> the easiest way to change the appearance of your (binary) image is to
use Lookup tables (LUT).
> You can find them under: Image->Lookup Tables.
>
> Best regards
> Arne
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
> Ayse Turak
> Sent: mardi 3 mai 2011 16:18
> To:
[hidden email]
> Subject: Colorizing of binary images
>
> Dear Members,
>
> I am new to imagej and I was wondering if there was a way to colorize
> binary images -- either converting back into a psuedo-RGB image or to
> assign a different color value to the black portions, i.e. making all
> red
>
> any advice would be great
>
> Ayse
>
Dr. Ayse Turak <
[hidden email]>
Visiting Assistant Professor
Faculty of Engineering and Natural Sciences Sabanci University Orhanli,
Tuzla
34956 Istanbul, TURKEY
+90 216 483 9000 2126