why some filters require UpdatePipeline and other no?

hello,

i am curious about this,

i am reading a tiff file, using:
smalltif = TIFFSeriesReader(registrationName=pathForTiffFile.split('/')[-1].replace('.tif',''), FileNames=[pathForTiffFile])

then i am doing a median:

median1 = Median(registrationName='Median1', Input=smalltif, KernelSize = [4, 4, 4])

the thing is, that if i try to ‘display’ using the eye (or fetch the data from median) paraview crashes without any message or any output in the terminal.

on the contrary, if i use transform filter for example, there is no issue at all:

transform2 = Transform(registrationName='Transform2', Input=smalltif)
transform2.Transform.Translate = [10.0, 0.0, 0.0]

so, if i do:

  • import +median+visualize median directly/fetch data from median filter, paraview crashes.
  • import+transform+visualize transform directly/fetch data from transform filter, paraview does it without trouble.
  • import+UpdatePipeline()+median+visualize median directly/fetch data from median filter, paraview does it without trouble.

that if i try to ‘display’ using the eye (or fetch the data from median) paraview crashes without any message or any output in the terminal.

Being able to click the eye here is a bug and should not be available. You always need to press apply before clicking the eye. Does that fixes the issue ?

1 Like

Hello Mathieu,

Yes but it was more of a question in regards to the python side of things not the gui. On why , or how to know, when the UpdatePipeline() it is necessary and when not. As in my previous example, the transform filter does its job normally while the median makes paraview crash (without any error at all)

please share a python script that crashes with Median. It should not.

from paraview.simple import *
from paraview.servermanager import *
from paraview.vtk.numpy_interface import dataset_adapter as dsa


spruce_smalltif = TIFFSeriesReader(registrationName='spruce_small.tif', FileNames=['/home/franco/Downloads/spruce_small.tif'])
#UpdatePipeline()
median1 = Median(registrationName='Median', Input=spruce_smalltif, KernelSize = [1,1,1])
transform2 = Transform(registrationName='Transform2', Input=spruce_smalltif)
transform2.Transform.Translate = [10.0, 0.0, 0.0]
data=dsa.WrapDataObject(servermanager.Fetch(median1))

it crashes when the fetch is called to be exact, where if i fetch the data from transform2 it does not.

here you have the data if necessary FileSender but doubt that it is the data itself the issue.

adding the `UpdatePipeline()` BEFORE the median filter solves the crash (after the median filter it still crashes.)

Hi @otaolafr

There is a bug in vtkImageMedian3D where it does not check that an array has been set before accessing it which causes the segfault. However, adding the check would just mean that ParaView would error out instead.

Indeed, calling Fetch() an a non-updated pipeline is not supported. It could be supported but it currently is not. Always UpdatePipeline before Fetch.

well, and how does it that with transform it does not give any error?

Indeed, calling Fetch() an a non-updated pipeline is not supported. It could be supported but it currently is not. Always UpdatePipeline before Fetch.

in my case I simply put it inside the function i use to fetch the data (i have a function that calls fetch inside of it), but would be awsome if when fetch is called updatePipeline is called also, as it is a necessary thing and it would reduce for other users that will not know this.

Because you get lucky and the local VTK pipleine update happening under the hood works, it is not officially supported though.

would be awsome if when fetch is called updatePipeline is called also, as it is a necessary thing

Possible to add, please open an issue.

1 Like