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

Method addSlice

ij/src/main/java/ij/plugin/StackEditor.java:30–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 void addSlice() {
31 if (imp.isHyperStack() || imp.isComposite()) {
32 addHyperstackChannelSliceOrFrame();
33 return;
34 }
35 if (!imp.lock()) return;
36 int id = 0;
37 ImageStack stack = imp.getStack();
38 if (stack.size()==1)
39 id = imp.getID();
40 ImageProcessor ip = imp.getProcessor();
41 int n = imp.getCurrentSlice();
42 if (IJ.altKeyDown()) n--; // insert in front of current slice
43 stack.addSlice(null, ip.createProcessor(width, height), n);
44 imp.setStack(null, stack);
45 imp.setSlice(n+1);
46 imp.unlock();
47 imp.changes = true;
48 if (id!=0) IJ.selectWindow(id); // prevents macros from failing
49 }
50
51 void deleteSlice() {
52 if (nSlices<2)

Callers 8

runMethod · 0.95
readMovieDataMethod · 0.45
concatMethod · 0.45
runMethod · 0.45
splitRGBMethod · 0.45
allocateArraysMethod · 0.45
analyzeMethod · 0.45
skeletonize2Method · 0.45

Calls 15

sizeMethod · 0.95
altKeyDownMethod · 0.95
addSliceMethod · 0.95
createProcessorMethod · 0.95
selectWindowMethod · 0.95
isCompositeMethod · 0.80
lockMethod · 0.80
getIDMethod · 0.80
getCurrentSliceMethod · 0.80
setStackMethod · 0.80
isHyperStackMethod · 0.45

Tested by

no test coverage detected