public void run(String arg) {

		// Check the ImageJ version
		if (IJ.versionLessThan("1.21a"))
			return;

		// Check the presence of the image
		ImagePlus imp = WindowManager.getCurrentImage();
		if (imp == null) {
			IJ.error("No stack of images open");
			return;
		}

		// Check the size of the image
		if (imp.getWidth() < 4) {
			IJ.error("The image is too small (nx=" + imp.getWidth() + ")");
			return;
		}

		if (imp.getHeight() < 4) {
			IJ.error("The image is too small (ny=" + imp.getHeight() + ")");
			return;
		}

		if (imp.getStackSize() < 2) {
			IJ.error("The stack of images is too small (nz=" + imp.getStackSize() + ")");
			return;
		}

		// Color or grayscale image
		boolean color = false;
		if (imp.getType() == ImagePlus.COLOR_RGB)
			color = true;
		else if (imp.getType() == ImagePlus.GRAY8)
			color = false;
		else if (imp.getType() == ImagePlus.GRAY16)
			color = false;
		else if (imp.getType() == ImagePlus.GRAY32)
			color = false;
		else {
			IJ.error("Only process 8-bits, 16-bits, 32-bits and RGB images");
			return;
		}

		AbstractDialog dl = new AdvancedDialog(new int[]{imp.getWidth(), imp.getHeight()}, color);
		dl.pack();
		GUI.center(dl);
		dl.setVisible(true);
	}