public void updateAlteredImage()
    {
        Image i = original_image.getImage();
        Image new_image = i;
        // Check for prefilter
        if(meanPrefilterRadio.isSelected())
        {
            //System.out.println("Mean prefilter selected");
            String windowSizeString = windowSizes[windowComboBox.getSelectedIndex()];
            int window_size = Integer.parseInt(windowSizeString.substring(0,1));
            //System.out.println("Window size = " + window_size);
            new_image = filter_manager.mean(new_image,p_width, p_height, true, true, true, window_size, 1);

        }
        else if(gaussianPrefilterRadio.isSelected())
        {
            //System.out.println("Gaussian prefilter selected");
            new_image = filter_manager.gaussian(new_image,p_width, p_height);
        }

        // Execute edge detection
        if(laplaceRadio.isSelected())
        {
            // Laplace
            new_image = ToolManager.grayscale_image(new_image, p_width, p_height);
            new_image = filter_manager.laplace(new_image,p_width, p_height);

        }
        else if(sobelRadio.isSelected())
        {
            new_image = filter_manager.sobel(new_image,p_width, p_height);
        }
        else if(robertsRadio.isSelected())
        {
            new_image = filter_manager.roberts(new_image,p_width, p_height);
        }

        // Apply threshold
        if(noneThresholdRadio.isSelected())
        {
            // Do nothing
        }
        else
        {
            int threshold = thresholdSlider.getValue();
            //new_image = tool_manager.threshold_image(new_image, p_width, p_height, 255,255,255,threshold);
            new_image = ToolManager.threshold_image(new_image, p_width, p_height, 255,255,255,threshold);
        }

        this.setAlteredImage(new_image);
    }