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

Subject hierarchy problems after beam changes #128

Closed cpinter closed 4 years ago

cpinter commented 4 years ago

After the recent improvements related to RT plans and beams (https://github.com/SlicerRt/SlicerRT/pull/120 and https://github.com/SlicerRt/SlicerRT/pull/122) these items in subject hierarchy behave in a wrong way.

I loaded the usual test dataset RANDO PROSTATE and got this in subject hierarchy: image

Issues:

  1. The plan, the beams, and the MLCs are under the root, but they should be in the study.
  2. When I click the eye icon to show a beam, the item disappears from SH
  3. The dose volume does not show at all
  4. The structure set is now somehow also under the root. Needs to be in the study as well
cpinter commented 4 years ago

The above screenshot was from the DICOM module's SH tree. After switching to the Data module, the following changes happened:

  1. The dose volume appeared in the right place
  2. The beams beacme children of the plan
  3. The Plan's POI markup fiducials node appeared under root
MichaelColonel commented 4 years ago

I can comment some elements about MLC:

Two MLC nodes (table for positions, double array for boundary) are created and added to the scene as this->External->GetMRMLScene()->AddNode(mlcNode);.

  1. vtkSlicerDicomRtImportExportModuleLogic::vtkInternal::CreateMultiLeafCollimatorDoubleArrayNode for boundary,
  2. vtkSlicerDicomRtImportExportModuleLogic::vtkInternal::CreateMultiLeafCollimatorTableNode for positions.

The part of the code which forms hierarchy: MLC table as a child of the beam, Scan Spot Map data as a child of the ion beam, goes right after scene->EndState(vtkMRMLScene::BatchProcessState); statement in vtkSlicerDicomRtImportExportModuleLogic::vtkInternal::LoadRtPlan method.

It doesn't work if i place that part before the EndState command, even when i switched to the Data module (MLC tables will remain under the root).

cpinter commented 4 years ago

Thanks, I'll look at this. It is possible we should remove batch processing, since only a few nodes are involved.

However, I cannot do much as long as SlicerRT build fails, please see https://github.com/SlicerRt/SlicerRT/issues/129

MichaelColonel commented 4 years ago

Correction about MLC nodes in #120 and #122.

Position MLC table node in hierarchy as a child of beam node has been added only with initial ion plan support #124.

cpinter commented 4 years ago

Thanks! I remember that you left some of the SH stuff on us, so no rush with this. What really bothers me is the disappearing items. Maybe @Sunderlandkyl could look at this after the conference (Slicer project week starts on Monday), or me during...

MichaelColonel commented 4 years ago

No rush at all. I thought that the mess in DICOM module's hierarchy tree was not a bug but a feature.

MichaelColonel commented 4 years ago

Please also note, that in #124 i have slightly changed beam node naming: " BeamName [TreatmentType] : ControlPointIndex" (e.g. "LT LAT PROS [TREATMENT] : CP0").

Of course it can be easily disabled, if it unacceptable!

cpinter commented 4 years ago

I removed batch processing, and item creation and parenting work well. Beam visibility as well.

Not sure, but I think this problem is related to the recent changes in the DICOM module, so now there is an active SH tree view during loading, and it updates itself live while the nodes and items from DICOM are being loaded.

MichaelColonel commented 4 years ago

Some minor change in style that doesn't affect beam visualization, compared to the previous version. #136

cpinter commented 4 years ago

In the latest version subject hierarchy appears and functions normally.