Adds an image to the end of a virtual stack created using the VirtualStack(w,h,cm,path) constructor. The argument can be a full file path (e.g., "C:/Users/wayne/dir1/image.tif") if the 'path' argument in the constructor is "". File names that start with '.' are ignored.
(String fileName)
| 87 | * that start with '.' are ignored. |
| 88 | */ |
| 89 | public void addSlice(String fileName) { |
| 90 | if (fileName==null) |
| 91 | throw new IllegalArgumentException("'fileName' is null!"); |
| 92 | if (fileName.startsWith(".")) |
| 93 | return; |
| 94 | if (names==null) |
| 95 | throw new IllegalArgumentException("This Virtual Stack cannot be modified [VirtualStack(w,h,cm,path) constructor not used]"); |
| 96 | if (isTranslatingIndices()) |
| 97 | throw new IllegalArgumentException("Virtual hyperstack with non-czt order cannot be modified"); |
| 98 | nSlices++; |
| 99 | expandArrays(nSlices); |
| 100 | names[nSlices-1] = fileName; |
| 101 | } |
| 102 | |
| 103 | /** Expands the 'names' and 'labels' arrays if existing and smaller than minSize. |
| 104 | * This should be called each time the stack is enlarged */ |
no test coverage detected