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

Method reduce

ij/src/main/java/ij/VirtualStack.java:482–496  ·  view source on GitHub ↗

Reduces the number of slices in this stack by a factor.

(int factor)

Source from the content-addressed store, hash-verified

480
481 /** Reduces the number of slices in this stack by a factor. */
482 public void reduce(int factor) {
483 if (factor<2 || nSlices/factor<1 || names==null)
484 return;
485 nSlices = nSlices/factor;
486 for (int i=0; i<nSlices; i++) {
487 names[i] = names[i*factor];
488 if (labels != null)
489 labels[i] = labels[i*factor];
490 }
491 ImagePlus imp = WindowManager.getCurrentImage();
492 if (imp!=null) {
493 imp.setSlice(1);
494 imp.updateAndRepaintWindow();
495 }
496 }
497
498}
499

Callers 1

getReleaseStatisticsFunction · 0.45

Calls 3

getCurrentImageMethod · 0.95
setSliceMethod · 0.95

Tested by

no test coverage detected