# Generating a mesh from noisy medical data

**URL:** https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300
**Category:** ParaView Support
**Created:** [November 10, 2025, 4:59pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300 "2025-11-10T16:59:52Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 10, 2025, 4:59pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/1 "2025-11-10T16:59:52Z")

</div>

Hello everyone, I have some rather noisy medical data (from a 3D Microscope), and I’ve been exploring it with ParaView, and I’d like to export some data into another application that I have that is able to render OBJ files (well aware of the shortcomings of using OBJ). I have a pipeline state that works, but I’d like to reduce the noise – the polygons are all jagged, and for this I really want to get something that gives an overall gist of the data, and then my other tool can be used to look at the details.

While Googling and “chatting” I got some suggestions that maybe some ITK filters would be a good option, so first I wonder, since ITK is more medical oriented, perhaps that is a direction I should be looking, and second, is there a way to access ITK filters from inside ParaView (perhaps using a “Programmable Filter”)?

My current pipeline is basically:  
_3D-Microscope data.vti_  
ResampleToImage  
Programable Filter (using vtkImageAnisotropicDiffusion3D)  
Contour  
ExtractSurface  
Connectivity  
Clean  
Triangulate  
QuadraticDecimation  
ProgrammableFilter (using vtkWindowdSincPolyDataFilter)

Then → Save Data as OBJ  
(which I’d like for each region to have it’s own material, but the OBJ writer doesn’t seem to do that, perhaps because it’s a very old format.)

Any general advice? Thanks, Bill

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 12, 2025, 7:33am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/2 "2025-11-12T07:33:25Z")

</div>

> [@wsherman](#):
>
> is there a way to access ITK filters from inside ParaView (perhaps using a “Programmable Filter”)?

No, at least not with the conventional binary release, although it may be possible with some python magic.

Can you use anything else but OBJ format ? glTF comes to mind.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 12, 2025, 7:38am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/3 "2025-11-12T07:38:16Z")

</div>

Okay, Thanks Mathieu. I guess, since to some degree I’d like to get to the point where I can just write a script that processes the data and outputs a model, so maybe I should just look at ITK? I use ParaView because I’m most familiar with it, but if ITK has better tools for medical data, maybe I should consider it.

Regarding OBJ vs. glTF: sure, I could use glTF. My big desire is to better process the data into something that gives an overall impression of the data – and then the user can interrogate further through interaction. So I can work with glTF – it just so happens that I have an OBJ reader in my tool already, but I can work around that.

Thanks.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 12, 2025, 7:40am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/4 "2025-11-12T07:40:09Z")

</div>

While ITK is definitely a powerfull tool for medical, it doesnt seem required here.

Using File → ExportScene into glTF at the end of your pipeline instead should do the trick imo.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 12, 2025, 8:03am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/5 "2025-11-12T08:03:23Z")

</div>

Well, I guess I may have over emphasized the last stage of what I need. My main desire is a way to import 3D medical data (in this case a 3D Microscope scan), and filter it to where it does a better job of showing some of the 3D structures in the data. I can iso-surface it now with the Contour filter, but it’s very very noisey, and with the pipeline above, I tried to tame that down a bit, but not yet to what I am hoping for.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 12, 2025, 9:55am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/6 "2025-11-12T09:55:28Z")

</div>

Could you share a screenshot of what you want to export ?

---

<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: [November 12, 2025, 2:30pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/7 "2025-11-12T14:30:12Z")

</div>

> [@wsherman](#):
>
> is there a way to access ITK filters from inside ParaView

I suggest starting by installing ITK into a Python virtual environment with `pip install itk` and then write some scripts to process the data without ParaView at first. Maybe that will get you what you need.

If not, then you might be able to use ParaView’s `--venv` option to point to your virtual environment with ITK installed and then you would have access to it in a Programmable Filter and other places – if it all works. Since ITK brings with it compiled libraries, it wouldn’t surprise me if you run into some incompatibility that might make it so that you can at least load the ITK python module. Then, if that all works, you’ll have to bridge the gap between the VTK data objects and ITK data objects. It has been a long time since I’ve done this, but maybe you could use their respective NumPy interfaces to do easy data exchange.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 12, 2025, 3:12pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/8 "2025-11-12T15:12:38Z")

</div>

Cory, Mathieu, thanks.

Mathieu, I’m attaching a screen shot of the data, and you can see how rough it is. I’m coloring it by RegionID to try to highlight some of the little “floating” blobs. But again, I’m actually less concerned about the exporting than I am the filtering to smooth things out.

