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

Method previousSlice

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

Source from the content-addressed store, hash-verified

301 }
302
303 void previousSlice() {
304 boolean hyperstack = imp.isDisplayedHyperStack();
305 int channels = imp.getNChannels();
306 int slices = imp.getNSlices();
307 int frames = imp.getNFrames();
308 if (hyperstack && channels>1 && !((slices>1||frames>1)&&(IJ.controlKeyDown()||IJ.spaceBarDown()||IJ.altKeyDown()))) {
309 int c = imp.getChannel() - 1;
310 if (c<1) c = 1;
311 swin.setPosition(c, imp.getSlice(), imp.getFrame());
312 } else if (hyperstack && slices>1 && !(frames>1&&IJ.altKeyDown())) {
313 int z = imp.getSlice() - 1;
314 if (z<1) z = 1;
315 swin.setPosition(imp.getChannel(), z, imp.getFrame());
316 } else if (hyperstack && frames>1) {
317 int t = imp.getFrame() - 1;
318 if (t<1) t = 1;
319 swin.setPosition(imp.getChannel(), imp.getSlice(), t);
320 } else {
321 if (IJ.altKeyDown())
322 slice -= 10;
323 else
324 slice--;
325 if (slice<1)
326 slice = 1;
327 swin.showSlice(slice);
328 }
329 imp.updateStatusbarValue();
330 }
331
332 void changeSlice(int pn) {
333 boolean hyperstack = imp.isDisplayedHyperStack();

Callers 1

runMethod · 0.95

Calls 13

controlKeyDownMethod · 0.95
spaceBarDownMethod · 0.95
altKeyDownMethod · 0.95
isDisplayedHyperStackMethod · 0.80
getNSlicesMethod · 0.80
getNFramesMethod · 0.80
updateStatusbarValueMethod · 0.80
getChannelMethod · 0.65
getFrameMethod · 0.65
getNChannelsMethod · 0.45
setPositionMethod · 0.45
getSliceMethod · 0.45

Tested by

no test coverage detected