Animating Spheres (or markups) Using Sequencer

Hello,

I am trying to animate some markers in slicer. Basically, I want a bunch of spheres that change sizes and colors as time progresses. I did some digging and reached the conclusion that the parameters of markup control points cannot be changed individually (you seem to have to change the entire list) so I thought I could work around that by making a bunch of sphere models with the vtkSphereSource node and place them at each markup point and animating that.

I have 128 independent control points for which I have already calculated the relative position (in Python) and absolute position in 3D space (in Slicer) to yield 2 separate point lists as markup nodes. I also have the RGB values I want each point to have at each frame (in Python) and the relative size I want each point to have at each frame (also in Python). I also can make a sphere model in code for the most part.

I just cannot for the life of me understand the sequencer. I’m starting to think it wants each frame of each point imported as a separate object? With 128 points over many frames, that will get unwieldy fast. I am missing how I can click the play button in the sequencer and play through my colors/ sizes of points. If I need to limit myself to loading just a small subset of frames, that is also fine since I have over a hundred points and many thousand potential frames. I don’t even mind just reading the data from Python - I just don’t understand how I can make a timeline of indices, access them in code, and update either markups or vtkspheres when I click play. The timeline and play/stop functionality is what I care about the most here.

Any insight you all have would be helpful.

You could just make a VTK pipeline to create the spheres and colors you want at each frame. You may want to look at the Animator module in SlicerMorph for ideas this approach integrates with Sequences.