X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkRelativePositionList.txx;h=7a53a99dc1eb3248c230b6690ef346b0906003be;hb=6ae5074c8a8f2c27b21849f5cdf2cc0cfb369698;hp=ec49a548fdad4859038c70df544481ab3605e9c0;hpb=922f0049feb4213c981f12c6bbdd517dd71e468d;p=clitk.git diff --git a/segmentation/clitkRelativePositionList.txx b/segmentation/clitkRelativePositionList.txx index ec49a54..7a53a99 100644 --- a/segmentation/clitkRelativePositionList.txx +++ b/segmentation/clitkRelativePositionList.txx @@ -146,10 +146,12 @@ GenerateOutputInformation() { // Loop on RelativePositionList of operations std::string s = GetInputName(); for(uint i=0; i:: SetFilterOptions(typename RelPosFilterType::Pointer filter, ArgsInfoType & options) { - if (options.orientation_given != 1) { - DD("ERRROR DEBUG TODO no more than 1 orientation yet"); - exit(0); + if (options.orientation_given > 1) { + clitkExceptionMacro("Error in the RelPos options. I need a single --orientation (for the moment)." + << " Current options are for obj = '" << options.object_arg + << "', threshold = " << options.threshold_arg << std::endl); } ImagePointer object = GetAFDB()->template GetImage(options.object_arg); @@ -222,8 +225,21 @@ SetFilterOptions(typename RelPosFilterType::Pointer filter, ArgsInfoType & optio filter->SetVerboseImageSizeFlag(GetVerboseImageSizeFlag()); filter->SetFuzzyThreshold(options.threshold_arg); filter->SetInverseOrientationFlag(options.inverse_flag); // MUST BE BEFORE AddOrientationTypeString - for(uint i=0; iAddOrientationTypeString(options.orientation_arg[i]); + + if (options.orientation_given == 1) { + for(uint i=0; iAddOrientationTypeString(options.orientation_arg[i]); + } + else { + if (options.angle1_given && options.angle2_given) { + filter->AddAnglesInDeg(options.angle1_arg, options.angle2_arg); + } + else { + clitkExceptionMacro("Error in the RelPos options. I need --orientation or (--angle1 and --angle2)." + << " Current options are for obj = '" << options.object_arg + << "', threshold = " << options.threshold_arg << std::endl); + } + } filter->SetIntermediateSpacing(options.spacing_arg); if (options.spacing_arg == -1) filter->IntermediateSpacingFlagOff(); else filter->IntermediateSpacingFlagOn();