From: dsarrut Date: Tue, 15 Feb 2011 10:51:53 +0000 (+0000) Subject: add options ('keep object', 'inverse', verbose etc) X-Git-Tag: v1.2.0~251 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c7ed257e825d4049138e40a28c9f815d47647efd;p=clitk.git add options ('keep object', 'inverse', verbose etc) --- diff --git a/tools/clitkRelativePosition.ggo b/tools/clitkRelativePosition.ggo index 4f65fe2..2192012 100644 --- a/tools/clitkRelativePosition.ggo +++ b/tools/clitkRelativePosition.ggo @@ -8,7 +8,7 @@ option "config" - "Config file" string no option "verbose" v "Verbose" flag off option "verboseStep" - "Verbose each step" flag off option "writeStep" w "Write image at each step" flag off -option "verboseOption" - "Display options values" flag off +option "verboseOptions" - "Display options values" flag off option "imagetypes" - "Display allowed image types" flag off section "Input/Output" @@ -17,19 +17,19 @@ option "object" j "Input mask object filename" string yes option "output" o "Output image filename" string yes section "Main options" -option "orientation" r "L R A P I S (LeftRightAntPostInfSup)" string no default="L" +option "orientation" r "L R A P I S (LeftRightAntPostInfSup)" string no multiple default="L" option "angle1" a "Angle 1 (deg)" double no default="0" option "angle2" b "Angle 2 (deg)" double no default="0" option "spacing" s "Resample before (faster)" double no option "threshold" t "Fuzzy threshold" double no default="0.6" -option "not" n "Not flag : inverse of the orientation" flag off +option "inverse" n "Not flag : inverse of the orientation" flag off +option "doNotRemoveObject" - "if flag is on, do not remove the object" flag off option "noAutoCrop" c "No auto crop at the end if set" flag off +option "combineWithOr" - "Combine relpos map and support with OR" flag off section "Slice by slice processing" option "sliceBySlice" - "Slice by slice relative position" flag off option "direction" d "If SbS, indicate the slice direction" int no default="2" +option "uniqueCCL" u "Keep only one CC in each slice" flag off - - - diff --git a/tools/clitkRelativePositionGenericFilter.txx b/tools/clitkRelativePositionGenericFilter.txx index 2e62b42..7ed172d 100644 --- a/tools/clitkRelativePositionGenericFilter.txx +++ b/tools/clitkRelativePositionGenericFilter.txx @@ -65,12 +65,12 @@ template void clitk::RelativePositionGenericFilter:: SetOptionsFromArgsInfoToFilter(FilterType * f) { - f->SetVerboseOption(mArgsInfo.verbose_flag); - f->SetVerboseStep(mArgsInfo.verboseStep_flag); - f->SetWriteStep(mArgsInfo.writeStep_flag); + f->SetVerboseOptionFlag(mArgsInfo.verboseOptions_flag); + f->SetVerboseStepFlag(mArgsInfo.verboseStep_flag); + f->SetWriteStepFlag(mArgsInfo.writeStep_flag); - if (mArgsInfo.orientation_given) { - f->SetOrientationTypeString(mArgsInfo.orientation_arg); + for(uint i=0; iAddOrientationTypeString(mArgsInfo.orientation_arg[i]); } if (mArgsInfo.spacing_given) { @@ -79,8 +79,10 @@ SetOptionsFromArgsInfoToFilter(FilterType * f) } f->SetFuzzyThreshold(mArgsInfo.threshold_arg); - f->SetNotFlag(mArgsInfo.not_flag); + f->SetRemoveObjectFlag(!mArgsInfo.doNotRemoveObject_flag); f->SetAutoCropFlag(!mArgsInfo.noAutoCrop_flag); + f->SetCombineWithOrFlag(mArgsInfo.combineWithOr_flag); + f->SetInverseOrientationFlag(mArgsInfo.inverse_flag); } //-------------------------------------------------------------------- @@ -107,7 +109,10 @@ UpdateWithInputImageType() filter->SetInput(input); filter->SetInputObject(object); SetOptionsFromArgsInfoToFilter(filter); - filter->SetDirection(mArgsInfo.direction_arg); // only for SliceBySliceRelativePositionFilter + + // Set options only for SliceBySliceRelativePositionFilter + filter->SetDirection(mArgsInfo.direction_arg); + filter->SetUniqueConnectedComponentBySlice(mArgsInfo.uniqueCCL_flag); // Go ! filter->Update(); @@ -127,8 +132,8 @@ UpdateWithInputImageType() // Set global Options filter->SetInput(input); filter->SetInputObject(object); - filter->SetAngle1(mArgsInfo.angle1_arg);// only for this filter - filter->SetAngle2(mArgsInfo.angle2_arg); + if (mArgsInfo.angle1_given && mArgsInfo.angle2_given) + filter->AddAngles(mArgsInfo.angle1_arg, mArgsInfo.angle2_arg); SetOptionsFromArgsInfoToFilter(filter); // Go !