X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkMorphoMathFilter.txx;h=2eb3a0261c280da9193d39e270d1746f6a478944;hb=9e9bff2490b1ebdfb57c8e1bf4e359a51b12b77c;hp=1267583929e0ceac1cf6faee0debc3be08139dc5;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/segmentation/clitkMorphoMathFilter.txx b/segmentation/clitkMorphoMathFilter.txx index 1267583..2eb3a02 100644 --- a/segmentation/clitkMorphoMathFilter.txx +++ b/segmentation/clitkMorphoMathFilter.txx @@ -30,6 +30,7 @@ clitk::MorphoMathFilter::MorphoMathFilter(): p.Fill(1); SetRadius(p); SetBoundaryToForegroundFlag(false); + VerboseFlagOff(); } //-------------------------------------------------------------------- @@ -67,20 +68,26 @@ SetRadius(SizeType & p) //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +template +void clitk::MorphoMathFilter:: +SetRadius(int r) +{ + for(uint i=0; i void clitk::MorphoMathFilter:: SetOperationType(int type) { - switch (type) { - case 0: m_OperationType = Erode; return; - case 1: m_OperationType = Dilate; return; - case 2: m_OperationType = Open; return; - case 3: m_OperationType = Close; return; - case 4: m_OperationType = CondErode; return; - case 5: m_OperationType = CondDilate; return; - default: clitkExceptionMacro("Operation type must be between 0-5 (0=Erode, 1=Dilate, 2=Close (erode(dilate(x))), 3=Open (dilate(erode(x))), 4=CondErode, 5=CondDilate)"); - } + if(type<0 || type>5) + clitkExceptionMacro("Operation type must be between 0-5 (0=Erode, 1=Dilate, 2=Close (erode(dilate(x))), 3=Open (dilate(erode(x))), 4=CondErode, 5=CondDilate)"); + m_OperationType = OperationTypeEnumeration(type); } //-------------------------------------------------------------------- @@ -276,7 +283,9 @@ GenerateData() typename OutputCastImageFilterType::Pointer oCaster = OutputCastImageFilterType::New(); oCaster->SetInput(filter->GetOutput()); oCaster->Update(); + this->SetNthOutput(0, oCaster->GetOutput()); + //this->GraftOutput(oCaster->GetOutput()); // NO } //--------------------------------------------------------------------