# ImageData with Time-series (alternative of vtkTemporalDataSet?)

**URL:** https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735
**Category:** Support
**Created:** [July 9, 2020, 4:15am UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735 "2020-07-09T04:15:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kusnahmi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d26b3c/32.png) [@kusnahmi](https://discourse.vtk.org/u/kusnahmi)
#### Post date: [July 9, 2020, 4:15am UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/1 "2020-07-09T04:15:18Z")

</div>

I am dealing with time series vector data. The 3-directional velocity vector in 3D space varies through time. I came to know that there are wonderful filters for pathline and streakline, but I could not find the appropriate data source structure to store time-series data.

I referred to this blog post, make a subclass of VTKPythonAlgorithmBase and implemented RequestInformation and RequestData to support TIME\_STEPS and TIME\_RANGE.

> **[Streaming in VTK : Time - Kitware Blog](https://blog.kitware.com/streaming-in-vtk-time/)**
>
> With this blog, I am starting another series. This time we will cover streaming in VTK. In this context, we define streaming as the process ... Read More

Is this the only way to use time-series data? I found that once there was vtkTemporalDataSet, but soon it has been deprecated. Is there any alternative for vtkTemporalData? Is there any way to use vtkMultiBlockDataSet for this purpose?

---

<div class="post-metadata">

### Author: ![kusnahmi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d26b3c/32.png) [@kusnahmi](https://discourse.vtk.org/u/kusnahmi)
#### Post date: [July 15, 2020, 4:31am UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/2 "2020-07-15T04:31:39Z")

</div>

Is there anyone who has experience on time-series data?  
I read this from vtkMultiTimeStepAlgorithm document.

> The child class uses UPDATE\_TIME\_STEPS to make the time requests and use set of time-stamped data objects are stored in time order in a **vtkMultiBlockDataSet** object.

So I think there should be a way to set time-stamp to each block of multi-block data set, but I don’t know how to.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [July 15, 2020, 5:17am UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/3 "2020-07-15T05:17:28Z")

</div>

You can manage temporal data sets at the application level.

For example, in 3D Slicer, we have implemented time series support by adding a [sequence class that can store multiple VTK data objects](https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLSequenceNode.h) (volume, polydata, unstructured grid, transform, table, text, segmentation, measurement, etc.), one for each time point; and a [sequence browser class](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Sequences/MRML/vtkMRMLSequenceBrowserNode.h), which is responsible for bringing data objects into the scene that correspond to the selected time point. It is less elegant than a time-aware pipeline, but we have been using it for over 5 years in many projects, for various use cases and data types, and it works well enough.

---

<div class="post-metadata">

### Author: ![kusnahmi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d26b3c/32.png) [@kusnahmi](https://discourse.vtk.org/u/kusnahmi)
#### Post date: [July 16, 2020, 5:38am UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/4 "2020-07-16T05:38:53Z")

</div>

Thanks for the answer.

If I store temporal data into a custom class at the application level, I don’t think it can be used for pathline and streakline generation using existing vtkParticleTracer, vtkParticlePathFilter, and vtkStreaklineFilter, and also vtkTemporalInterpolator.

So… it seems that there is no existing class that can be used for time-series data.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [July 16, 2020, 5:39pm UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/5 "2020-07-16T17:39:29Z")

</div>

You can create a simple adaptor class as you can see in [TestParticleTracers](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/FlowPaths/Testing/Cxx/TestParticleTracers.cxx#L38).

---

<div class="post-metadata">

### Author: ![kusnahmi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d26b3c/32.png) [@kusnahmi](https://discourse.vtk.org/u/kusnahmi)
#### Post date: [July 16, 2020, 5:57pm UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/6 "2020-07-16T17:57:45Z")

</div>

Thanks. I am using VTK with python, so I implemented similar class with VTKPythonAlgorithmBase rather than subclassing vtkAlgorithm. I am happy that I am in the right way.  
I am attaching my time-series source class for someone who might need an example in python.

[StaticSphereSource.py](https://discourse.vtk.org/uploads/short-url/hq8vVxdTUqkV0gsf74Lni53BI6i.py) (3.8 KB)

---

<div class="post-metadata">

### Author: ![kayarre](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kayarre/32/808_2.png) [@kayarre](https://discourse.vtk.org/u/kayarre)
#### Post date: [July 28, 2020, 7:58pm UTC](https://discourse.vtk.org/t/imagedata-with-time-series-alternative-of-vtktemporaldataset/3735/7 "2020-07-28T19:58:54Z")

</div>

I have tried doing this in c++ but I am struggling to figure out how to make the pipeline update.

following the examples it will execute RequestData once, but then not again. I am not sure I know where I need to add the magic that tells the instance that something has changed? I know that’s the issue, but not sure what I am missing. Is there an up to date full blown example out there?
