public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { //initial RunParams mFindCircleTool.RunParams.ExpectedCircularArc.CenterX = mCenterX; mFindCircleTool.RunParams.ExpectedCircularArc.CenterY = mCenterY; mFindCircleTool.RunParams.ExpectedCircularArc.Radius = mRadius; mFindCircleTool.RunParams.ExpectedCircularArc.AngleStart = mAngleStart; mFindCircleTool.RunParams.ExpectedCircularArc.AngleSpan = mAngleSpan; mFindCircleTool.RunParams.NumCalipers = mNumCalipers; mFindCircleTool.RunParams.CaliperSearchLength = mCaliperSearchLength; mFindCircleTool.RunParams.CaliperProjectionLength = mCaliperProjectionLength; mFindCircleTool.RunParams.CaliperSearchDirection = mCircleSearchDirectionOption; mFindCircleTool.RunParams.NumToIgnore = mNumToIgnore; mFindCircleTool.RunParams.CaliperRunParams.Edge0Polarity = mCogCaliperPolarityConstants; mFindCircleTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; CogRecordDisplay1.Record = mFindCircleTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { SaveLog.Msg_("FindCircleTool ROI_create Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); FindCircleTool_Status = false; return(false); } }
public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1, Runparams runparams) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { //initial RunParams m_FindCircleTool.RunParams.ExpectedCircularArc.CenterX = runparams.mCenterX; m_FindCircleTool.RunParams.ExpectedCircularArc.CenterY = runparams.mCenterY; m_FindCircleTool.RunParams.ExpectedCircularArc.Radius = runparams.mRadius; m_FindCircleTool.RunParams.ExpectedCircularArc.AngleStart = runparams.mAngleStart; m_FindCircleTool.RunParams.ExpectedCircularArc.AngleSpan = runparams.mAngleSpan; m_FindCircleTool.RunParams.NumCalipers = runparams.mNumCalipers; m_FindCircleTool.RunParams.CaliperSearchLength = runparams.mCaliperSearchLength; m_FindCircleTool.RunParams.CaliperProjectionLength = runparams.mCaliperProjectionLength; m_FindCircleTool.RunParams.CaliperSearchDirection = runparams.mCircleSearchDirectionOption; m_FindCircleTool.RunParams.NumToIgnore = runparams.mNumToIgnore; m_FindCircleTool.RunParams.CaliperRunParams.Edge0Polarity = runparams.mCogCaliperPolarityConstants; m_FindCircleTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; CogRecordDisplay1.Record = m_FindCircleTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { MessageBox.Show(ex.ToString()); FindCircleTool_Status = false; return(false); } }
public void DrawFindCircleCaliper(CogFindCircle _CogFindCircle = null) { ICogRecord _Record; CogGraphicCollection _Region; CircleCaliperTool.InputImage = (CogImage8Grey)kCogDisplay.Image; CircleCaliperTool.RunParams = _CogFindCircle; _Record = CircleCaliperTool.CreateCurrentRecord(); InteractiveCircularArc = (CogCircularArc)_Record.SubRecords["InputImage"].SubRecords["ExpectedShapeSegment"].Content; _Region = (CogGraphicCollection)_Record.SubRecords["InputImage"].SubRecords["CaliperRegions"].Content; kCogDisplay.InteractiveGraphics.Add(InteractiveCircularArc, "CircleArc", false); foreach (ICogGraphic _ICogGra in _Region) { kCogDisplay.InteractiveGraphics.Add((ICogGraphicInteractive)_ICogGra, "", false); } GC.Collect(); }