/// <summary>
        /// Simple structure to package a filter's data.
        /// </summary>
        /// <param name="method">Metric function.</param>
        internal MetricMethod(Metric.MetricDelegate method)
        {
            MetricAttribute mm = Factory.GetMetricsFromMethodInfo(method.Method);
            if (mm == null)
                throw new NotSupportedException(string.Format("Method {0} is not decorated with MetricAttribute ", method.Method.Name));

            _method = method;

            _attributes = new Hashtable();
            _attributes.Add("Name", mm.Name);
            _attributes.Add("Description", mm.Description);
        }
 /// <summary>
 /// Provides a inheritable attribute class to define a metric profile to associate to a filter.
 /// </summary>
 /// <param name="metrics">The object that holds the metric functions.</param>
 internal FilterMetricAttribute(Metric metrics)
 {
     _metrics = metrics;
 }
 /// <summary>
 /// Base class for implementing a metric associable to a Node.
 /// </summary>
 /// <param name="key">The key of the metric.</param>
 /// <param name="method">The metric function.</param>
 public MetricExecBase(string key, Metric.MetricDelegate method)
 {
     this.key = key;
     this.method = method;
 }
 /// <summary>
 /// Defines a metric execution for a filter RowResults.
 /// </summary>
 /// <param name="Item1">The metric function.</param>
 /// <param name="Item2">The metric function.</param>
 /// <param name="Item3">A "reference" image, if needed.</param>
 public RowMetricExecution(
         Metric.MetricDelegate Item1,
         MetricExecutionType Item2, WeakImage Item3)
 {
     this.Item1 = Item1;
     this.Item2 = Item2;
     this.Item3 = Item3;
 }
 /// <summary>
 /// Defines a metric calculated.
 /// </summary>
 /// <param name="Item1">The key of the metric in the filter's metric collection.</param>
 /// <param name="Item2">The metric function.</param>
 public RowMetric(string Item1, Metric.MetricDelegate Item2)
 {
     this.Item1 = Item1;
     this.Item2 = Item2;
 }
 /// <summary>
 /// Regular metric associable to a Node. The input and output images of the filter
 /// are given to the MetricExec after the execution of the filter to calculate the metric.
 /// </summary>
 /// <param name="key">The key of the metric.</param>
 /// <param name="method">The metric function.</param>
 public MetricExec(string key, Metric.MetricDelegate method)
     : base(key, method)
 {
 }
 /// <summary>
 /// Metric associable to a node that takes a previously defined 
 /// reference and the output of the filter to calculate the metric after the filter execution.
 /// </summary>
 /// <param name="key">The key of the metric.</param>
 /// <param name="method">The metric function.</param>
 /// <param name="reference">The reference to use in the calculation of the metric.</param>
 public MetricExecReference(string key, Metric.MetricDelegate method, WeakImage reference)
     : base(key, method)
 {
     base.SetInput(reference);
 }