Skip to content

Commit

Permalink
Adjust initial segmentation algorithm to remove open close operator, …
Browse files Browse the repository at this point in the history
…but instead filter resulting regions by size
  • Loading branch information
davidborland committed Dec 11, 2019
1 parent e3baf31 commit 44ebc4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions VisualizationContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,26 @@ void VisualizationContainer::SegmentVolume() {
threshold->SetOutputScalarTypeToUnsignedChar();
threshold->SetInputDataObject(data);

/*
vtkSmartPointer<vtkImageOpenClose3D> openClose = vtkSmartPointer<vtkImageOpenClose3D>::New();
openClose->SetKernelSize(10, 10, 10);
openClose->SetKernelSize(1, 1, 1);
openClose->SetOpenValue(0);
openClose->SetCloseValue(255);
openClose->SetInputConnection(threshold->GetOutputPort());
*/

// Generate labels
vtkSmartPointer<vtkImageConnectivityFilter> connectivity = vtkSmartPointer<vtkImageConnectivityFilter>::New();
connectivity->SetScalarRange(255, 255);
connectivity->SetLabelScalarTypeToUnsignedShort();
connectivity->SetInputConnection(openClose->GetOutputPort());
connectivity->SetSizeRange(5, VTK_ID_MAX);
connectivity->SetInputConnection(threshold->GetOutputPort());
connectivity->Update();

labels = connectivity->GetOutput();

UpdateLabels();

qtWindow->UpdateRegionTable(regions);

Render();
Expand Down

0 comments on commit 44ebc4d

Please sign in to comment.