if (firstFrame<1 || firstFrame>nSlices || lastFrame<1 || lastFrame>nSlices) {
firstFrame = 1;
lastFrame = nSlices;
}
boolean start = !swin.running2;
Calibration cal = imp.getCalibration();
if (cal.fps!=0.0)
animationRate = cal.fps;
else if (cal.frameInterval!=0.0 && cal.getTimeUnit().equals("sec"))
animationRate = 1.0/cal.frameInterval;
int decimalPlaces = (int)animationRate==animationRate?0:1;
GenericDialog gd = new GenericDialog("Animation Options");
gd.addNumericField("Speed (0.1-100 fps):", animationRate, decimalPlaces);
gd.addNumericField("First Frame:", firstFrame, 0);