Skip to content

Commit

Permalink
ENH: Add labels for export segments based on ROI points' labels
Browse files Browse the repository at this point in the history
  • Loading branch information
RuoyanMeng authored and RafaelPalomar committed Jan 21, 2025
1 parent e7a236e commit 745adc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions LiverVolumetry/LiverVolumetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 745adc1

Please sign in to comment.