Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to show some eye-movements data as animation on an iPad, in order to see the "gazes" as they occurred as a function of time.

Ideally, I would like to use and see Graphics objects only, not the dynamic controls.

I have about 50 trials with each 3000 gazes I would like to show. Preferably, all in one video with each trial looping 3 times.

Now, I have encountered many problems. To illustrate, this is equivalent to my situation except I`ll have about 50 different animations instead of 2.

pts = RandomReal[{-#, #}, {100, 2}] & /@ Range[2];
graphObj = {{Blue, Rectangle[{-1, -1}, {1, 1}]}, 
            {Red,Rectangle[{-.5, -.5}, {.5, .5}]}}

Manipulate[
 Animate[
  Graphics[{
   graphObj[[stimNo]],
   White, Line@pts[[stimNo]][[;; gazeNo]]},
   Background -> Black, 
   PlotRange -> {{-3, 3}, {-3, 3}}],
 {gazeNo, Range[2, 100, 1]},
  DefaultDuration -> 3,
  AnimationRepetitions -> 1,
  AnimationRunning -> False,
  Paneled -> False],
 {stimNo, Range[2]},
 ControlType -> Setter,
 Paneled -> False]

enter image description here

QUESTIONS / PROBLEMS :

  • I am not sure of the best format for the iPad and how I could play those animations.

  • I have not been able to export the correct duration (3 seconds to see my 3000 gazes}.

  • I could only achieve the above by exporting the Animate object itself, leaving me with the controls on the .mov.

My attempts to use ListManipulate have all failed so far.

I must say I have looked at all parts of the help menu related to exporting animations, but without success.

share|improve this question
    
@R.M. "Exporting for the last 25 min... And I have no clue what is the time minute from info in your question, bu this is not gonna work if it is that slow. – 500 May 11 '12 at 21:05
    
@500 you might want to cut back on the number of frames you're exporting. 3000 frames in 3 seconds equals 1000 frames per seconds. A standard movie typically has around 25 frames per second. – Heike May 11 '12 at 21:21
    
@Heike, Thank You, I am confused as what I want is just what I see when using Animate[]. So you know how it reduce the sampling when constraining to 3 seconds with 3000 steps ? – 500 May 11 '12 at 22:17
    
For 3 seconds you want something like 75 frames, so you could generate a list of 75 images by doing something like plots = Table[Graphics[ ...], {gazeNo, Floor[Range[75] Length[pts[[stimNo]]]/75]}] for each of your trials and use that to export to for example a .mov file using "FrameRate" -> 25. – Heike May 11 '12 at 22:43
    
@Heike, Thank You very much, once again ! – 500 May 12 '12 at 0:50
up vote 5 down vote accepted

There exists no movie format on the iPad that can do a frame duration of .001 seconds. 30 frames per second (as for NTSC video) is the fastest you'll be able to do, corresponding to roughly .03 seconds per frame. This means your movies will be 100 seconds long if it has 3000 frames.

It is easy to export a list of frames to Quicktime (Apple's own format) if you run Mathematica on the Mac:

Export["movie.mov", frameList]

should do it.

For more control, you would follow these instructions:

After making the list of frames by creating a Table of Graphics and calling the output list frameList, execute the following line:

Map[Print, frameList]

This will create all the plots conveniently bracketed in a CellGroup which you can select with a single click. With this, QuickTime export can proceed by selecting in the Frontend menu the item Edit → Save Selection As.... Quicktime.

If you want even more control, e.g., to select a different display duration for each frame, just use (assuming you're on a Mac) the export function defined in the linked answer. To get a single constant frame duration d (in seconds), you'd invoke it as exportMov["movie.mov", frameList, {d}].

If this still doesn't satisfy you, it's always possible to export the individual movie frames and use an external program to make the final movie, as described in this answer.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.