SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
127 stars 60 forks source link

BUG: Multiple control points loading is disabled, only control point 0 will be loaded (issue #145) #146

Closed MichaelColonel closed 4 years ago

MichaelColonel commented 4 years ago

Temporary fix for issue #145. Tests are passed, except python scripts.

If multiple control points are not required immediately.

lassoan commented 4 years ago

This workaround could be good for Slicer-4.10, but for Slicer-4.11 it should be very easy to create a sequence node instead. You create the nodes the same way as before, but instead of adding it to the main scene, you add them to a vtkMRMLSequenceNode using SetDataNodeAtValue. Then you add the sequence node to the main scene. For user's convenience, you can create a sequence browser node. I would be happy help with any specific questions that you might have.

MichaelColonel commented 4 years ago

Agreed. I will try to add sequence nodes instead.

cpinter commented 4 years ago

If you can take a stab at it @MichaelColonel we appreciate it! Let us know if you have any questions.

MichaelColonel commented 4 years ago

First round of questions:

  1. Before beam node will be added to the sequence node, it must be properly loaded, transformed, etc. Is it possible to invoke custom event (or events) for beam node, while these beam nodes are played by a sequence browser node? It is required, because beam transformation beamNode->InvokeCustomModifiedEvent(vtkMRMLRTBeamNode::BeamTransformModified); becomes super laggy, then hundreds of such nodes are in the plan node.

  2. Should a sequence node be added to the plan node, so the user will be able to see what king of beam is it (static single beam or dynamic beam with multiple control points)?

  3. How the sequence node must be added to the subject hierarchy?

MichaelColonel commented 4 years ago

Another question:

Does the subject hierarchy plugin required in order to make sequence node visible in subject hierarchy node?

lassoan commented 4 years ago

Before beam node will be added to the sequence node, it must be properly loaded, transformed, etc. Is it possible to invoke custom event (or events) for beam node, while these beam nodes are played by a sequence browser node? It is required, because beam transformation beamNode-

Loading: you load into a data node the same way. The only difference is that the data node is in the sequence node's internal scene.

Transform: you apply the transform to the proxy node (the node that represents a selected sequence item in the main scene). If the transform is time-varying, too, then the transform node in the main scene is a proxy node, too.

InvokeCustomModifiedEvent(vtkMRMLRTBeamNode::BeamTransformModified); becomes super laggy, then hundreds of such nodes are in the plan node.

There won't be hundreds of nodes in the main scene. All the time-varying nodes will be in internal scenes in sequence nodes.

Should a sequence node be added to the plan node, so the user will be able to see what king of beam is it (static single beam or dynamic beam with multiple control points)?

You can retrieve sequence node from the proxy node, but it probably make sense to keep a node reference directly to the beam sequence node.

How the sequence node must be added to the subject hierarchy?

Usually we don't add subject hierarchy plugin for the sequence node: the user selects a time point with the sequence browser slider and works with proxy nodes corresponding to that time point. However, if you want the beam sequence to show up (and not just the current beam) then you can certainly add a subject hierarchy plugin for it.

Does the subject hierarchy plugin required in order to make sequence node visible in subject hierarchy node?

Yes.

MichaelColonel commented 4 years ago

Last question for today:

Can a virtual output nodes created by a sequence browser, in my simple case beam node and transformation node from corresponding sequences, be manipulated as a usual nodes, for example added to the plan?

lassoan commented 4 years ago

Yes, you can use proxy nodes (old term: virtual output nodes) the same way as any other regular nodes.