[Paraview] Volume reader
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Thu Feb 25 16:42:31 EST 2010
For vtkImageData filters, you need to override "RequestInformation"
method to provide information about whole_extents, spacing and origin.
Look at VTK/Graphics/vtkRTAnalyticSource.cxx as an example. Ideally,
your RequestData() method should also look at the extents that were
actually requested and only produce the output for that extent.
Utkarsh
2010/2/22 Sébastien Lasserre <sebastien.lasserre at epfl.ch>:
> Hello everyone,
>
> I am trying to write a VTK reader to read custom volumetric data into Paraview.
>
> I started with the example vtkImageAlgorithm
> (http://www.itk.org/Wiki/VTK_Examples_vtkImageAlgorithm_Filter) and
> changed it so the Filter doesn't take any input and output a
> vtkImageData.
>
> To simplify, I generate a vtkImageData with constant values in the
> RequestData method of my filter and assign it to the output using
> output->ShallowCopy(imageData) at the end of the method.
>
> When I tried to use this reader as plugin in Paraview, the views
> (Outline, Volume) of the data are not working because the dimension of
> the vtkImageData are null.
>
> I tried to use the same filter in a VTK code. The output has a
> dimension and I can print the content of the vtkImageData. If I add a
> Outline actor, I am able to see the extend of the data but if I attach
> a Volume actor, I get this error during the runtime :
>
> terminate called after throwing an instance of 'std::bad_alloc'
> what(): std::bad_alloc
>
> If I copy the content of the output into a new vtkImageData, then I am
> able to see the data using the Volume Actor and I don't get anymore
> the error.
>
> Did I forget something while declaring my filter ?
>
> I attached the header and implementation file of my filter and the
> main.cxx for the VTK test.
>
> I am using Paraview 3.7.0 on Ubuntu 9.10.
>
> Thanks for your help,
>
> Sebastien
>
> Aborted
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
More information about the ParaView
mailing list