Cory, okay, thanks. I suppose I should thus go to the ITK Discourse to find out what filters would be the good ones! I thought maybe there’d be enough cross-over that I could get all my answers from a one-stop shop!

 ![pv_mayo](https://discourse.paraview.org/uploads/default/original/3X/9/2/92752c443b8c494b03096f421ff2ce72331acc22.jpeg)

---

<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: [November 12, 2025, 3:29pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/9 "2025-11-12T15:29:42Z")

</div>

> [@wsherman](#):
>
> I thought maybe there’d be enough cross-over that I could get all my answers from a one-stop shop!

Personally it’s been a long time since I’ve used ITK, and we don’t get many image processing/analysis questions on the ParaView forum. A ParaView-adjacent application, [tomviz](https://tomviz.org/), is more focused on 3D image data, and has concepts similar to ParaView in terms of loading data, applying operators, and so on.

You might also want to try [Slicer](https://www.slicer.org/) to do image processing/analysis with ITK but without programming. It’s similar to ParaView in that it is an end-user application, but it is much more tailored to image data specifically.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 12, 2025, 3:31pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/10 "2025-11-12T15:31:12Z")

</div>

Okay, thanks Cory – when you say “Image data”, you’re using the VTK/ParaView terminology for that, whereby an Image can be 3D, yes?

---

<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: [November 12, 2025, 3:51pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/11 "2025-11-12T15:51:39Z")

</div>

> [@wsherman](#):
>
> whereby an Image can be 3D, yes?

Indeed, yes, a regular grid in 3D, with regular constant between samples in each dimension.

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [November 12, 2025, 4:00pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/12 "2025-11-12T16:00:33Z")

</div>

@wsherman there is also [GitHub - OpenChemistry/tomviz: Cross platform, open source application for the processing, visualization, and analysis of 3D tomography data](https://github.com/OpenChemistry/tomviz) which is more ‘near’ paraview style.

@cory.quammen would it be possible to at some point on the small video tutorials that kitware does and publish online, to teaking with ITK inside paraview? I would love to continue working in paraview isntead of swiching to slicer or tomviz, as i have a quite developed workflow inside of it. but right now i really need to use ITK tools, would be great to see some expert giving some dummy examples, as:

1. install ITK inside paraview
2. ‘check what ITK can do’
3. select something interesting from ITK library
4. bring it back to paraview

please consider this, funny enought just today I made a post about this [paraview for image treatment (3D scan, tif format) - #3 by otaolafr](https://discourse.paraview.org/t/paraview-for-image-treatment-3d-scan-tif-format/17302/3) and while searching for this the answers on ‘what is possible to do and how to do with paraview +ITK’ is quite sparse….

---

<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: [November 12, 2025, 4:10pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/13 "2025-11-12T16:10:55Z")

</div>

We’ll definitely consider it if we find ourselves doing work that uses ITK in ParaView.

---

<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: [November 12, 2025, 4:37pm UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/14 "2025-11-12T16:37:20Z")

</div>

This looks promising on my Mac with a development build of ParaView.

```python
python3 -m venv ~/itkvenv
source ~/itkvenv/bin/activate
pip install ~/itkvenv
bin/paraview.app/Contents/MacOS/paraview --venv ~/itkvenv

```

Add **Wavelet** source, add **Programmable Filter** and set it’s Script to

```python
import itk
itk_image = itk.image_from_vtk_image(inputs[0])

input_type = itk.Image[itk.F,3]
output_type = itk.Image[itk.D,3]
caster = itk.cast_image_filter(itk_image, ttype=(input_type, output_type))
caster.Update()

vtk_result = itk.vtk_image_from_image(caster)
output.ShallowCopy(vtk_result)

```

The Wavelet source produces a vtkImageData with floats, and this programmable script casts that image to a vtkImageData of doubles.

Input image info:

 ![image](https://discourse.paraview.org/uploads/default/original/3X/f/f/ff2bab06a70adbd73e41dcda53c7bceb4480b1fb.png)

Output image info (note the array type is “double” instead of “float”):

 ![image](https://discourse.paraview.org/uploads/default/original/3X/d/5/d565ff35bd81efacb1537830eb994521f4e5ca43.png)

It’s maybe not the most useful example, but it demonstrates that ITK can be used within ParaView’s Python environment using virtual environments and a pip-installed ITK.

I have not tried this with a binary from [paraview.org](http://paraview.org), but it should work as long as you create your virtual environment such that it installs compatible ITK Python modules. See [Install any python package for the ParaView binary release using pip](https://discourse.paraview.org/t/install-any-python-package-for-the-paraview-binary-release-using-pip/14437) for more info about that.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [November 13, 2025, 1:37am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/15 "2025-11-13T01:37:48Z")

</div>

Great, thanks for checking Cory.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 13, 2025, 9:19am UTC](https://discourse.paraview.org/t/generating-a-mesh-from-noisy-medical-data/17300/16 "2025-11-13T09:19:41Z")

</div>

Definitely worth a post in [Tips and Tricks - ParaView](https://discourse.paraview.org/c/tips-and-tricks/9) 🙂
