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

Method addSlice

ij/src/main/java/ij/ImageStack.java:62–81  ·  view source on GitHub ↗

Adds an image in the form of a pixel array to the end of the stack.

(String sliceLabel, Object pixels)

Source from the content-addressed store, hash-verified

60
61 /** Adds an image in the form of a pixel array to the end of the stack. */
62 public void addSlice(String sliceLabel, Object pixels) {
63 if (pixels==null)
64 throw new IllegalArgumentException("'pixels' is null!");
65 if (!pixels.getClass().isArray())
66 throw new IllegalArgumentException("'pixels' is not an array");
67 int size = stack.length;
68 nSlices++;
69 if (nSlices>=size) {
70 Object[] tmp1 = new Object[size*2];
71 System.arraycopy(stack, 0, tmp1, 0, size);
72 stack = tmp1;
73 String[] tmp2 = new String[size*2];
74 System.arraycopy(label, 0, tmp2, 0, size);
75 label = tmp2;
76 }
77 stack[nSlices-1] = pixels;
78 this.label[nSlices-1] = sliceLabel;
79 if (this.bitDepth==0)
80 setBitDepth(pixels);
81 }
82
83 private void setBitDepth(Object pixels) {
84 if (pixels==null)

Callers 15

setImageMethod · 0.95
getStackMethod · 0.95
getRGBStackMethod · 0.95
addUnsignedShortSliceMethod · 0.95
createMethod · 0.95
cropMethod · 0.95
convertToFloatMethod · 0.95
convertToRealStackMethod · 0.95
reduceStackMethod · 0.95
reduceHyperstackMethod · 0.95
convertMethod · 0.95
mergeHyperstacksMethod · 0.95

Calls 12

setBitDepthMethod · 0.95
convertTypeMethod · 0.95
initMethod · 0.95
insertMethod · 0.95
arraycopyMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
createProcessorMethod · 0.45
getColorModelMethod · 0.45
getMinMethod · 0.45
getMaxMethod · 0.45
getPixelsMethod · 0.45

Tested by

no test coverage detected