Welcome, Guest. Please Login.
OpenDX User Forum
06/19/13 at 14:11:54
News: OpenDX 4.4.4 source code now available.


Pages: 1
animate a trace (Read 5951 times)
mupika
Forum Newbie
*


Got Viz?

Posts: 7
animate a trace
01/06/10 at 15:36:39
 
Hi,
 
i'm just getting used to learning how to create things on my own in dx and i was wondering if it were possible to animate a trace or an xy plot in dx.
 
I am trying to create a EKG movie but i am having a difficult time even plotting the trace in DX.
 
I have tried the import data method as well as just creating a VPE myself.
 
Thanks for the help.
 
mupika
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #1 - 01/07/10 at 10:41:03
 
Hi Mupika,
 
Yes, you can definitely do animations in dx. The key is to drive your net
with one of the looping modules (Sequencer, ForEachMember, ForEachN),
whose output affects the image in some way, e.g., changing a coordinate,
or an isosurface value, or...  My advice is to first get familiar with the
Sample programs that do looping and animation (Accumulate.net, Bounce.net,  
ContoursAndCaption.net, MovingCamera.net). Once you are familiar with
how looping works in dx, you'll have a much better idea how to do your
own animations. If you still have questions, please post 'em!
 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #2 - 01/29/10 at 13:43:56
 
Hi everyone,
 
thank you for the reply.  I'm tyring to start of simple with just plotting the actual trace instead of animating it.  I'm using import spreadsheet but when i output the data to an input for plot, its saying the data is missing.
 
Should i use search first or can anyone help me out with this one?
 
Thank you.
 
mupika
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #3 - 02/01/10 at 04:59:26
 

When you use ImportSpreadsheet, it outputs a field whose components
are named the same as your table columns (or, if there are no
column names, it uses "column0", "column1", ...)
 
The Plot module wants a field with a "positions" component containing
the x-coordinates, and a "data" component containing the y-coordinates.
 
So, to plot your data, you need to alter the field. Suppose your x-coordinates
are in column "traceX" and y is in "traceY":
 
ImportSpreadsheet -> Rename("traceX","positions") -> Rename("traceY", "data") -> Plot
 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #4 - 02/19/10 at 15:01:27
 
Thanks Joel.  That worked perfectly, sorry for the extrememly staggered nature of my replies.  This has been on and off for me.
 
In order to animate i am just using the sequence to change my xmax on the import and it works beautifully.
 
I have one last question though.  Is there anyway I can thicken the line created by the plot?
 
I'm not sure which of these options here controls that.  none of them actually seem to correspond to it.
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #5 - 02/19/10 at 18:45:25
 
As far as I know, Plot has no options to control line thickness. You might be
able to extract the line from the group output by Plot, run it through Ribbon
and then put it back. Another approach would be to 'roll your own' - construct
the line yourself, pass it through Ribbon, then AutoAxes. To construct the
line: extract traceX and traceY and pass them to the a and b inputs, respectively,
of a Compute, with the expression "float([a,b])". Connect the compute output to the
origin input of a Construct. Then  --> Color(as you wish) --> Ribbon --> AutoAxes -->
 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #6 - 05/11/10 at 14:23:53
 
Hi everyone,
 
I have one more question.  So I need to make a little time bar under my ekg that represents, let's say, 2 secs, that can be used as a reference to how long the simulation is running.  Is there anyway to do that?
 
Thanks for all the help!
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #7 - 05/12/10 at 03:47:18
 
Sure... here's a generic recipe for creating a colored bar of a desired
size at a desired location: create a unit line segment, color it, and pass it through
ribbon to create a 'bar'. Then scale to the desired size and translate to its
final location.
 
Construct(origin={[0,0],[1,0]}) -> Color -> Ribbon -> Scale -> Translate
 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #8 - 08/06/10 at 15:43:18
 
Hi everyone,
 
I had a question about if statements.
 
I'm visualizing a 3d sheet of excitable media and I want to place an asterisk next to a section of the sheet and have it match the color to that section of the tissue.  I can't seem to find a way to reassign my data to value the caption and color my asterisk.
 
I can't really think of a solution to this. any help please?
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #9 - 08/09/10 at 03:55:54
 
In general, to sample a field at specific points (to get data or color or whatever)
you can use Map. In your case, you want the color at a specific point, so
Mark("colors") and pass it to the 'map' input of Map. Pass the point you want to sample
as the 'input' input. The output will be the color at that point, which you can then
use to Color your Caption or Text field.
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #10 - 08/17/10 at 14:25:57
 
so this is what i have set up right now,
 
I have my import -> Mark(input) -> Map(map) -> Color(color)
     and text -> color (input)
 
i set the point i want to sample to Map(input) and i named Mark "colors" but it says that my import is not a field.  Thanks for the help joelr.
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #11 - 08/18/10 at 04:24:01
 
It would be easier if you attached your net. I can't really tell from your
description.
 
--Joel
Back to top
 
 
Email   IP Logged
mupika
Forum Newbie
*


Got Viz?

Posts: 7
Re: animate a trace
Reply #12 - 08/18/10 at 13:47:39
 
here is my net.  I am trying to image a piece of heart tissue the placing a asterisk which will color according to one cell in the tissue.
 
Back to top
2dbvtsheet8-16-10_net.zip (attachment deleted)  
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: animate a trace
Reply #13 - 08/19/10 at 03:51:23
 
Hmmm...I guess I need the data, too! Or at least a sample, so I can
see what the error is.
 
By the way, when you get errors like "Input is not a field", you can
add a Print to find out what it is.
Back to top
 
 
Email   IP Logged
Pages: 1