option "config" - "Config file" string no
option "verbose" v "Verbose" flag off
-option "input" i "Input image filename" string yes multiple
+option "input" i "Input image filename" string no multiple
option "channel" c "Image channel to be used in statistics (-1 to process all channels)" int no default="-1"
option "mask" m "Mask image filename (uchar)" string no
option "label" l "Label(s) in the mask image to consider" int no multiple default="1"
{
m_ArgsInfo=a;
m_Verbose=m_ArgsInfo.verbose_flag;
- m_InputFileName=m_ArgsInfo.input_arg[0];
+
+ if(m_ArgsInfo.input_given)
+ m_InputFileName=m_ArgsInfo.input_arg[0];
+ else if(m_ArgsInfo.inputs_num>0)
+ m_InputFileName=m_ArgsInfo.inputs[0];
+ else {
+ std::cerr << "You must give an input file name" << std::endl;
+ exit(1);
+ }
}