# XML specification questions for a filter

**URL:** https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641
**Category:** Development
**Created:** [September 27, 2019, 3:16pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641 "2019-09-27T15:16:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [September 27, 2019, 3:16pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/1 "2019-09-27T15:16:58Z")

</div>

Hi,

I recently modified the ParaView to have the `Image Data to Uniform Grid` filter be available in the GUI’s Filter’s menu. There’s a couple of issues with the XML configuration though.

The biggest issue is that `vtkGhostType` isn’t available in the `Select Input Scalars` option as this is the natural array name for a ghost array in VTK but is normally hidden in ParaView. Is there a way to make that shown for this filter?

The second issue is that I didn’t properly set the filter to work for composite data sets. I want the filter to be available when there are at least some but not necessarily all vtkImageDatas in the composite dataset. For example, I have a combination of vtkImageDatas with blanking and vtkUnstructuredGrids and the filter knows to properly work with that. I tried the following which doesn’t work:

```auto
        <DataTypeDomain name="input_type" composite_data_supported="1">
          <DataType value="vtkImageData" />
        </DataTypeDomain>

```

Alternatively, I could do the following but that may be confusing as it would make the filter available even when there are no vtkImageDatas in the composite dataset:

```auto
        <DataTypeDomain name="input_type">
          <DataType value="vtkImageData" />
          <DataType value="vtkCompositeDataSet" />
        </DataTypeDomain>

```

I’d be ok with this if others are though.

Thanks,  
Andy

---

<div class="post-metadata">

### Author: ![aron.helser](https://discourse.paraview.org/user_avatar/discourse.paraview.org/aron.helser/32/13_2.png) [@aron.helser](https://discourse.paraview.org/u/aron.helser)
#### Post date: [September 27, 2019, 3:33pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/2 "2019-09-27T15:33:30Z")

</div>

I think if you use your first method:

```auto
<DataTypeDomain name="input_type" composite_data_supported="1">

```

you could add `vtkUnstructuredGrid` as a supported type, and your filter would accept your input data. However, I think ParaView would call the filter once for each piece of the composite dataset, rather than just once with the

vtkCompositeDataSet as input.

If you use the second method, you get a vtkCompositeDataSet as input, and can iterate the blocks inside your filter. I think you can do something in the GetInformation methods to validate that you can handle the input, so that you know there’s at least one vtkImageData. I look in `filters.xml` for something with similar inputs, and then see if the data validation matches my needs…

HTH,

Aron

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [October 1, 2019, 2:17pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/3 "2019-10-01T14:17:52Z")

</div>

> [@Andy\_Bauer](#):
>
> The biggest issue is that `vtkGhostType` isn’t available in the `Select Input Scalars` option as this is the natural array name for a ghost array in VTK but is normally hidden in ParaView. Is there a way to make that shown for this filter?

Not as an option that exists in ParaView. We could probably add a hint that tells ParaView to show hidden arrays.

> [@Andy\_Bauer](#):
>
> The second issue is that I didn’t properly set the filter to work for composite data sets. I want the filter to be available when there are at least some but not necessarily all vtkImageDatas in the composite dataset.

It should be possible with some extension to `vtkSMDataTypeDomain`.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [October 1, 2019, 5:41pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/4 "2019-10-01T17:41:48Z")

</div>

Thanks Cory.

I started looking at doing the hint and modifying `vtkPVDataSetAttributesInformation.cxx` and realized it was going to be quite a bit more complex than I originally thought. I created an issue for this at [https://gitlab.kitware.com/paraview/paraview/issues/19353](https://gitlab.kitware.com/paraview/paraview/issues/19353). Do you think you could get this done by the 5.8 release?

I also changed the XML and pushed a [MR](https://gitlab.kitware.com/paraview/paraview/merge_requests/3608) so that it will work with composite datasets. I’ll add an issue after the MR makes it into master to extend `vtkSMDataTypeDomain` to help keep the GUI clean but that’s not as urgent of a change in my opinion. I’ll leave it up to you as to whether you want to target 5.8 for that issue or not.

Thanks,  
Andy

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [October 2, 2019, 1:39pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/5 "2019-10-02T13:39:12Z")

</div>

I just created an [issue](https://gitlab.kitware.com/paraview/paraview/issues/19357) to clean up the GUI for when to make the `ImageDataToUniformGrid` filter available now that it is available for composite datasets.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [October 2, 2019, 1:52pm UTC](https://discourse.paraview.org/t/xml-specification-questions-for-a-filter/2641/6 "2019-10-02T13:52:44Z")

</div>

Thanks, Andy.
