# How to implement the plugin that support different types of data source

**URL:** https://discourse.paraview.org/t/how-to-implement-the-plugin-that-support-different-types-of-data-source/13609
**Category:** Development
**Created:** [December 28, 2023, 8:03pm UTC](https://discourse.paraview.org/t/how-to-implement-the-plugin-that-support-different-types-of-data-source/13609 "2023-12-28T20:03:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zhe](https://discourse.paraview.org/user_avatar/discourse.paraview.org/zhe/32/2196_2.png) [@zhe](https://discourse.paraview.org/u/zhe)
#### Post date: [December 28, 2023, 8:03pm UTC](https://discourse.paraview.org/t/how-to-implement-the-plugin-that-support-different-types-of-data-source/13609/1 "2023-12-28T20:03:00Z")

</div>

Hi, dear ParaView experts:

There is a ParaView plugin that works for imageData. I recently updated it and it also work for unstructuredGrid data, could you provide some guidance about how to update the header file and make it work for both imageData and unstructuredData ? Thanks a lot for the help!

My original implementation is as follows (my filter is called `vtkUncertainContour`):

```auto
VTK_ABI_NAMESPACE_BEGIN
class VTKUNCERTAINANALYSISFILTERS_EXPORT vtkUncertainContour : public vtkImageAlgorithm
{
public:
  vtkTypeMacro(vtkUncertainContour, vtkImageAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;
  static vtkUncertainContour *New();
  ......
  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
};

```

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [December 29, 2023, 5:52am UTC](https://discourse.paraview.org/t/how-to-implement-the-plugin-that-support-different-types-of-data-source/13609/2 "2023-12-29T05:52:54Z")

</div>

The filter for both `vtkImageData` and `vtkUnstructuredGrid` data should be inherited from `vtkDataSetAlgorithm`. For example, the `vtkGradientFilter` may be helpful.

> <https://github.com/Kitware/VTK/blob/master/Filters/General/vtkGradientFilter.h>

---

<div class="post-metadata">

### Author: ![zhe](https://discourse.paraview.org/user_avatar/discourse.paraview.org/zhe/32/2196_2.png) [@zhe](https://discourse.paraview.org/u/zhe)
#### Post date: [December 29, 2023, 3:36pm UTC](https://discourse.paraview.org/t/how-to-implement-the-plugin-that-support-different-types-of-data-source/13609/3 "2023-12-29T15:36:52Z")

</div>

Sure, thanks a lot for the information!
