Hello Paraviewers, (sorry for this long email but I wanted to give some pieces of code and the different things I tried before using the mailing list)
I have a 3D field of a vector and I would like to create different renderings at different parts of it. So, I play with ExctractSubset, Programmable filters and Calculators to build my viz. I do this with some python scripts and pvbatch. Here is the pipeline I created: XDMFReader l l--ExctractSubset1 l l---------------Calculator1--- Volume rendering l--ExctractSubset2 l---------------Calculator2 l-------------Programable filter---- Volume rendering where I use ExctractSubset to cut my domain into two parts, Calculator to compute the magnitude of its input and the Programmable filter to set the value of some region of its input to zero (kind of mask for my VR). I get the following message when I do the last Render() ( and then WriteImage()): ERROR: In /home/ucl/tfl/sbackaer/local/build/ParaView/ParaViewCore/VTKExtensions/vtkKdTreeGenerator.cxx, line 168 vtkKdTreeGenerator (0x1229df20): RegionIDs cannot be 0. (one per core) and then a Seg fault _________________________________________________________________ [hmem02:60782] *** Process received signal *** [hmem02:60782] Signal: Segmentation fault (11) [hmem02:60782] Signal code: (128) [hmem02:60782] Failing at address: (nil) [hmem02:60782] [ 0] /lib64/libpthread.so.0() [0x3344e0f4c0] [hmem02:60782] [ 1] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_Z52vtkVolumeRayCastSpaceLeapingImageFilterMinMaxExecuteIfEvP39vtkVolumeRayCastSpaceLeapingImageFilterP12vtkImageDataS3_PiT_+0x693) [0x7fde08a7712f] [hmem02:60782] [ 2] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_ZN39vtkVolumeRayCastSpaceLeapingImageFilter19ThreadedRequestDataEP14vtkInformationPP20vtkInformationVectorS3_PPP12vtkImageDataS7_Pii+0x2e7) [0x7fde08a7030d] [hmem02:60782] [ 3] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_Z40vtkThreadedImageAlgorithmThreadedExecutePv+0x3cb) [0x7fde01db2b8b] [hmem02:60782] [ 4] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkCommon.so.pv3.12(_ZN16vtkMultiThreader19SingleMethodExecuteEv+0x627) [0x7fde010fcf77] [hmem02:60782] [ 5] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_ZN25vtkThreadedImageAlgorithm11RequestDataEP14vtkInformationPP20vtkInformationVectorS3_+0x521) [0x7fde01db30bb] [hmem02:60782] [ 6] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_ZN39vtkVolumeRayCastSpaceLeapingImageFilter11RequestDataEP14vtkInformationPP20vtkInformationVectorS3_+0x49) [0x7fde08a714e3] [hmem02:60782] [ 7] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_ZN17vtkImageAlgorithm14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3_+0x7b) [0x7fde01bc2935] ... ____________________________________________________________ If I try to apply the volume rendering on the Calculator2 output instead of Prog filter, but still with it in the pipe, everything works. I checked that the programmable filter produces a correct output with GetPointDataInformation(): in both cases, same object and correct values like range, bounds, extents... Here is the part of my code that should be the source of my problem: if I change DataRepresentation6 = Show(pfilter) to DataRepresentation6 = Show(Ucalc) and correct field name below, it works... (sub2 is the output of a ExtractSubset) ============================================================= ... Ucalc = Calculator(Input=sub2) Ucalc.AttributeMode = 'point_data' Ucalc.Function = 'mag(w)' Ucalc.ResultArrayName = 'upper_norm' Ucalc.UpdatePipeline() di=Ucalc.GetDataInformation() print di.GetExtent(), " --> ", di.GetBounds(), "(nb points= ", di.GetNumberOfPoints(), "- Memory= ", di.GetMemorySize(), ")"pdi=di.GetPointDataInformation() print pdi print pdi.GetArrayInformation(0).GetName(), "mag range: ", pdi.GetArrayInformation(0).GetComponentRange(-1) print"" pfilter=ProgrammableFilter(Input=Ucalc) pfilter.Script=""" pdi=self.GetInput() upper_norm=pdi.GetPointData().GetArray(1) pdo=self.GetOutput() npt=pdo.GetNumberOfPoints() new_w = vtk.vtkFloatArray() new_w.SetName("new_upper_norm") new_w.SetNumberOfComponents(1) new_w.SetNumberOfTuples(npt) pdo.GetPointData().AddArray(new_w) for i in range(0, npt): coord = pdo.GetPoint(i) x, y, z = coord[:3] r=math.sqrt(math.pow(x,2)+math.pow(y,2)) if (r>=55.0) and (y<0.0): new_w.SetValue(i, 0.0) else: new_w.SetValue(i,upper_norm.GetValue(i)) """ pfilter.UpdatePipeline() di=pfilter.GetDataInformation() print di.GetExtent(), " --> ", di.GetBounds(), "(nb points= ", di.GetNumberOfPoints(), "- Memory= ", di.GetMemorySize(), ")" pdi=di.GetPointDataInformation() print pdi print pdi.GetArrayInformation(0).GetName(), "mag range: ", pdi.GetArrayInformation(0).GetComponentRange(-1) print"" DataRepresentation6 = Show(pfilter) a2_Result_PVLookupTable = GetLookupTableForArray( "new_upper_norm", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[0.0, 0.230, 0.299, 0.754, 1.0, 0.706, 0.016, 0.149], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 ) DataRepresentation6.EdgeColor = [0.0, 0.0, 0.50000762951094835] DataRepresentation6.ScalarOpacityFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 2.9, 0.05, 3.0, 1.0] ) #divide x by 14 DataRepresentation6.ColorArrayName = 'new_upper_norm' DataRepresentation6.ScalarOpacityUnitDistance = 1.0 DataRepresentation6.LookupTable = a2_Result_PVLookupTable DataRepresentation6.Representation = 'Volume' ... Render() WriteImage... ============================================================= I tried with another pipeline, same code, only different order/input: XDMFReader l---------------Calculator2 l-------------Programable filter---- Volume rendering with the code: ============================================================= ... calc = Calculator(Input=field3D) calc.AttributeMode = 'point_data' calc.Function = 'mag(w)' calc.ResultArrayName = 'norm' calc.UpdatePipeline() pfilter=ProgrammableFilter(Input=calc) pfilter.Script=""" pdi=self.GetInput() mag_w=pdi.GetPointData().GetArray(1) pdo=self.GetOutput() npt=pdo.GetNumberOfPoints() new_w = vtk.vtkFloatArray() new_w.SetName("new_norm") new_w.SetNumberOfComponents(1) new_w.SetNumberOfTuples(npt) pdo.GetPointData().AddArray(new_w) for i in range(0, npt): coord = pdo.GetPoint(i) x, y, z = coord[:3] r=math.sqrt(math.pow(x,2)+math.pow(y,2)) if (r>=55.0) and (y>0.0): new_w.SetValue(i, 0.0) else: new_w.SetValue(i,mag_w.GetValue(i)) """ pfilter.UpdatePipeline() a1_Result_PVLookupTable = GetLookupTableForArray( "new_norm", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[0.0, 0.230, 0.299, 0.754, 1.0, 0.706, 0.016, 0.149], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 ) DataRepresentation5 = Show(pfilter) DataRepresentation5.EdgeColor = [0.0, 0.0, 0.50000762951094835] DataRepresentation5.ScalarOpacityFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 4.0, 1.0] ) #divide x-scale by 3.0 DataRepresentation5.ColorArrayName = 'new_norm' DataRepresentation5.ScalarOpacityUnitDistance = 1.0 DataRepresentation5.LookupTable = a1_Result_PVLookupTable DataRepresentation5.Representation = 'Volume' ... ============================================================= I get also (one per core) ERROR: In /home/ucl/tfl/sbackaer/local/build/ParaView/ParaViewCore/VTKExtensions/vtkKdTreeGenerator.cxx, line 168 vtkKdTreeGenerator (0x145ea500): RegionIDs cannot be 0. and _______________________________________________________________ [hmem02:61777] *** Process received signal *** [hmem02:61777] Signal: Segmentation fault (11) [hmem02:61777] Signal code: (128) [hmem02:61777] Failing at address: (nil) [hmem02:61776] *** Process received signal *** [hmem02:61776] Signal: Segmentation fault (11) [hmem02:61776] Signal code: (128) [hmem02:61776] Failing at address: (nil) [hmem02:61780] *** Process received signal *** [hmem02:61780] Signal: Segmentation fault (11) [hmem02:61780] Signal code: (128) [hmem02:61780] Failing at address: (nil) [hmem02:61778] *** Process received signal *** [hmem02:61775] *** Process received signal *** [hmem02:61775] Signal: Segmentation fault (11) [hmem02:61775] Signal code: (128) [hmem02:61775] Failing at address: (nil) [hmem02:61778] Signal: Segmentation fault (11) [hmem02:61778] Signal code: (128) [hmem02:61778] Failing at address: (nil) [hmem02:61779] *** Process received signal *** [hmem02:61781] *** Process received signal *** [hmem02:61779] Signal: Segmentation fault (11) [hmem02:61779] Signal code: (128) [hmem02:61779] Failing at address: (nil) [hmem02:61781] Signal: Segmentation fault (11) [hmem02:61781] Signal code: (128) [hmem02:61781] Failing at address: (nil) [hmem02:61777] [ 0] /lib64/libpthread.so.0() [0x3344e0f4c0] [hmem02:61777] [ 1] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_Z52vtkVolumeRayCastSpaceLeapingImageFilterMinMaxExecuteIfEvP39vtkVolumeRayCastSpaceLeapingImageFilterP12vtkImageDataS3_PiT_+0x693) [0x7f7b02f4112f] [hmem02:61777] [ 2] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_ZN39vtkVolumeRayCastSpaceLeapingImageFilter19ThreadedRequestDataEP14vtkInformationPP20vtkInformationVectorS3_PPP12vtkImageDataS7_Pii+0x2e7) [0x7f7b02f3a30d] [hmem02:61777] [ 3] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_Z40vtkThreadedImageAlgorithmThreadedExecutePv+0x3cb) [0x7f7afc27cb8b] [hmem02:61777] [ 4] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkCommon.so.pv3.12(_ZN16vtkMultiThreader19SingleMethodExecuteEv+0x627) [0x7f7afb5c6f77] [hmem02:61777] [ 5] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_ZN25vtkThreadedImageAlgorithm11RequestDataEP14vtkInformationPP20vtkInformationVectorS3_+0x521) [0x7f7afc27d0bb] [hmem02:61777] [ 6] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkVolumeRendering.so.pv3.12(_ZN39vtkVolumeRayCastSpaceLeapingImageFilter11RequestDataEP14vtkInformationPP20vtkInformationVectorS3_+0x49) [0x7f7b02f3b4e3] [hmem02:61777] [ 7] /home/ucl/tfl/sbackaer/local/build/ParaView-build/bin/libvtkFiltering.so.pv3.12(_ZN17vtkImageAlgorithm14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3_+0x7b) [0x7f7afc08c935] _______________________________________________________________ BUT with this pipeline XDMFReader l-------------Programable filter l---------------Calculator2 ---- Volume rendering ============================================================= ... pfilter=ProgrammableFilter(Input=field3D) pfilter.Script=""" pdi=self.GetInput() w=pdi.GetPointData().GetArray(0) pdo=self.GetOutput() npt=pdo.GetNumberOfPoints() new_w = vtk.vtkFloatArray() new_w.SetName("new_w") new_w.SetNumberOfComponents(3) new_w.SetNumberOfTuples(npt) pdo.GetPointData().AddArray(new_w) for i in range(0, npt): coord = pdo.GetPoint(i) x, y, z = coord[:3] r=math.sqrt(math.pow(x,2)+math.pow(y,2)) if (r>=55.0) and (y>0.0): new_w.SetTuple3(i, 0.0,0.0,0.0) else: lw = w.GetTuple3(i) new_w.SetTuple3(i,lw[0],lw[1],lw[2]) """ pfilter.UpdatePipeline() calc = Calculator(Input=pfilter) calc.AttributeMode = 'point_data' calc.Function = 'mag(new_w)' calc.ResultArrayName = 'norm' calc.UpdatePipeline() a1_Result_PVLookupTable = GetLookupTableForArray( "norm", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[0.0, 0.230, 0.299, 0.754, 1.0, 0.706, 0.016, 0.149], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 ) SetActiveSource(calc) DataRepresentation5 = Show() DataRepresentation5.EdgeColor = [0.0, 0.0, 0.50000762951094835] DataRepresentation5.ScalarOpacityFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 4.0, 1.0] ) #divide x-scale by 3.0 DataRepresentation5.ColorArrayName = 'norm' DataRepresentation5.ScalarOpacityUnitDistance = 1.0 DataRepresentation5.LookupTable = a1_Result_PVLookupTable DataRepresentation5.Representation = 'Volume' ... ============================================================= I get the message (one per core) ERROR: In /home/ucl/tfl/sbackaer/local/build/ParaView/ParaViewCore/VTKExtensions/vtkKdTreeGenerator.cxx, line 168 vtkKdTreeGenerator (0x14ba2440): RegionIDs cannot be 0. but no seg fault and the image is correct! I checked every output of the different pipelines with GetDataInformation(), GetPointDataInformation()... all outputs were right. My first problem is basically that I do not know what "RegionID cannot be 0" means! The problem is related somehow to the Volume Rendering... I get the same issue and same messages with the two different versions 3.12 and 3.14. Does anyone have any clue? I am a bit lost! I can provide the results of GetDataInformation(), GetPointDataInformation(), give my complete codes or try anything else... Best, Stephane _______________________________________________ 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