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

Method run

ij/src/main/java/ij/plugin/StackReducer.java:14–34  ·  view source on GitHub ↗
(String arg)

Source from the content-addressed store, hash-verified

12 private boolean hyperstack, reduceSlices;
13
14 public void run(String arg) {
15 imp = WindowManager.getCurrentImage();
16 if (imp==null)
17 {IJ.noImage(); return;}
18 ImageStack stack = imp.getStack();
19 int size = stack.size();
20 if (size==1 || (imp.getNChannels()==size&&imp.isComposite()))
21 {IJ.error("Stack or hyperstack required"); return;}
22 if (!showDialog(stack))
23 return;
24 if (!hyperstack && (stack instanceof VirtualStack)) {
25 int previousSize = stack.size();
26 ((VirtualStack)stack).reduce(factor);
27 if (stack.size()<previousSize)
28 return;
29 }
30 if (hyperstack)
31 reduceHyperstack(imp, factor, reduceSlices);
32 else
33 reduceStack(imp, factor);
34 }
35
36 public boolean showDialog(ImageStack stack) {
37 hyperstack = imp.isHyperStack();

Callers

nothing calls this directly

Calls 11

getCurrentImageMethod · 0.95
noImageMethod · 0.95
sizeMethod · 0.95
errorMethod · 0.95
showDialogMethod · 0.95
reduceHyperstackMethod · 0.95
reduceStackMethod · 0.95
isCompositeMethod · 0.80
getStackMethod · 0.45
getNChannelsMethod · 0.45
reduceMethod · 0.45

Tested by

no test coverage detected