Example #1
0
        protected internal ROI smallestActiveROI(out System.Collections.Generic.List <double> data, out int index)
        {
            try
            {
                int activeROIIdx = this.getActiveROIIdx();
                index = activeROIIdx;
                data  = new System.Collections.Generic.List <double>();

                if (activeROIIdx > -1)
                {
                    ROI    region   = this.getActiveROI();
                    Type   type     = region.GetType();
                    HTuple smallest = region.getModelData();

                    //////for (int i = 0; i < smallest.Length; i++)
                    //////{
                    //////    data.Add(smallest[i].D);
                    //////}

                    return(region);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                data  = null;
                index = 0;
                return(null);
            }
        }
Example #2
0
        /// <summary>
        /// 获取当前选中ROI的信息
        /// </summary>
        /// <returns></returns>
        protected internal System.Collections.Generic.List <double> smallestActiveROI(out string name, out int index)
        {
            name = "";
            int activeROIIdx = this.getActiveROIIdx();

            index = activeROIIdx;
            if (activeROIIdx > -1)
            {
                ROI  region = this.getActiveROI();
                Type type   = region.GetType();
                name = type.Name;

                HTuple smallest = region.getModelData();
                System.Collections.Generic.List <double> resual = new System.Collections.Generic.List <double>();
                for (int i = 0; i < smallest.Length; i++)
                {
                    resual.Add(smallest[i].D);
                }

                return(resual);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        protected internal RoiData(int id, ROI roi)
        {
            this._id = id;
            HTuple m_roiData = null;

            m_roiData = roi.getModelData();

            switch (roi.Type)
            {
            case "ROIRectangle1":
                this._name = "Rectangle1";

                if (m_roiData != null)
                {
                    this._rectangle1       = new Rectangle1(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
                    this._rectangle1.Color = roi.Color;
                }
                break;

            case "ROIRectangle2":
                this._name = "Rectangle2";

                if (m_roiData != null)
                {
                    this._rectangle2       = new Rectangle2(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D, m_roiData[4].D);
                    this._rectangle2.Color = roi.Color;
                }
                break;

            case "ROICircle":
                this._name = "Circle";

                if (m_roiData != null)
                {
                    this._circle       = new Circle(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D);
                    this._circle.Color = roi.Color;
                }
                break;

            case "ROILine":
                this._name = "Line";

                if (m_roiData != null)
                {
                    this._line       = new Line(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
                    this._line.Color = roi.Color;
                }
                break;

            default:
                break;
            }
        }