setting active channel in a composite image

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

setting active channel in a composite image

kuba
Hi guys,

I have a composite image that consist of 3 channels. Channel1 - original image, Channel2 - binary mask of original image, Channel3 - another binary image of Channel1.
I want to apply some manual corrections to Channel2 (drawing some missing outlines that were not automatically detected) and then do some morphological operations, i.e dilate the binary image of Channel2.

I create a mini macro that set active channel to Channel2:

macro "Upper case w [W]" {
Stack.setActiveChannels("010");
run("BinaryDilateNoMerge4 ", "iterations=-1");

but I got an error saying that 8 bit binary image is required. So, I do not understand why it does not apply this morphological operation to channel2, which is binary and supposed to be active and instead wants to apply the operation to the entire composite image that is not binary because of Channel1.

I can not split channels because I have to use Channel1 to see which outline are ok, and which are missing. Any idea how to fix this problem.

Thanks in advance
kuba
Reply | Threaded
Open this post in threaded view
|

Re: setting active channel in a composite image

kuba
Hi again,

Using: Stack.setChannel(2); instead of setActiveChannel does not help either, in that case the morphological operation is applied to all channels, weird.

Any other ideas?

best regards
kuba
Reply | Threaded
Open this post in threaded view
|

Re: setting active channel in a composite image

Gabriel Landini
In reply to this post by kuba
On Wednesday 07 Mar 2012 20:09:48 kuba  wrote:
> run("BinaryDilateNoMerge4 ", "iterations=-1");
>
> but I got an error saying that 8 bit binary image is required.

Hi kuba,

Yes, because this is applied to binary images, or stacks of binary images, not
colour ones when one slice is binary and the others are not.

> So, I do not understand why it does not apply this morphological operation
> to channel2,

Because the plugin is meant to process a whole stack of binary images and your
composite is not so.

> I can not split channels because I have to use Channel1 to see which outline
> are ok, and which are missing. Any idea how to fix this problem.

You can split channels and merge them back after processing the channel you
want.
Or you can duplicate the channel to process, apply the plugin, and copy it
back into the composite image.

Cheers

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: setting active channel in a composite image

kuba
Hi Gabriel,
Yes, splitting or duplicating channels will work but is not optimal if one has to manually correct hundreds of frames. There has to be the way to set active channel in a composite image, and it is not setChannel().

Cheers
Kuba
Reply | Threaded
Open this post in threaded view
|

Re: setting active channel in a composite image

Gabriel Landini
In reply to this post by kuba
> Yes, splitting or duplicating channels will work but is not optimal if one
> has to manually correct hundreds of frames. There has to be the way to set
> active channel in a composite image, and it is not setChannel().

I am afraid that I can't see a way of doing this other than the two work-
arounds mentioned earlier because the plugin was not made to work the way you
are intending.

I am not inclined to modify it because what you report is not really a bug.
The plugin works only on binary images or binary stacks, not mixed stacks
(which is what one gets when using composite images).

Another alternative is that you modify the source to match the behaviour you
expect, that is the advantage of open source code.

Cheers

Gabriel