Ejemplo n.º 1
0
 /// <summary>
 /// Creates an edge result instance containing data from
 /// the provided result value (deep copy).
 /// </summary>
 public PairResult(PairResult result)
     : this(result.rowEdgeFirst, result.colEdgeFirst,
            result.rowEdgeSecond, result.colEdgeSecond,
            result.amplitudeFirst, result.amplitudeSecond,
            result.intraDistance, result.interDistance)
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a measurement object for the provided ROI instance.
 /// </summary>
 /// <param name="roi">ROI instance</param>
 /// <param name="mAssist">Reference to controller class</param>
 public MeasurementPair(ROI roi, MeasureAssistant mAssist)
     : base(roi, mAssist)
 {
     mResult      = new PairResult();
     mResultWorld = new PairResult();
     UpdateMeasure();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Triggers an update of the measure results because of
        /// changes in the parameter setup or a recreation of the measure
        /// object caused by an update in the ROI model.
        /// </summary>
        public override void UpdateResults()
        {
            if (mHandle == null)
            {
                return;
            }

            mMeasAssist.exceptionText = "";

            try
            {
                mHandle.MeasurePairs(mMeasAssist.mImage,
                                     mMeasAssist.mSigma, mMeasAssist.mThresh,
                                     mMeasAssist.mTransition, mMeasAssist.mPosition,
                                     out mResult.rowEdgeFirst, out mResult.colEdgeFirst, out mResult.amplitudeFirst,
                                     out mResult.rowEdgeSecond, out mResult.colEdgeSecond, out mResult.amplitudeSecond,
                                     out mResult.intraDistance, out mResult.interDistance);

                if (mMeasAssist.mIsCalibValid && mMeasAssist.mTransWorldCoord)
                {
                    Rectify(mResult.rowEdgeFirst, mResult.colEdgeFirst, out mResultWorld.rowEdgeFirst, out mResultWorld.colEdgeFirst);
                    Rectify(mResult.rowEdgeSecond, mResult.colEdgeSecond, out mResultWorld.rowEdgeSecond, out mResultWorld.colEdgeSecond);

                    mResultWorld.intraDistance = Distance(mResult.rowEdgeFirst, mResult.colEdgeFirst,
                                                          mResult.rowEdgeSecond, mResult.colEdgeSecond, 0);
                    mResultWorld.interDistance = Distance(mResult.rowEdgeSecond, mResult.colEdgeSecond,
                                                          mResult.rowEdgeFirst, mResult.colEdgeFirst, 1);

                    mResultWorld.amplitudeFirst  = mResult.amplitudeFirst;
                    mResultWorld.amplitudeSecond = mResult.amplitudeSecond;
                }
                else
                {
                    mResultWorld = new PairResult(mResult);
                }
            }
            catch (HOperatorException e)
            {
                mEdgeXLD.Dispose();
                mMeasAssist.exceptionText = e.Message;
                mResultWorld = new PairResult();
                return;
            }
            UpdateXLD();
        }
Ejemplo n.º 4
0
 /// <summary>Clears measurement result.</summary>
 public override void ClearResultData()
 {
     mResultWorld = new PairResult();
 }