intensity_normalization.plot package¶
Submodules¶
intensity_normalization.plot.histogram module¶
Plot histogram of the intensities of a set of images Author: Jacob Reinhold <jcreinhold@gmail.com> Created on: 02 Jun 2021
- class intensity_normalization.plot.histogram.HistogramPlotter(*, figsize: tuple[int, int] = (12, 10), alpha: float = 0.8, title: str | None = None)[source]¶
Bases:
DirectoryCLI
- classmethod from_argparse_args(args: Namespace) HistogramPlotter [source]¶
- from_directories(image_dir: intnormt.PathLike, /, mask_dir: intnormt.PathLike | None = None, *, ext: str = 'nii*', exclude: collections.abc.Sequence[str] = ('membership',), **kwargs: Any) plt.Axes [source]¶
- intensity_normalization.plot.histogram.plot_histogram(image: intnormt.ImageLike, /, mask: intnormt.ImageLike | None = None, *, ax: plt.Axes | None = None, n_bins: int = 200, log: bool = True, alpha: float = 0.8, linewidth: float = 3.0, **kwargs: Any) plt.Axes [source]¶
plots the histogram of the intensities of a numpy array within a given brain mask or estimated foreground mask (the estimate is just all intensities above the mean)
- Parameters:
image – image/array of interest
mask – mask of the foreground, if none then assume skull-stripped
ax – matplotlib ax to plot on, if none then create new ax
n_bins – number of bins to use in histogram
log – use log scale on the y-axis
alpha – value in [0,1], controls opacity of line plot
linewidth – width of line in histogram plot
kwargs – arguments to the histogram function
- Returns:
the ax the histogram is plotted on
- Return type:
ax