VMTK extract centerline fails with VMTK using VTK9

Using 4.13.0-2021-07-11 r30039 / 27f99af factory built, and factory SlicerVMTK-Extension on Arch Linux.

Network models and curves are generated.

Tree model fails : 0 point, 0 cell. No errors in Python console. Application log reports :

Found CommandLine Module, target is  /home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/bin/../lib/Slicer-4.13/cli-modules/Decimation
ModuleType: CommandLineModule
Decimation command line: 

/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/bin/../lib/Slicer-4.13/cli-modules/Decimation --reductionFactor 0.925105 --method FastQuadric --deleteBoundary --aggressiveness 4 /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBG.obj /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBH.obj 

Decimation standard output:

Input: 66760 vertices,133472 triangles (target 9996)
Output: 8463 vertices,16920 triangles (0.873232 reduction)

Decimation completed without errors

ReadDataInternal (vtkMRMLModelStorageNode6): File /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBH.obj does not contain coordinate system information. Assuming LPS.


End of Centerline Computation..
vtkvmtkSimplifyVoronoiDiagram::RequestData is not functionnal when built against VTK >= 9


Algorithm vtkvmtkSimplifyVoronoiDiagram(0x13e1ab70) returned failure for request: vtkInformation (0x13d1dd00)
  Debug: Off
  Modified Time: 32642077
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0




Cost function array with name specified does not exist!


Cost function array with name specified does not exist!


Descent array with name specified does not exist!

Tree curve fails with the following errors in Python console:

Failed to compute results: 'NoneType' object has no attribute 'GetValue'
Traceback (most recent call last):
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 318, in onApplyButton
    self.logic.createCurveTreeFromCenterline(centerlinePolyData, centerlineCurveNode, centerlinePropertiesTableNode, curveSamplingDistance)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 914, in createCurveTreeFromCenterline
    self.addCenterlineCurves(mergedCenterlines, centerlineCurveNode)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 923, in addCenterlineCurves
    self._addCenterline(mergedCenterlines, replaceCurve=centerlineCurveNode)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 950, in _addCenterline
    groupId = mergedCenterlines.GetCellData().GetArray(self.groupIdsArrayName).GetValue(cellId)
AttributeError: 'NoneType' object has no attribute 'GetValue'


And these in application log :

Found CommandLine Module, target is  /home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/bin/../lib/Slicer-4.13/cli-modules/Decimation
ModuleType: CommandLineModule
Decimation command line: 

/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/bin/../lib/Slicer-4.13/cli-modules/Decimation --reductionFactor 0.925105 --method FastQuadric --deleteBoundary --aggressiveness 4 /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBI.obj /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBJ.obj 

Decimation standard output:

Input: 66760 vertices,133472 triangles (target 9996)
Output: 8463 vertices,16920 triangles (0.873232 reduction)

Decimation completed without errors

ReadDataInternal (vtkMRMLModelStorageNode7): File /tmp/Slicer/CGCCEF_vtkMRMLModelNodeBJ.obj does not contain coordinate system information. Assuming LPS.


End of Centerline Computation..
vtkvmtkSimplifyVoronoiDiagram::RequestData is not functionnal when built against VTK >= 9


Algorithm vtkvmtkSimplifyVoronoiDiagram(0xc3f9920) returned failure for request: vtkInformation (0x1a29ae40)
  Debug: Off
  Modified Time: 33443953
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0




Cost function array with name specified does not exist!


Cost function array with name specified does not exist!


Descent array with name specified does not exist!


Failed to compute results: 'NoneType' object has no attribute 'GetValue'
RadiusArray with name specified does not exist


RadiusArray with name specified does not exist


Failed to compute results: 'NoneType' object has no attribute 'GetValue'
Traceback (most recent call last):
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 318, in onApplyButton
    self.logic.createCurveTreeFromCenterline(centerlinePolyData, centerlineCurveNode, centerlinePropertiesTableNode, curveSamplingDistance)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 914, in createCurveTreeFromCenterline
    self.addCenterlineCurves(mergedCenterlines, centerlineCurveNode)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 923, in addCenterlineCurves
    self._addCenterline(mergedCenterlines, replaceCurve=centerlineCurveNode)
  File "/home/user/programs/Test/Slicer-4.13.0-2021-07-11-linux-amd64/NA-MIC/Extensions-30039/SlicerVMTK/lib/Slicer-4.13/qt-scripted-modules/ExtractCenterline.py", line 950, in _addCenterline
    groupId = mergedCenterlines.GetCellData().GetArray(self.groupIdsArrayName).GetValue(cellId)
AttributeError: 'NoneType' object has no attribute 'GetValue'

Same observations with home built Slicer and SlicerVMTK-Extension.

That’s since SlicerVMTK-Extension built with VTK9.

My last VTK8 builds were fine.

Regards.

Unfortunately, Voronoi smoothing is currently broken (VTK API drastically changed, which requires update of the filter). For now, you need to disable this feature by setting centerlineFilter.SetSimplifyVoronoi(0) here:

It would be great if you could test this and if everything works well then submit a pull request with this change.

Setting SetSimplifyVoronoi(0) does allow the centerline model and curve to be created.

I pushed the change, but it is merged in the PR already open for Centerline metrics. Though I clicked ‘New pull request’ in my fork. Is it a problem ? How should I do otherwise ?

Thanks.

Thank you, I’ve cherry-picked your commit (and added a version check so that the smoothing is still performed in older Slicer versions).

You pushed the change into the same branch, probably that’s why it is included in the same open pull request that you have for that branch.