Macro/plugin to align channels ?

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

Macro/plugin to align channels ?

lechristophe
Dear all,

On our confocal, we have objectives that are not well corrected for lateral
chromatic aberrations (see here :
http://micro.magnet.fsu.edu/primer/anatomy/aberrations.html). That means
that an image taken in three channels (with green, red and far-red emission
wavelength) will have a mismatch that has a radial variation (the green
image apperas "more zoomed" than the red which is "more zoomed" than the
far-red).
An image of three-color beads is worth a thousand words :
http://ftp.espci.fr/incoming/christo/Aberration.png

So I need to correct by changing each channel's image size (dilating far-red
and red images to make them fit with the green channel, which is the most
used channel and the reference). I don't need to have an automatic
registration, as the channels can have very different images (if not used to
image dumb beads), and the shift is constant for an objective (I set the
correction once for all images made with this objective).

So the question is : is there a macro/plugin that does that (correcting
radial shifts by changing R,G,B channels size by a fied amount) or do I have
to do it by myself ?

Thanks for your informations !

--
Christophe Leterrier
Postdoc
INSERM UMR641 // Ionic channels Lab
IFR Jean Roche, Mediterranée University
Marseille, France
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Macro/plugin to align channels ?

lechristophe
I forgot to specify that the linked image is a cropped, resized verion of
the original image (approximatively the upper left quarter of it). In the
full original image, the shift is realy radial with zero-shift at the center
and more shift as you get further from the center of the image.

On Thu, Mar 19, 2009 at 11:05, Christophe Leterrier <
[hidden email]> wrote:

