Esempio n. 1
0
        public FeatureBlobStatistics CalculateStatistics()
        {
            double maxIntensity   = 0;
            double sumIntensities = 0;
            int    scanLcMin      = int.MaxValue;
            int    scanLcMax      = 0;
            int    scanImsMin     = int.MaxValue;
            int    scanImsMax     = 0;
            int    scanLcRep      = 0;
            int    scanImsRep     = 0;
            Point  apex           = null;
            bool   isSaturated    = false;

            foreach (Point point in this.PointList)
            {
                int    scanIms   = point.ScanIms;
                int    scanLc    = point.ScanLc;
                double intensity = point.Intensity;

                if (scanIms < scanImsMin)
                {
                    scanImsMin = scanIms;
                }
                if (scanIms > scanImsMax)
                {
                    scanImsMax = scanIms;
                }
                if (scanLc < scanLcMin)
                {
                    scanLcMin = scanLc;
                }
                if (scanLc > scanLcMax)
                {
                    scanLcMax = scanLc;
                }

                sumIntensities += intensity;
                if (intensity > maxIntensity)
                {
                    maxIntensity = intensity;
                    scanLcRep    = scanLc;
                    scanImsRep   = scanIms;
                    apex         = point;
                }

                if (point.IsSaturated)
                {
                    isSaturated = true;
                }
            }

            FeatureBlobStatistics statistics = new FeatureBlobStatistics(scanLcMin, scanLcMax, scanLcRep, scanImsMin, scanImsMax, scanImsRep, maxIntensity, sumIntensities, this.PointList.Count, isSaturated);

            statistics.ComputePeakProfile(apex);
            this.Statistics = statistics;

            return(statistics);
        }
Esempio n. 2
0
 public FeatureBlob(int id)
 {
     this.Id         = id;
     this.PointList  = new List <Point>();
     this.Statistics = null;
 }