SlicerRT dose volume object

Hi there,

I am doing some work where I am creating radiation dose distributions for simulated tumours from scratch (rather than exporting from a RT planning software). In Python I generate a 3D numpy array which I convert to a vtkMRMLScalarVolumeNode. How do I convert my scalar volume node into a dose volume node that is used by the Dose Volume Histogram module in SlicerRT?

I am able to successfully load in dose volumes from DICOM data. When I investigate those volumes, I find that they are also vtkMRMLScalarVolumeNodes. What differentiates a dose volume node from other Scalar Volume Nodes (besides the unit).

Thank you,
Ed

Yes, it is mainly about setting the unit, but you also need to have the dose volume under a proper DICOM hierarchy. You can find all the necessary steps in the implementation of the right-click menu action (in Data module) that converts a regular volume to a dose volume:

Thank you, this is exactly what I was looking for!

1 Like

In case this is useful for others, here is my Python code to achieve this:

sh  = slicer.util.getNodesByClass("vtkMRMLSubjectHierarchyNode")[0]
itemID = sh.GetItemByDataNode(MmNode)
sh.SetItemParent(itemID, sh.GetItemParent(sh.GetItemByDataNode(volumeNode)))
sh.SetItemAttribute(itemID, 'DoseUnitName', "Gy")
sh.SetItemAttribute(itemID, 'DoseUnitValue', "1.0")
MmNode.SetAttribute("DicomRtImport.DoseVolume", "1")
sh.RequestOwnerPluginSearch(itemID)
sh.ItemModified(itemID)
1 Like