Hi Oli,
ImageJ is multithreaded, i.e. many things can run at the same time. So you can use a simple macro for this:
print(getTitle());
id=getImageID();
lastSlice=-1;
while(true) {
slice = getSliceNumber();
if(isKeyDown("space") && slice!=lastSlice) {
if(getImageID()!=id) exit("different image, recording of frames stopped");
print(slice);
lastSlice=slice;
}
wait(100);
}
It works while a stack is playing, but also when stepping though the frames manually. Like any macro, press ESC to stop it.
It stops with an error message if a different image comes to the foreground and space is pressed.
If you like, you can put it as an Action Tool into the StartupMacros.
Michael
________________________________________________________________
On Oct 15, 2013, at 18:55, oli tills wrote:
> Hi, I am wanting to manually record instances of an event occurring within an image stack as it is played, but haven't been able to find anything so far that enables me to do this. Specifically I am wanting to record the frame number of the current frame, as the stack is playing, at which the user presses the space bar. This needs to be repeatable for as often as the event occurs within an image sequence i.e. the number of frames recorded can be any length. Is there anything out there that does anything like this or if not can anyone provide some advice on the best way to construct a plugin to allow this functionality?Many thanks,Oli
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html