Posted by
Joachim Wesner on
Feb 22, 2008; 3:13pm
URL: http://imagej.273.s1.nabble.com/Working-faster-with-imagej-tp3697106p3697109.html
Hi,
ImageJ Interest Group <
[hidden email]> schrieb am 22.02.2008 14:07:17:
> I have 20 pairs of pictures named 1t0, 1t1, 2t0, 2t1... 20t0, 20t1
>
> what i want is to do the calculations for each pair. As far as i know, i
> have to load each pair myself.
>
> The other calculations i do need me to choose the right windows in the
> program, or else it will not work... that is why i have divided the
actions.
> I couldnt find the right command.
>
> Is macro better than plugin?
>
A nacro is "easier" to program than a plugin.
I see, it would not be very difficult to automatically generate 20 file
names
in a macro of the above pattern.
for (i = 1; i <= 20; i++) {
nm0 = ""+i+"t0";
nm1 = ""+i+"t1";
}
open(nm0);
open(nm1);
and your processing......
You can select a certain window via it´s name and bring to the front for
further processing,
here some code I made some time ago for this, you would do eg;
id=findWind(nm1);
selectImage(id);
///////////////////////////////////////////////////////////////////////////////////////////////////
function findWin(prefix)
// Find the most recent (most negative ID) image window, whose title starts
with <prefix> and return its ID
{
// setBatchMode(true);
id = getImageID();
minid = 0;
for (i = 1; i <= nImages; i++) {
selectImage(i);
thisid = getImageID();
if (startsWith(getTitle(), prefix) && thisid < minid)
minid = thisid;
}
// setBatchMode(false);
selectImage(id);
return minid;
}
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________