MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setSlice

Method setSlice

ij/src/main/java/ij/plugin/Animator.java:369–399  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 }
368
369 void setSlice() {
370 if (imp.isDisplayedHyperStack()) {
371 GenericDialog gd = new GenericDialog("Set Position");
372 int c = imp.getChannel();
373 int z = imp.getSlice();
374 int t = imp.getFrame();
375 gd.addNumericField("Channel:", c);
376 gd.addNumericField("Slice:", z);
377 gd.addNumericField("Frame:", t);
378 gd.showDialog();
379 if (!gd.wasCanceled()) {
380 c = (int) gd.getNextNumber();
381 z = (int) gd.getNextNumber();
382 t = (int) gd.getNextNumber();
383 imp.setPosition(c, z, t);
384 }
385 if (IJ.recording()) {
386 String method = Recorder.scriptMode()?"imp":"Stack";
387 Recorder.recordString(method+".setPosition("+c+","+z+","+t+");\n");
388 Recorder.disableCommandRecording();
389 }
390 } else {
391 GenericDialog gd = new GenericDialog("Set Slice");
392 gd.addNumericField("Slice (1-"+nSlices+"):", slice, 0);
393 gd.showDialog();
394 if (!gd.wasCanceled()) {
395 int slice = (int)gd.getNextNumber();
396 imp.setSlice(slice);
397 }
398 }
399 }
400
401 /** Returns the current animation speed in frames per second. */
402 public static double getFrameRate() {

Callers 15

runMethod · 0.95
straightenStackMethod · 0.45
getZAxisProfileMethod · 0.45
dialogItemChangedMethod · 0.45
addSliceMethod · 0.45
deleteSliceMethod · 0.45
straightenRotatedRectMethod · 0.45
runMethod · 0.45
convertStackMethod · 0.45
convertToByteMethod · 0.45
arrangeWindowsMethod · 0.45
mouseDraggedMethod · 0.45

Calls 13

addNumericFieldMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextNumberMethod · 0.95
recordingMethod · 0.95
scriptModeMethod · 0.95
recordStringMethod · 0.95
isDisplayedHyperStackMethod · 0.80
getChannelMethod · 0.65
getFrameMethod · 0.65
getSliceMethod · 0.45

Tested by

no test coverage detected