for mesh cell 1 …, end of mesh <== executing all of the mesh
- Get each mesh cell(below first picture) of all the mesh cells in the volume
- Modify each cell value(color)
referral script code^^
modelNode = slicer.util.getNode(inputVolume.GetID())
m = modelNode.GetMesh()
trianglefilter = vtk.vtkTriangleFilter()
cellPointIds = vtk.vtkIdList()
for i in range(0,3):
neighbourcells = vtk.vtkIdList()
idList = vtk.vtkIdList()
Let us know if you have any questions.
I will do it by myself and let sample code shared in this page^^
You have set a segmentation node into
modelNode variable. As the name suggests, a model node is expected. You can create model nodes from segmentations by exporting segments to model nodes (this creates surface meshes) or by using Segment Mesher extension (this creates volumetric mesh).
I did mesh from Segment Mesher^^
when i call modelNode.GetMesh()
cellScalars = modelNode.GetMesh().GetCellData()
it seemed to be there’s no attribute ‘GetMesh’
or python script can find ‘GetMesh’ function
You can run
print(modelNode) in the Python console to see if the object is indeed a model node.
“modelNode” is a vtkMRMLSegmentationNode, so it is not a model node. Segmentation node is an input to model generators. You can create model nodes from segmentations by exporting segments to model nodes (this creates surface meshes) or by using Segment Mesher extension (this creates volumetric mesh).
Thanks Adras, I have time so now analysis all of the slicer source code for accumulated and structured knowledges. I think slicer has positive contribution to the medical imaging and communication (like DICOM Concept). Always thinking your slicer community member’s hard working and Voluntary commitment