How to get the convexHull of a segment

Hello,
I want to obtain the convex hull of a segment. (I don’t know how to upload an nrrd file but I can give it necessary)
I saw this conversation but I can’t figure out what node I should get.
I want to use this snippet of code

modelNode = getNode('mySurface')

convexHull = vtk.vtkDelaunay3D()
convexHull.SetInputData(modelNode.GetPolyData())
outerSurface = vtk.vtkGeometryFilter()
outerSurface.SetInputConnection(convexHull.GetOutputPort())
outerSurface.Update()
modelNode.SetAndObservePolyData(outerSurface.GetOutput())

But I don’t know what I should put in ‘mysurface’
From my understanding I should put the name of an vtkMRMLModelNode so that I can call GetPolyData()

However when I do getNode(‘mysegmentation’) I get a vtkMRMLSegmentationNode

I don’t know how to get the vtkMRMLModelNode could you help me with that ?
Or if you have another way to get the convec hull that works too

Probably you want one of these methods:

Thanks you I managed to make it work :slight_smile: