Help with Gizmo and Movie
hegedus
I am building a user based application so I need to make it quite simple. Easy enough for manager to use but not simple that a VP can use it.
Objective: I have a 3D wave with slices of data taken at various times and corresponding temperatures. All the tool control done in Igor and works fine.
The request is to create a movie of the data showing the time and temperature progression of the sample.
Show I start off with Gizmo and a surface plot so far so good.
I would like to create a control bar with a slider so the user can scroll through the time slices. Is there a way to add a control bar or some other panel attached to the Gizmo window. It appears that the 2D graph control are not available for a gizmo window.
It appears I need to call a special function (appendFrameButtonProc("")) to add a frame for a gizmo movie and I can deal with that. what I would like to have in the movie is a display of the temperature at each frame of the movie as it progresses through the data. It appears if I add annotation it is appended as static text. What is the best way to make it dynamic so I can update with the appropriate data.
This is all very simple in 2D, but I am stumbling a bit with Gizmo.
Thanks in advance.
Andy
The Image Processing package includes the file Image Slider.ipf that contains example code for handling a stack of images. You can find it in WaveMetrics Procedures:Image Processing.
If you are going to display a surface plot in Gizmo you need a 2D matrix so create one and display it in Gizmo as desired. Next, hook up a slider function that extracts a layer from the 3D wave and overwrites the 2D wave displayed in Gizmo. This will cause the Gizmo plot to update as necessary. The last remaining component is the movie. Here the recipe is simple:
1. Create a new movie file on disk using NewMovie.
2. Add frames as necessary (maybe one per layer).
3. Close the movie file so it is actually saved to disk.
Gizmo Procedures have a full working example which you evidently found. Adding a frame is a bit more complicated in IP6 because there is no direct way to pass the image in Gizmo into the movie window. This is done in two steps (via the picture gallery).
A.G.
WaveMetrics, Inc.
January 11, 2015 at 11:22 am - Permalink
Here is what I scripted up. I have a Gizmo window created with the surface plot in the orientation I want. I can confirm that my function set3D(index) does work and changes the surface plot in the gizmo as expected. Now I want to run it in time as I step through the layers (time). This does not work - it doesn't even compile; this is not recognized - appendFrameButtonProc("").
Perhaps on a related note: if I comment out the movie functions, newmovie, appendFrameButtonProc, and closemovie. and just run the function I do not see the gizmo window change. It just jumps to the last slice. What do I need to put into the for loop to update the gizmo window and capture a frame?
Wave Datacube = root:datacube //3D array with data for each surface plot in layers
execute "ModifyGizmo setOuterBox={0,35,0,35,wavemin(root:datacube),wavemax(root:datacube)} "// this set the Z axis to full scale
variable index,maxindex
maxindex = DimSize(datacube, 2 )
NewMovie/I /L
for(index=0;index<maxindex;index+=1)
set3D(index) // this increments the data in matrix used for the surface plot
appendFrameButtonProc("")// this does work - what should it be
endfor
closemovie
End
<\igor>
Andy
January 11, 2015 at 02:28 pm - Permalink
That's because unfortunately appendFrameButtonProc() is part of an independent module. I steer clear of independent modules so my advice is to copy the code that you need in the relevant example and make it part of your own procedure. I also recommend that you refrain from referencing Gizmo Procedures in your own code not only because of the complexity of the independent module but also because these procedures are going to be deprecated in IP7 as they are replaced by built-in dialogs and panels.
AG
January 11, 2015 at 04:41 pm - Permalink