private static int[] GetSquaredData(IReadOnlyList <int> lung, int width, int height)
        {
            var squaredLung  = new int[SquareNumber];
            var squareWidth  = width / SquareNumberBorder;
            var squareHeight = height / SquareNumberBorder;

            FloodFiller.IterateBitmap(SquareNumberBorder, SquareNumberBorder, (y, x) =>
            {
                // TODO: store in array
                //IList<int> averageRgb = new List<int>();
                var averageRed   = 0;
                var averageBlue  = 0;
                var averageGreen = 0;
                for (var h = y * squareHeight; h < (y + 1) * squareHeight; h++)
                {
                    for (var w = x * squareWidth; w < (x + 1) * squareWidth; w++)
                    {
                        var color     = lung[h * width + w];
                        averageRed   += Color.FromArgb(color).R;
                        averageBlue  += Color.FromArgb(color).B;
                        averageGreen += Color.FromArgb(color).G;
                    }
                }
                averageRed      /= squareHeight * squareWidth;
                averageBlue     /= squareHeight * squareWidth;
                averageGreen    /= squareHeight * squareWidth;
                var averageColor = Color.FromArgb(255, averageRed, averageGreen, averageBlue);

                squaredLung[y * SquareNumberBorder + x] = averageColor.ToArgb();
            });
            return(squaredLung);
        }
        private static int[] GetExpandedSquaredData(IReadOnlyList <int> squaredData, int width, int height)
        {
            var expandedSquaredData = new int[width * height];
            var squareWidth         = width / SquareNumberBorder;
            var squareHeight        = height / SquareNumberBorder;

            FloodFiller.IterateBitmap(height, width, (h, w) =>
            {
                expandedSquaredData[h * width + w] =
                    squaredData[h / squareHeight * SquareNumberBorder + w / squareWidth];
            });
            return(expandedSquaredData);
        }
        private int[] DesquareData(IReadOnlyList <int> originalData, IReadOnlyList <int> noBorder, int width, int height)
        {
            var lungs = Enumerable.Repeat(Color.Transparent.ToArgb(), originalData.Count).ToArray();

            FloodFiller.IterateBitmap(height, width, (h, w) =>
            {
                if (noBorder[h * width + w] != Color.Transparent.ToArgb())
                {
                    lungs[h * width + w] = originalData[h * width + w];
                }
            });
            return(lungs);
        }