Exemple #1
0
        protected override Image3D OnProcess(Image3D imageIn, Progress progress)
        {
            OnValidate(imageIn);
            Size size = OnDetermineDisplaySize(imageIn);
            int w = (int)Math.Round(size.Width);
            int h = (int)Math.Round(size.Height);

            Image3D imageOut = imageIn.EmptyCopy();
            Image3D imageEnhanced = imageIn;

            Region.Pixel seedPixel = new Region.Pixel(markerX, markerY, markerZ);
            if (!seedPixel.IsExistingPixel(imageIn))
            {
                throw new LogException("Seed pixel does not exist " + seedPixel.ToString());
            }

            if(filterActivated)
            {
                imageEnhanced = new ContrastEnhancement2DFilter3x3().Process(imageEnhanced);
                imageEnhanced = imageOut - imageEnhanced;
            }

            Region region = new Region(imageIn, imageOut, imageEnhanced, seedPixel, deltaGlobal, deltaLocal, progress);
            region.Grow();

            return imageOut;
        }