/// <summary>
        /// Performs the actual work not the most efficient way but I'll work it out
        /// </summary>
        public void Evaluate(IMathematics mathematics, bool fuzzy)
        {
            Model.DoseMatrixOptimal sourceDose = new Model.DoseMatrixOptimal(_source.DoseMatrix());
            Model.DoseMatrixOptimal targetDose = new Model.DoseMatrixOptimal(_target.DoseMatrix());
            TotalCount = targetDose.Length;
            Debug.WriteLine("\n\n\nEvaluating " + _source.FileName + " and " + _target.FileName + " Dimensions disagree");
            Debug.WriteLine("Max dose: Source - " + sourceDose.MaxPointDose.Dose + " Target - " + targetDose.MaxPointDose.Dose);
            Tuple <int, int> ret;

            for (int i = 0; i < _dtas.Length; i++)
            {
                if (_dtas[i].Relative)
                {
                    ret = mathematics.CompareRelative(sourceDose, targetDose, _dtas[i].Tolerance, _dtas[i].Threshhold, fuzzy);
                }
                else
                {
                    ret = mathematics.CompareAbsolute(sourceDose, targetDose, _dtas[i].Tolerance, _dtas[i].Threshhold, fuzzy);
                }
                _comparisons[i] = new Controller.SingleComparison();
                _comparisons[i].TotalCompared = ret.Item2;
                _comparisons[i].TotalFailed   = ret.Item1;
                _comparisons[i]._dta          = _dtas[0];
            }
            IsEvaluated = true;
        }
Esempio n. 2
0
 /// <summary>
 /// Performs the actual work not the most efficient way but I'll work it out
 /// </summary>
 public void Evaluate(IMathematics mathematics)
 {
     Model.DoseMatrixOptimal sourceDose = new Model.DoseMatrixOptimal(_source.DoseMatrix());
     Model.DoseMatrixOptimal targetDose = new Model.DoseMatrixOptimal(_target.DoseMatrix());
     TotalCount = targetDose.Length;
     Debug.WriteLine("\n\n\nEvaluating " + _source.FileName + " and " + _target.FileName + " Dimensions disagree");
     Debug.WriteLine("Max dose: Source - " + sourceDose.MaxPointDose.Dose + " Target - " + targetDose.MaxPointDose.Dose);
     Model.SingleComparison ret;
     for (int i = 0; i < _dtas.Length; i++)
     {
         if (_dtas[i].Relative)
         {
             ret = mathematics.CompareRelative(sourceDose, targetDose, _dtas[i]);
         }
         else
         {
             ret = mathematics.CompareAbsolute(sourceDose, targetDose, _dtas[i]);
         }
         _comparisons[i] = ret;
     }
     IsEvaluated = true;
 }
 /// <summary>
 /// Performs the actual work not the most efficient way but I'll work it out
 /// </summary>
 public void Evaluate(IMathematics mathematics, bool fuzzy)
 {
     Model.DoseMatrixOptimal sourceDose = new Model.DoseMatrixOptimal(_source.DoseMatrix());
     Model.DoseMatrixOptimal targetDose = new Model.DoseMatrixOptimal(_target.DoseMatrix());
     TotalCount = targetDose.Length;
     if (sourceDose.CompareDimensions(targetDose))
     //if (false)
     {
         Debug.WriteLine("\n\n\nEvaluating " + _source.FileName + " and " + _target.FileName);
         Tuple <int, int> ret;
         ret = mathematics.CompareAbsolute(sourceDose, targetDose, TightTol, ThreshholdTol, fuzzy);
         TotalFailedTightTolAbs   = ret.Item1;
         TotalComparedTightTolAbs = ret.Item2;
         if (ret.Item1 == 0) // if failed tightest evaluation skip further evaluation Requires tight < main to work.
         {
             TotalFailedMainTolAbs    = ret.Item1;
             TotalComparedMainTolAbs  = ret.Item2;
             TotalFailedTightTolRel   = ret.Item1;
             TotalComparedTightTolRel = ret.Item2;
             TotalFailedMainTolRel    = ret.Item1;
             TotalComparedMainTolRel  = ret.Item2;
         }
         else
         {
             ret = mathematics.CompareAbsolute(sourceDose, targetDose, MainTol, ThreshholdTol, fuzzy);
             TotalFailedMainTolAbs   = ret.Item1;
             TotalComparedMainTolAbs = ret.Item2;
             ret = mathematics.CompareRelative(sourceDose, targetDose, TightTol, ThreshholdTol, fuzzy);
             TotalFailedTightTolRel   = ret.Item1;
             TotalComparedTightTolRel = ret.Item2;
             ret = mathematics.CompareRelative(sourceDose, targetDose, MainTol, ThreshholdTol, fuzzy);
             TotalFailedMainTolRel   = ret.Item1;
             TotalComparedMainTolRel = ret.Item2;
         }
         IsEvaluated = true;
     }
     else
     {
         Debug.WriteLine("\n\n\nEvaluating " + _source.FileName + " and " + _target.FileName + " Dimensions disagree");
         Debug.WriteLine("Max dose: Source - " + sourceDose.MaxPointDose.Dose + " Target - " + targetDose.MaxPointDose.Dose);
         Tuple <int, int> ret;
         ret = mathematics.CompareAbsolute(sourceDose, targetDose, TightTol, ThreshholdTol, fuzzy);
         TotalFailedTightTolAbs   = ret.Item1;
         TotalComparedTightTolAbs = ret.Item2;
         if (ret.Item1 == 0)
         {
             TotalFailedMainTolAbs    = ret.Item1;
             TotalComparedMainTolAbs  = ret.Item2;
             TotalFailedTightTolRel   = ret.Item1;
             TotalComparedTightTolRel = ret.Item2;
             TotalFailedMainTolRel    = ret.Item1;
             TotalComparedMainTolRel  = ret.Item2;
         }
         else
         {
             ret = mathematics.CompareAbsolute(sourceDose, targetDose, MainTol, ThreshholdTol, fuzzy);
             TotalFailedMainTolAbs   = ret.Item1;
             TotalComparedMainTolAbs = ret.Item2;
             ret = mathematics.CompareRelative(sourceDose, targetDose, TightTol, ThreshholdTol, fuzzy);
             TotalFailedTightTolRel   = ret.Item1;
             TotalComparedTightTolRel = ret.Item2;
             ret = mathematics.CompareRelative(sourceDose, targetDose, MainTol, ThreshholdTol, fuzzy);
             TotalFailedMainTolRel   = ret.Item1;
             TotalComparedMainTolRel = ret.Item2;
         }
         IsEvaluated = true;
     }
 }