Deletes the specified slice, where {@literal 1<=n<=nslices}.
(int n)
| 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() { |
no test coverage detected