[vtk-developers] vtkTemporalDataSet downcast returns NULL

David Gobbi david.gobbi at gmail.com
Wed Aug 15 13:01:23 EDT 2012


Hi Roy,

To work with time-series data in VTK, I turn the time series into a
multi-component image volume where each component is a different
time. So if I have a time series of N volumes, then I use e.g.
vtkImageAppendComponent to create a single volume that has N
components per voxel.  It isn't ideal, but I've found that it is a
useful way of dealing with 4D image data in VTK.  The
vtkLookupTable has a method called SetVectorComponent
that can be used to choose what component to use when
displaying the data (or vtkImageExtractComponents can
be used to extract one time step for viewing).

 - David


On Wed, Aug 15, 2012 at 9:36 AM, Yuanxin Liu <leo.liu at kitware.com> wrote:
> Hi, Roy,
>
>    vtkTemporalDataSet was recently depreciated.  Please refer to the
> article: http://www.vtk.org/Wiki/VTK/Remove_vtkTemporalDataSet for details.
>
>    The current master no longer builds vtkTemporalDataSet, although the
> actual source files are still in there. They will be removed soon.
>
> Leo
>
>
> On Wed, Aug 15, 2012 at 7:21 AM, Pelt, R.F.P. van <R.F.P.v.Pelt at tue.nl>
> wrote:
>>
>> While writing an image reader for temporal data, I am overriding the
>> RequestData function.
>>
>> My class is derived from vtkImageReader2.
>>
>> The reader should construct a vtkTemporalDataSet, and so I tried to do a
>> safe downcast on the outputVector data.
>>
>>
>>
>> vtkTemporalDataSet *data = vtkTemporalDataSet::GetData(outputVector);
>>
>>
>>
>> or
>>
>>
>>
>> vtkInformation* outInfo = outputVector->GetInformationObject(0);
>>
>> vtkTemporalDataSet *data =
>> vtkTemporalDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
>>
>>
>>
>> Unfortunately, this returns NULL for all cases, probably indicating an
>> error in the downcast.
>>
>> What am I missing here?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> - Roy



More information about the vtk-developers mailing list