> Dear all,
>
> On our confocal, we have objectives that are not well corrected for lateral
> chromatic aberrations (see here :
> http://micro.magnet.fsu.edu/primer/anatomy/aberrations.html). That means
> that an image taken in three channels (with green, red and far-red emission
> wavelength) will have a mismatch that has a radial variation (the green
> image apperas "more zoomed" than the red which is "more zoomed" than the
> far-red).
> An image of three-color beads is worth a thousand words :
> http://ftp.espci.fr/incoming/christo/Aberration.png
>
> So I need to correct by changing each channel's image size (dilating
> far-red and red images to make them fit with the green channel, which is the
> most used channel and the reference). I don't need to have an automatic
> registration, as the channels can have very different images (if not used to
> image dumb beads), and the shift is constant for an objective (I set the
> correction once for all images made with this objective).
>
> So the question is : is there a macro/plugin that does that (correcting
> radial shifts by changing R,G,B channels size by a fied amount) or do I have
> to do it by myself ?
>
> Thanks for your informations !
>
> --
> Christophe Leterrier
> Postdoc
> INSERM UMR641 // Ionic channels Lab
> IFR Jean Roche, Mediterranée University
> Marseille, France
> [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro/plugin to align channels ?

Gabriel Landini
On Thursday 19 March 2009 10:08:30 Christophe Leterrier wrote:
> I forgot to specify that the linked image is a cropped, resized verion of
> the original image (approximatively the upper left quarter of it). In the
> full original image, the shift is realy radial with zero-shift at the
> center and more shift as you get further from the center of the image.

Below is something that I have used for compensating colour aberration in my
optical micrsocope.
It expands by 2 pixels the grey channel and by 4 pixels the red channel.
However in your image, there is more aberration in the green channel.
Perhaps you mounted the composite wrong?

BTW, I just noted that the scale command has new "interpolation" methods, so
the code might benefit by using the bicubic one.
If you do not understand how to change the values in the macro, send me the
whole image privately and I will take a look.

Cheers

Gabriel



//---------------8<-------------
// RatioColourAberration.txt
// G.Landini  -- generated by RatioSettings
setBatchMode(true);
a=getTitle();
w=getWidth();
h=getHeight();
run("RGB Stack");
setSlice(2);
run("Select All");
run("Copy");
run("Internal Clipboard");
run("Scale...", "x=- y=- width="+(w+2)+" height="+(h+2)+" interpolate");
run("Copy");
close();
selectWindow(a);
run("Paste");
setSlice(1);
run("Select All");
run("Copy");
run("Internal Clipboard");
run("Scale...", "x=- y=- width="+(w+4)+" height="+(h+4)+" interpolate");
run("Copy");
close();
selectWindow(a);
run("Paste");
run("RGB Color");
run("Select None");
setBatchMode(false);
//---------------8<-------------
Reply | Threaded
Open this post in threaded view
|

Re: Macro/plugin to align channels ?

vbindokas
In reply to this post by lechristophe
As your abberation shifts are not constant over the image you need a map
of the distortion. If you can locate a version of UnwarpJ called
StackUnwarpJ,  you can use one channel as the reference (via copy) and
align the RGB stack slices to perfection. Using the option to save the
templates, you should be able to apply the same bead-defined corrections
to other images. I no longer recall where I found the stack version, but
it was likely via request from Carlos Sorzano.
    bUnwarpJ in 'mono' mode might do this the hard way (one channel at a
time).
cheers,


Christophe Leterrier wrote:

> I forgot to specify that the linked image is a cropped, resized verion of
> the original image (approximatively the upper left quarter of it). In the
> full original image, the shift is realy radial with zero-shift at the center
> and more shift as you get further from the center of the image.
>
> On Thu, Mar 19, 2009 at 11:05, Christophe Leterrier <
> [hidden email]> wrote:
>
>  
>> Dear all,
>>
>> On our confocal, we have objectives that are not well corrected for lateral
>> chromatic aberrations (see here :
>> http://micro.magnet.fsu.edu/primer/anatomy/aberrations.html). That means
>> that an image taken in three channels (with green, red and far-red emission
>> wavelength) will have a mismatch that has a radial variation (the green
>> image apperas "more zoomed" than the red which is "more zoomed" than the
>> far-red).
>> An image of three-color beads is worth a thousand words :
>> http://ftp.espci.fr/incoming/christo/Aberration.png
>>
>> So I need to correct by changing each channel's image size (dilating
>> far-red and red images to make them fit with the green channel, which is the
>> most used channel and the reference). I don't need to have an automatic
>> registration, as the channels can have very different images (if not used to
>> image dumb beads), and the shift is constant for an objective (I set the
>> correction once for all images made with this objective).
>>
>> So the question is : is there a macro/plugin that does that (correcting
>> radial shifts by changing R,G,B channels size by a fied amount) or do I have
>> to do it by myself ?
>>
>> Thanks for your informations !
>>
>> --
>> Christophe Leterrier
>> Postdoc
>> INSERM UMR641 // Ionic channels Lab
>> IFR Jean Roche, Mediterranée University
>> Marseille, France
>> [hidden email]
>>
>>
>>    

--
__

Vytas Bindokas, Ph.D.
Research Assoc. / Assoc. Prof.,
Director, BSD Light Microscopy Core Facility
Dept Neurobiol Pharmacol Physiol MC0926
947 E 58th Street
The University of Chicago
Chicago IL 60637
Room Abbott 120
773-702-4875

email [hidden email]
web site for LMCF:
http://digital.bsd.uchicago.edu/index.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro/plugin to align channels ?

Ignacio Arganda Carreras
You may want to give a try to this script:

http://biocomp.cnb.csic.es/~iarganda/bUnwarpJ/downloads/bunwarpj_stacks.js

It registers with bUnwarpJ all images in a stack to the first one. If
you convert your RGB image into a stack and call the script, it should
work. Just take into account the bUnwarpJ parameters and the fact that
it is a beta version :P

cheers!

ignacio



vbindoka wrote:

> As your abberation shifts are not constant over the image you need a
> map of the distortion. If you can locate a version of UnwarpJ called
> StackUnwarpJ,  you can use one channel as the reference (via copy) and
> align the RGB stack slices to perfection. Using the option to save the
> templates, you should be able to apply the same bead-defined
> corrections to other images. I no longer recall where I found the
> stack version, but it was likely via request from Carlos Sorzano.
>    bUnwarpJ in 'mono' mode might do this the hard way (one channel at
> a time).
> cheers,
>
>
> Christophe Leterrier wrote:
>> I forgot to specify that the linked image is a cropped, resized
>> verion of
>> the original image (approximatively the upper left quarter of it). In
>> the
>> full original image, the shift is realy radial with zero-shift at the
>> center
>> and more shift as you get further from the center of the image.
>>
>> On Thu, Mar 19, 2009 at 11:05, Christophe Leterrier <
>> [hidden email]> wrote:
>>
>>  
>>> Dear all,
>>>
>>> On our confocal, we have objectives that are not well corrected for
>>> lateral
>>> chromatic aberrations (see here :
>>> http://micro.magnet.fsu.edu/primer/anatomy/aberrations.html). That
>>> means
>>> that an image taken in three channels (with green, red and far-red
>>> emission
>>> wavelength) will have a mismatch that has a radial variation (the green
>>> image apperas "more zoomed" than the red which is "more zoomed" than
>>> the
>>> far-red).
>>> An image of three-color beads is worth a thousand words :
>>> http://ftp.espci.fr/incoming/christo/Aberration.png
>>>
>>> So I need to correct by changing each channel's image size (dilating
>>> far-red and red images to make them fit with the green channel,
>>> which is the
>>> most used channel and the reference). I don't need to have an automatic
>>> registration, as the channels can have very different images (if not
>>> used to
>>> image dumb beads), and the shift is constant for an objective (I set
>>> the
>>> correction once for all images made with this objective).
>>>
>>> So the question is : is there a macro/plugin that does that (correcting
>>> radial shifts by changing R,G,B channels size by a fied amount) or
>>> do I have
>>> to do it by myself ?
>>>
>>> Thanks for your informations !
>>>
>>> --
>>> Christophe Leterrier
>>> Postdoc
>>> INSERM UMR641 // Ionic channels Lab
>>> IFR Jean Roche, Mediterranée University
>>> Marseille, France
>>> [hidden email]
>>>
>>>
>>>    
>


--
Ignacio Arganda-Carreras
Escuela Politecnica Superior
Lab B-408     Phone: (+34) 91 497 2260
Universidad Autonoma de Madrid
Ctra. de Colmenar Viejo, Km. 15
Madrid 28049,  Spain

E-mail: [hidden email]
Website: http://arantxa.ii.uam.es/~iarganda/index_EN.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro/plugin to align channels ?

Gabriel Landini
On Monday 23 March 2009 16:39:40 Ignacio Arganda Carreras wrote:
> You may want to give a try to this script:
> http://biocomp.cnb.csic.es/~iarganda/bUnwarpJ/downloads/bunwarpj_stacks.js
> It registers with bUnwarpJ all images in a stack to the first one. If
> you convert your RGB image into a stack and call the script, it should
> work. Just take into account the bUnwarpJ parameters and the fact that
> it is a beta version :P

I see a problem with the suggestion above. Colour aberration is relatively
simple to characterise because it can be measured beforehand.
bUnwarpJ is a very impressive plugin, however, while trying to match the
images it will be unable to tell whether the differences seen between channels
(slices) are due to the aberration or to differences in colour contents across
the channels (unless the object was grey tones).

My suggestion is still to quantify how much the channels diverge with the
beads and then try to compensate this with resizing and translation (if
needed, for example when the field of view is not centred on the optical axis
of the microscope).

Cheers,

Gabriel