Re: Macro/plugin to align channels ?
Posted by Gabriel Landini on Mar 19, 2009; 10:49am
URL: http://imagej.273.s1.nabble.com/Macro-plugin-to-align-channels-tp3693202p3693207.html
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<-------------