public int setup(String arg, ImagePlus imp) {
		int i;
		ImageStatistics stats;
		stats=imp.getStatistics();
		if (IJ.versionLessThan("1.31l")){
           IJ.error("Needs ImageJ 1.31l or newer.");
			return DONE;
		}
		if (stats.histogram[0]+stats.histogram[255]!=stats.pixelCount){
			IJ.error("8-bit binary image (0 and 255) required.");
			return DONE;
		}

		if (arg.equals("about"))
			{showAbout(); return DONE;}

		showDialog("A"); //show 3x3 kernel
		//value[4]=0;

		for (i=0; i<9;i++)
			kernA+=Integer.toString(value[i])+" ";

		GenericDialog gd = new GenericDialog("Binary Thick", IJ.getInstance());
		gd.addMessage("Binary Thick v1.0");
		gd.addMessage("Kernel configuration");
		gd.addMessage("   1  2  3");
		gd.addMessage("   4  5  6");
		gd.addMessage("   7  8  9");
		gd.addMessage("");
		gd.addMessage("0=empty, 1=set, 2=don't care");
		gd.addStringField ("Kernel_A", kernA,14);

		String [] roption={"none", "rotate 90", "rotate 45", "rotate 180", "mirror", "flip" };
		gd.addChoice("Rotations", roption, roption[0]);
		gd.addNumericField ("Iterations (-1=all)", 1, 0);
		gd.addCheckbox("White foreground",false);

		gd.showDialog();
		if (gd.wasCanceled())
			return DONE;

		kernA=gd.getNextString();

		selectedOption=gd.getNextChoice();
		iterations = (int) gd.getNextNumber();
		doIwhite = gd.getNextBoolean ();

		return DOES_8G+DOES_STACKS;
	}