public void okButtonActionPerformed(java.awt.event.ActionEvent e)
	{
        Image i = image_frame.getJIPTImage().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));
            new_image = filter_manager.mean(new_image,original_width, original_height, true, true, true, window_size, 1);
        }
        else if(gaussianPrefilterRadio.isSelected())
        {
            //System.out.println("Gaussian prefilter selected");
            new_image = filter_manager.gaussian(new_image,original_width, original_height);
        }
        //public Image mean(Image im, int im_width, int im_height,
        //          boolean filter_r, boolean filter_g, boolean filter_b,
        //                            int window_size, int iterations)

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

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


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

        image_frame.setFrameImage(new_image, true);
        thisWindowClosing(null);
        //this.setAlteredImage(new_image);
	}