Log in

View Full Version here: : Using ImageJ to Align images


algwat
15-07-2015, 02:28 PM
Gidday All,

I thought to share this use of ImageJ to pre-process your images or align them and produce an set of centered images. The example I have will make an image set with a comet correctly centered in the the FOV.

You can change the output image size to make a crop from large mega pixel images.

You may find this useful to pre-process your planetary images to make the planet centered before you use your favorite commercial program to make a master image.

A PDF can be found on my Google drive here,
https://drive.google.com/file/d/0B8nmkBCv3glJUVRoQ09JN3Q2UDA/view?usp=sharing

Let me know if you like it, and have any questions about ImageJ setup issues.

kind regards, Alan Watson
http://cometal-comets.blogspot.com.au/

check out my Pluto images on the blog....

algwat
16-07-2015, 02:19 PM
Here is the text of the macro , in case you cannot cut it out of the PDF or don't want to type it in... a few minor tweaks, see the end of text.. 8)


//0000000000111111111122222222223
//0123456789012345678901234567890
//Registered 20150527-1:reference slice 3277.750 1526.250 134 1

// image size
imgsz = 1024;
//
if (nResults==0)
exit("Results table is empty ");
//
wdwnm = getResultLabel(1);
wdw = substring(wdwnm,0,21);
print (wdw);

for ( n=1 ; n<nResults-1;n++) {

posx = getResult("X", n);
posy = getResult("Y", n);


makeRectangle(posx-(imgsz/2), posy-(imgsz/2), imgsz, imgsz);
//
run("Duplicate...", " ");
//
selectWindow(wdw); // change too stack window name
//
run("Next Slice [>]");

}

run("Images to Stack", "name=Stack title=[] use");

//
selectWindow("Stack");
run("Z Project...", "projection=[Sum Slices]");
//
selectWindow("Stack");
run("Z Project...", "projection=Median");
//
selectWindow("Stack");
run("Z Project...", "projection=[Average Intensity]");
//
selectWindow("Stack");
run("Z Project...", "projection=[Max Intensity]");
//