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

Method expandArrays

ij/src/main/java/ij/VirtualStack.java:105–118  ·  view source on GitHub ↗

Expands the 'names' and 'labels' arrays if existing and smaller than minSize. This should be called each time the stack is enlarged

(int minSize)

Source from the content-addressed store, hash-verified

103 /** Expands the 'names' and 'labels' arrays if existing and smaller than minSize.
104 * This should be called each time the stack is enlarged */
105 protected void expandArrays(int minSize) {
106 if (indexes != null && minSize < indexes.length)
107 minSize = indexes.length; //min size if slices were deleted previously
108 if (names != null && names.length < minSize) {
109 String[] tmp = new String[minSize*2];
110 System.arraycopy(names, 0, tmp, 0, names.length);
111 names = tmp;
112 }
113 if (labels != null && labels.length < minSize) {
114 String[] tmp = new String[minSize*2];
115 System.arraycopy(labels, 0, tmp, 0, labels.length);
116 labels = tmp;
117 }
118 }
119
120 /** Does nothing. */
121 public void addSlice(String sliceLabel, Object pixels) {

Callers 2

addSliceMethod · 0.95
setSliceLabelMethod · 0.95

Calls 1

arraycopyMethod · 0.45

Tested by

no test coverage detected