Module ij
Package ij.plugin

# Class FolderOpener

java.lang.Object
ij.plugin.FolderOpener

All Implemented Interfaces:
  `PlugIn`, `TextListener`, `EventListener`

public class FolderOpener extends Object implements PlugIn, TextListener
Implements the File/Import/Image Sequence command, which opens a folder of images as a stack.

## Constructor Summary

Constructors
Constructor
Description
`FolderOpener()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`containsRegex(String name, String regex, boolean legacy)`
`static boolean`
`excludedFileType(String name)`
`static String[]`
`getFilteredList(String[] list, String filter, String title)`
`static ImagePlus`
`open(String path)`
Opens the images in the specified directory as a stack.
`static ImagePlus`
`open(String path, int width, int height, String options)`
Opens the images in the specified directory as a widthxheight stack.
`static ImagePlus`
`open(String path, String options)`
Opens the images in the specified directory as a stack.
`void`
`openAsVirtualStack(boolean b)`
`ImagePlus`
`openFolder(String path)`
Opens the images in the specified directory as a stack.
`void`
`run(String arg)`
This method is called when the plugin is loaded.
`void`
`setDirectory(String path)`
Used by DragAndDrop when a directory is dragged onto the ImageJ window.
`void`
`sortByMetaData(boolean b)`
`String[]`
`sortFileList(String[] list)`
Sorts file names containing numerical components.
`void`
`sortFileNames(boolean b)`
`void`
`textValueChanged(TextEvent e)`
`String[]`
`trimFileList(String[] rawlist)`
Removes names that start with "." or end with ".db", ".txt", ".lut", "roi", ".pty", ".hdr", ".py", etc.
`static String`
`trimTitle(String title)`
`static boolean`
`useInfo(String info)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### FolderOpener

public FolderOpener()

## Method Details

### open

public static ImagePlus open(String path)
Opens the images in the specified directory as a stack. Displays directory chooser and options dialogs if the argument is null.

### open

public static ImagePlus open(String path, String options)
Opens the images in the specified directory as a stack. Opens the images as a virtual stack if the 'options' string contains 'virtual' or 'use'. Add ' filter=abc' to the options string to only open images with, for example, 'abc' in their name. The image type, start, step, count and scale can also be set, for example "bitdepth=32 start=10 step=2 count=10 scale=50". Add ' noMetaSort' to disable sorting of DICOM stacks by series number (0020,0011). Displays the Import/Sequence dialog if the the 'path' argument is null.

### open

public static ImagePlus open(String path, int width, int height, String options)
Opens the images in the specified directory as a widthxheight stack. Opens the images as a virtual stack if the 'options' string contains 'virtual'. Add ' filter=abc' to the options string to only open images with, for example, 'abc' in their name. The image type, start, step, count and scale can also be set, for example "bitdepth=32 start=10 step=2 count=10 scale=50".

### openFolder

public ImagePlus openFolder(String path)
Opens the images in the specified directory as a stack. Displays directory chooser and options dialogs if the argument is null.

### run

public void run(String arg)
Description copied from interface: `PlugIn`
This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.

Specified by:
  `run` in interface `PlugIn`

### trimTitle

public static String trimTitle(String title)

### useInfo

public static boolean useInfo(String info)

### getFilteredList

public static String[] getFilteredList(String[] list, String filter, String title)

### containsRegex

public static boolean containsRegex(String name, String regex, boolean legacy)

### trimFileList

public String[] trimFileList(String[] rawlist)
Removes names that start with "." or end with ".db", ".txt", ".lut", "roi", ".pty", ".hdr", ".py", etc.

### excludedFileType

public static boolean excludedFileType(String name)

### openAsVirtualStack

public void openAsVirtualStack(boolean b)

### sortFileNames

public void sortFileNames(boolean b)

### sortByMetaData

public void sortByMetaData(boolean b)

### setDirectory

public void setDirectory(String path)
Used by DragAndDrop when a directory is dragged onto the ImageJ window.

### sortFileList

public String[] sortFileList(String[] list)
Sorts file names containing numerical components.

See Also:
  - `Author: Norbert Vischer`

### textValueChanged

public void textValueChanged(TextEvent e)

Specified by:
  `textValueChanged` in interface `TextListener`