ants.plotting.plot_directory

plot_directory(directory, recursive=False, regex='*', save_prefix='', save_suffix='', axis=None, **kwargs)[source]

Create and save an ANTsPy plot for every image matching a given regular expression in a directory, optionally recursively. This is a good function for quick visualize exploration of all of images in a directory

ANTsR function: N/A

Parameters:
  • directory (str) – directory in which to search for images and plot them

  • recursive (bool) – If true, this function will search through all directories under the given directory recursively to make plots. If false, this function will only create plots for images in the given directory

  • regex (str) – regular expression used to filter out certain filenames or suffixes

  • save_prefix (str) – sub-string that will be appended to the beginning of all saved plot filenames. Default is to add nothing.

  • save_suffix (str) – sub-string that will be appended to the end of all saved plot filenames. Default is add nothing.

  • kwargs (keyword arguments) – any additional arguments to pass onto the ants.plot function. e.g. overlay, alpha, cmap, etc. See ants.plot for more options.

Example

>>> import ants
>>> ants.plot_directory(directory='~/desktop/testdir',
                        recursive=False, regex='*')