maps
maps
¶
Parameter map visualization functions.
This module provides functions for visualizing perfusion parameter maps.
NO scipy dependency - uses numpy for linear regression.
plot_parameter_map
¶
plot_parameter_map(
parameter_map,
slice_idx=None,
axis=2,
orientation=None,
title=None,
colormap="viridis",
cmap=None,
vmin=None,
vmax=None,
mask=None,
show_mask=False,
show_colorbar=True,
underlay=None,
alpha=1.0,
ax=None,
figsize=(8, 6),
)
Plot a 2D slice of a parameter map.
| PARAMETER | DESCRIPTION |
|---|---|
parameter_map
|
Parameter map to visualize.
TYPE:
|
slice_idx
|
Slice index to display. If None, uses middle slice.
TYPE:
|
axis
|
Axis perpendicular to the slice (0, 1, or 2).
TYPE:
|
orientation
|
Orientation name: "axial", "coronal", or "sagittal". If provided, overrides axis parameter.
TYPE:
|
title
|
Plot title. Uses parameter name if not provided.
TYPE:
|
colormap
|
Matplotlib colormap name.
TYPE:
|
cmap
|
Alias for colormap (for compatibility).
TYPE:
|
vmin
|
Color scale limits.
TYPE:
|
vmax
|
Color scale limits.
TYPE:
|
mask
|
Mask to apply (show only masked region).
TYPE:
|
show_mask
|
Whether to show quality mask from ParameterMap.
TYPE:
|
show_colorbar
|
Whether to show colorbar.
TYPE:
|
underlay
|
Anatomical underlay image.
TYPE:
|
alpha
|
Transparency for overlay (when underlay is provided).
TYPE:
|
ax
|
Axes to plot on. Creates new figure if None.
TYPE:
|
figsize
|
Figure size if creating new figure.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure or Axes
|
The figure or axes with the plot. |
| RAISES | DESCRIPTION |
|---|---|
ImportError
|
If matplotlib is not available. |
plot_parameter_comparison
¶
plot_parameter_comparison(
*maps_args,
maps=None,
slice_idx=None,
axis=2,
colormap="viridis",
figsize=None,
)
Plot multiple parameter maps side by side.
| PARAMETER | DESCRIPTION |
|---|---|
*maps_args
|
Parameter maps to compare (positional arguments).
TYPE:
|
maps
|
List of parameter maps (alternative to positional args).
TYPE:
|
slice_idx
|
Slice index to display.
TYPE:
|
axis
|
Slice axis.
TYPE:
|
colormap
|
Colormap name.
TYPE:
|
figsize
|
Figure size.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
The figure with the plots. |
create_montage
¶
Create a montage of all slices in a 3D volume.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
3D data volume.
TYPE:
|
n_cols
|
Number of columns in montage.
TYPE:
|
colormap
|
Colormap name.
TYPE:
|
vmin
|
Color limits.
TYPE:
|
vmax
|
Color limits.
TYPE:
|
figsize
|
Figure size.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
The figure with the montage. |