Skip to content

Commit

Permalink
BUG: fixed ALive-research#248, adjusted region growing and surface re…
Browse files Browse the repository at this point in the history
…solution settings
  • Loading branch information
RuoyanMeng committed Sep 25, 2023
1 parent c01526c commit 2ccac63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Liver/Resources/UI/ResectionsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
<double>1.000000000000000</double>
</property>
<property name="minimum">
<double>5.000000000000000</double>
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
Expand Down
10 changes: 8 additions & 2 deletions LiverVolumetry/LiverVolumetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,14 @@ def computeVolume(self, segmentsVolumeNode, targetSegmentVolumeNode, segmentatio
segStatLogic.computeStatistics()
stats = segStatLogic.getStatistics()
for segmentId in stats["SegmentIDs"]:
voxel_count = stats[segmentId,"LabelmapSegmentStatisticsPlugin.voxel_count"]
volume_cm3 = stats[segmentId,"LabelmapSegmentStatisticsPlugin.volume_cm3"]
voxel_count = 0
volume_cm3 = 0
if stats[segmentId,"LabelmapSegmentStatisticsPlugin.voxel_count"]:
voxel_count = stats[segmentId,"LabelmapSegmentStatisticsPlugin.voxel_count"]
volume_cm3 = stats[segmentId,"LabelmapSegmentStatisticsPlugin.volume_cm3"]
elif stats[segmentId,"ScalarVolumeSegmentStatisticsPlugin.voxel_count"]:
voxel_count = stats[segmentId,"ScalarVolumeSegmentStatisticsPlugin.voxel_count"]
volume_cm3 = stats[segmentId,"ScalarVolumeSegmentStatisticsPlugin.volume_cm3"]
segmentName = segmentationNode.GetSegmentation().GetSegment(segmentId).GetName()
statistics[segmentId] = [segmentName, voxel_count, volume_cm3]
self.scl.VolumetryTable(segmentName, targetSegmentVolume, voxel_count, volume_cm3,outputTable)
Expand Down
5 changes: 4 additions & 1 deletion LiverVolumetry/Logic/vtkLiverVolumetryLogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void vtkLiverVolumetryLogic::PrintSelf(ostream &os, vtkIndent indent)
void vtkLiverVolumetryLogic::ComputeAdvancedPlanningVolumetry(vtkMRMLLabelMapVolumeNode* SelectedSegmentsLabelMap, vtkMRMLTableNode* OutputTableNode, vtkMRMLMarkupsFiducialNode* ROIMarkersList, vtkCollection* ResectionNodes, double TargetSegmentationVolume){
vtkLabelMapHelper::LabelMapType::RegionType TargetSegmentsBoundingBox;
vtkLabelMapHelper::LabelMapType::Pointer TargetSegmentsITKImage;
int baseValue = 7;
int baseValue = 100;
double spacing[3];
SelectedSegmentsLabelMap->GetSpacing(spacing);

Expand Down Expand Up @@ -116,6 +116,9 @@ void vtkLiverVolumetryLogic::ComputeAdvancedPlanningVolumetry(vtkMRMLLabelMapVol
{
auto bezierSurfaceNode = vtkMRMLMarkupsBezierSurfaceNode::SafeDownCast(this->resectionNodes->GetItemAsObject(i));
auto Res = GetRes(bezierSurfaceNode, spacing, 300);
if(Res < 500){
Res = 500;
}
BezierHR = GenerateBezierSurface(Res, bezierSurfaceNode);
if(i == 0){
this->ProjectedTargetSegmentImage = vtkLabelMapHelper::VolumeNodeToItkImage(TargetSegmentLabelMapCopy, true, false);
Expand Down

0 comments on commit 2ccac63

Please sign in to comment.