Search in sources :

Example 1 with FolderOpener

use of ij.plugin.FolderOpener in project GDSC-SMLM by aherbert.

the class FolderOpenerDialog method buildImageList.

private void buildImageList() {
    String directory = path;
    if (directory == null)
        return;
    // Get a list of files
    File[] fileList = (new File(directory)).listFiles();
    if (fileList == null)
        return;
    // Exclude directories
    String[] list = new String[fileList.length];
    int c = 0;
    for (int i = 0; i < list.length; i++) if (fileList[i].isFile())
        list[c++] = fileList[i].getName();
    list = Arrays.copyOf(list, c);
    // Now exclude non-image files as per the ImageJ FolderOpener
    FolderOpener fo = new FolderOpener();
    list = fo.trimFileList(list);
    if (list == null)
        return;
    imageList = fo.sortFileList(list);
}
Also used : FolderOpener(ij.plugin.FolderOpener) File(java.io.File)

Aggregations

FolderOpener (ij.plugin.FolderOpener)1 File (java.io.File)1