14 #include "itkConnectedThresholdImageFilter.h"
40 mOutputBasePath = outputBasePath;
42 mLowerThreshold = lowerThreshold;
43 mUpperTheshold = upperThreshold;
44 mReplaceValue = replaceValue;
55 void ConnectedThresholdImageFilter::postProcessingSlot()
67 QString uid = mInput->getUid() +
"_seg%1";
68 QString name = mInput->getName()+
" seg%1";
74 mOutput->resetTransferFunctions();
76 mServices->patient()->insertData(mOutput);
79 reportSuccess(
"Done segmenting: \"" + mOutput->getName()+
"\"");
119 typedef itk::ConnectedThresholdImageFilter<itkImageType, itkImageType> thresholdFilterType;
120 thresholdFilterType::Pointer thresholdFilter = thresholdFilterType::New();
121 thresholdFilter->SetInput(itkImage);
124 thresholdFilter->SetLower(mLowerThreshold);
125 thresholdFilter->SetUpper(mUpperTheshold);
126 thresholdFilter->SetReplaceValue(mReplaceValue);
129 thresholdFilter->SetSeed(mSeed);
134 thresholdFilter->Update();
136 catch( itk::ExceptionObject & excep )
138 reportError(
"Error when setting seed for Connected Threshold Image Filter:");
142 itkImage = thresholdFilter->GetOutput();
146 itkToVtkFilter->SetInput(itkImage);
147 itkToVtkFilter->Update();
150 rawResult->DeepCopy(itkToVtkFilter->GetOutput());