Playing image stack as a movie?

I have an image stack of a microscopic time-lapse. To help determine regions showing intensity changes over time I would like to run through this stack. I have already created a means of clicking myself through plane-by-plane as well as a slider that allows me to scroll through the whole stack. What I really want is to be able to control the playback as if it was a movie without actually converting the stack to a QuickTime movie. And that is where I am hitting a wall.

At the moment I have a "Play" button, that simply starts a for-endfor loop advancing one frame at a time using:

ModifyImage/W=DataViewer tStack, plane=(vCurrentFrame)

If I want to "stop" the playback, I need to interrupt using 'Cmd-.'

The only alternative I can think of is to have "play" start a background task that is called every few ticks (depending on the intended frame rate) and have "stop" stop that task.

Am I missing a more obvious means of achieving this? The forum and mailing list archives don't seem to hold the answer.

Many thanks, Chris
I think I handled this in the Scroll Traces package through some tricks with hook functions to capture mouse events. I believe it only handles traces not existing movie stacks. Perhaps it may have something to help you determine how to do what you want.

http://www.igorexchange.com/project/ScrollTracesPanel

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Quote:

If I want to "stop" the playback, I need to interrupt using 'Cmd-.'

Check the Igor User Manual, Chapter IV-6 "Interacting with the User" on p. IV-140. There is example code for a function PressEscapeToAbort( ) that monitors the keyboard for the Esc key, and takes whatever action you program, particularly stopping your function in a more controlled manner than the usual Abort button.

chris wrote:
If I want to "stop" the playback, I need to interrupt using 'Cmd-.'

The only alternative I can think of is to have "play" start a background task that is called every few ticks (depending on the intended frame rate) and have "stop" stop that task

Yes, if you want a control panel with a Stop button to be active during playback, that would be a way to do it.
You might also consider a Progress Panel:

DisplayHelpTopic "Progress Windows"

That is an advanced technique and relatively new to Igor that requires some tricky code inside Igor...

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks for all the helpful replies. I will give hook functions another look and see how this is solved in ScrollTraces. I am currently already using a hook function to scroll through the stacks using the arrow keys. Almost what I want, but not quite.

johnweeks wrote:

Yes, if you want a control panel with a Stop button to be active during playback, that would be a way to do it.
You might also consider a Progress Panel:


I have a control panel containing the slider and buttons for stepping through the stack plane by plane so I will just be adding the buttons there.

It appears that I will finally get to use background tasks in Igor :)