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

Method deleteSlice

ij/src/main/java/ij/VirtualStack.java:191–207  ·  view source on GitHub ↗

Deletes the specified slice, where {@literal 1<=n<=nslices}.

(int n)

Source from the content-addressed store, hash-verified

189
190 /** Deletes the specified slice, where {@literal 1<=n<=nslices}. */
191 public void deleteSlice(int n) {
192 if (nSlices==0)
193 return;
194 if (n<1 || n>nSlices)
195 throw new IllegalArgumentException("Argument out of range: "+n);
196 if (names==null)
197 throw new IllegalArgumentException("This Virtual Stack cannot be modified [VirtualStack(w,h,cm,path) constructor not used]");
198 if (isTranslatingIndices())
199 throw new IllegalArgumentException("Virtual hyperstack with non-czt order cannot be modified");
200 for (int i=n; i<nSlices; i++)
201 names[i-1] = names[i];
202 names[nSlices-1] = null;
203 if (labels != null)
204 for (int i=n; i<nSlices; i++)
205 labels[i-1] = labels[i];
206 nSlices--;
207 }
208
209 /** Deletes the last slice in the stack. */
210 public void deleteLastSlice() {

Callers 1

deleteLastSliceMethod · 0.95

Calls 1

isTranslatingIndicesMethod · 0.95

Tested by

no test coverage detected