- for(uint i=0; i<options.orientation_given; i++)
- filter->AddOrientationTypeString(options.orientation_arg[i]);
+
+ if (options.orientation_given == 1) {
+ for(uint i=0; i<options.orientation_given; i++)
+ filter->AddOrientationTypeString(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);
+ }
+ }