/**        Simple demo program real file in a RealImage and display it
 *         in a popup windows
 *         Demo for dia course.
 *         @auther Will Hossack, 
 */
import uk.ac.ed.ph.signal.*;                   // Signal classes

public class MedianDisplay {
    public static void main(String args[]) {

	//            Check that argument was given.
	if (args.length < 3) {
            System.err.println("Usage: java MedianDisplay filename m n");
            System.exit(1);
        }
        String file = args[0];
	int m = Integer.parseInt(args[1]);
	int n = Integer.parseInt(args[2]);

	//            Read image (type depermined by suffix)
	RealImage im = RealImage.readImage(file);
	System.out.println("Read image is : " + im);

	//            Create a display panel
	ImageFrame display = new ImageFrame("My Image");
	display.addImage(im);     // Add image with (with autscale defaults)
	display.centre();         // Display in centre of screen

	
	im = im.median(m,n);

	ImageFrame mediandisplay = new ImageFrame("Median Image");
	mediandisplay.addImage(im);     // Add image w

	
	

    }
}

