From 745adc198c0e3417fa5f339ef568efba917407ae Mon Sep 17 00:00:00 2001 From: Ruoyan Meng Date: Thu, 17 Oct 2024 15:36:30 +0200 Subject: [PATCH] ENH: Add labels for export segments based on ROI points' labels --- LiverVolumetry/LiverVolumetry.py | 6 ++++++ LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/LiverVolumetry/LiverVolumetry.py b/LiverVolumetry/LiverVolumetry.py index 15a289e..5d72baa 100644 --- a/LiverVolumetry/LiverVolumetry.py +++ b/LiverVolumetry/LiverVolumetry.py @@ -452,6 +452,12 @@ def generateSegments(self, resectionNodes, ROIMarkersList, segmentsVolumeNode): seg = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentationNode") slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(generatedSegmentsNode, seg) + + ##set segments label + seg.GetSegmentation().GetNthSegment(0).SetName("Remnant") + for i in range(ROIMarkersList.GetNumberOfControlPoints()): + seg.GetSegmentation().GetNthSegment(i+1).SetName(ROIMarkersList.GetNthFiducialLabel(i)) + slicer.mrmlScene.RemoveNode(generatedSegmentsNode) diff --git a/LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx b/LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx index 9b601d2..51446e5 100644 --- a/LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx +++ b/LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx @@ -351,7 +351,7 @@ void vtkLiverVolumetryLogic::GetResectionsProjectionITKImage(vtkMRMLLabelMapVolu if(Res < 500){ Res = 500; } - BezierHR = GenerateBezierSurface(700, bezierSurfaceNode); + BezierHR = GenerateBezierSurface(Res, bezierSurfaceNode); if(i == 0){ this->ProjectedTargetSegmentImage = vtkLabelMapHelper::VolumeNodeToItkImage(TargetSegmentLabelMapCopy, true, false); }