Пример #1
0
        private void Separate(object parameter)
        {
            int rows  = anomalyData.GetLength(0);
            int cols  = anomalyData.GetLength(1);
            int index = Convert.ToInt32(parameter);

            if (index == 0)
            {
                resultData = Separation.TrendAnalysis(anomalyData, power);
            }
            else if (index == 1)
            {
                resultData = Separation.FilterTrendAnalysis(anomalyData, FiltData, power);
            }
            else if (index == 2)
            {
                resultData = Separation.InterpolateCut(anomalyData, expendMethod, radius, times);
            }
            else if (index == 3)
            {
                resultData = Separation.MoveAverage(anomalyData, secondData, expendMethod, radiusMin, radiusMax, radiusTick, out int bestRadius);
                Radius     = bestRadius;
            }
            else if (index == 4)
            {
                resultData = Separation.MoveAverage(anomalyData, expendMethod, radius);
            }
            else if (index == 5)
            {
                resultData = Separation.FilterMoveAverage(anomalyData, FiltData, expendMethod, radius);
            }
            else if (index == 6)
            {
                resultData = FiltData;
            }
            else if (index == 7)
            {
                resultData = Separation.FilterProject(anomalyData, expendMethod, project);
            }
            else if (index == 8)
            {
                resultData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.延拓(FrqData, 延拓高度)).GetRe());
            }

            var zmin = EdgeDetection.GetDataMin(resultData);
            var zmax = EdgeDetection.GetDataMax(resultData);

            ResultMin = zmin;
            ResultMax = zmax;
            ResultMap = GetMap(resultData, zmin, zmax);

            if (index != 6)
            {
                secondResultData = new double[rows, cols];
                for (int i = 0; i < rows; i++)
                {
                    for (int j = 0; j < cols; j++)
                    {
                        secondResultData[i, j] = anomalyData[i, j] - resultData[i, j];
                    }
                }
            }
            else
            {
                secondResultData = Separation.AverageFill(resultData);
            }

            zmin            = EdgeDetection.GetDataMin(secondResultData);
            zmax            = EdgeDetection.GetDataMax(secondResultData);
            SecondResultMin = zmin;
            SecondResultMax = zmax;
            SecondResultMap = GetMap(secondResultData, zmin, zmax);
        }