public int setup(String argv, ImagePlus imp){
		this.imp = imp;
		try{
			stack = imp.getStack();
		}
		catch(Exception e){
			IJ.showMessage("A stack must be open.");
			return DONE;
		}
		String ErrorMessage = new String("One of your values was not properly formatted.\nThe default values will be used.");
		GenericDialog d = new GenericDialog("Kalman Stack Filter", IJ.getInstance());
		d.addNumericField("Acquisition_noise variance estimate:", percentvar, 2);
		d.addNumericField("Bias to be placed on the prediction:", gain, 2);
		d.addHelp("http://rsbweb.nih.gov/ij/plugins/kalman.html");
		d.showDialog();
		if(d.wasCanceled()) return DONE;
		
		percentvar = d.getNextNumber();
		if(d.invalidNumber()) {
			IJ.showMessage("Error", "Invalid input Number");
			return DONE;
		}
		gain = d.getNextNumber();	
		if(d.invalidNumber()) {
			IJ.showMessage("Error", "Invalid input Number");
			return DONE;
		}
		if(percentvar>1.0||gain>1.0||percentvar<0.0||gain<0.0){
			IJ.showMessage(ErrorMessage);
			percentvar = 0.05;
			gain = 0.8;
		}
		return DOES_16+STACK_REQUIRED+NO_UNDO;
	}