Hello, I am modifying the Data module (copying the widget contents to a new module and calling it another name), and would like to only show some scalar volumes on it’s tree view. For that, I could use instead of this:
subjectHierarchyTreeView.nodeTypes = ["vtkMRMLScalarVolumeNode"]
, something like this:
subjectHierarchyTreeView.nodeTypes = ["vtkMRMLScalarVolumeSubclassNode"]
I tried to subclass the vtkMRMLScalarVolumeNode:
class vtkMRMLScalarVolumeSubclassNode(slicer.vtkMRMLScalarVolumeNode):
@staticmethod
def GetClassName():
return "vtkMRMLScalarVolumeSubclassNode"
and succeed in using it as a scalar volume, but it still maintains the original ClassName as show in the Data module “Node information”:
ClassName: vtkMRMLScalarVolumeNode
I don’t even know if is the right way to create a new node type, but it’s what I came with for now. I would be grateful for any clarifications on how to create subtypes of nodes.