if ( (bbGetInputIn()!=NULL) && (lstX.size()>0) && (lstX.size()==lstY.size()) && (lstX.size()==lstZ.size()) )
{
- vtkImageThresholdConnectivity *filter = vtkImageThresholdConnectivity::New();
+ if (filter!=NULL) { filter->Delete(); }
+ filter = vtkImageThresholdConnectivity::New();
double spc[3];
bbGetInputIn()->GetSpacing(spc);
int border = bbGetInputBorder();
} // for i
filter->SetSeedPoints( points );
filter->SetInputData( bbGetInputIn() );
- filter->ThresholdBetween(10, 100);
+ if (bbGetInputThreshold().size()==2)
+ {
+ if ( bbGetInputThreshold()[0] < bbGetInputThreshold()[1] )
+ {
+ filter->ThresholdBetween( bbGetInputThreshold()[0] , bbGetInputThreshold()[1] );
+ } else {
+ filter->ThresholdBetween( bbGetInputThreshold()[1] , bbGetInputThreshold()[0] );
+ }// if Thershold min max
+ } else {
+ filter->ThresholdBetween( 0, 100 );
+ }// if Thershold size
+
// filter->SetNeighborhoodRadius (4, 4, 4 );
filter->SetInValue(255);
filter->SetOutValue(0);
filter->SetSliceRangeZ(minZ-border,maxZ+border);
filter->Update();
bbSetOutputOut( filter->GetOutput() );
- } // if lst
+ } else {
+ bbSetOutputOut( NULL );
+ }// if lst
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
{
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
+ filter=NULL;
bbSetInputIn(NULL);
bbSetInputBorder(10);
std::vector<double> maskValue;
maskValue.push_back(0);
maskValue.push_back(255);
bbSetInputMaskValue(maskValue);
-
}
//=====