Posted by
Michael Schmid on
URL: http://imagej.273.s1.nabble.com/Cyclic-translation-transform-tp5013479p5013480.html
Hi Jerry,
for translation with periodic boundary conditions, I am not aware of any ImageJ built-in function or external plugin (it would be easy to write one).
What you could do is replicating the image, and then crop it at the desired position. I have a macro that replicates a single image (not a stack) by creating a stack of identical slices, then making a montage of the slices. I'll paste the code at the very bottom.
Mind possible line breaks introduced by the mailer; the line starting with
run("Make Montage...
should end with
font=12");
Michael
________________________________________________________________
On Jul 9, 2015, at 13:50, jerry novakk wrote:
> Hi!
>
> I am using transform function in imageJ 1.43U. As it turns out the
> translation in a chosen direction
> cuts out that part of the image which leaves the view window and fills the
> other side with white.
> This means that I lose information that i still need.
> I am trying to work out how to keep the sample symmetry like on the picture
> below:
>
> Jerry <
http://imagej.1557.x6.nabble.com/file/n5013479/TRANS.png>
>
> Does anyone know if this can be fixed or if any adequate plugin exists?
>
> Thank you,
> Jerry
________________________________________________________________
macro 'Replicate 3x3 [F2]' {
// Replicate an image periodically in x and y
// Michael Schmid, Version May 2015
xRepetitions=3;
yRepetitions=3;
nTotal = xRepetitions*yRepetitions;
title = getTitle();
run("Duplicate...", "title=tmp");
dupID = getImageID();
run("Select All");
run("Copy");
for (i=0; i<nTotal; i++) {
run("Add Slice");
run("Paste");
}
run("Make Montage...", "columns=&xRepetitions rows=&yRepetitions scale=1 first=1 last=&nTotal increment=1 border=0 font=12");
rename(title+"_"+ xRepetitions+"x"+ yRepetitions);
selectImage(dupID);
close();
}
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html