nifreeze.viz.motion_viz module¶
- nifreeze.viz.motion_viz.plot_framewise_displacement(fd: DataFrame, labels: list, cmap_name: str = 'viridis', ax: matplotlib.axes.Axes | None = None) matplotlib.axes.Axes[source]¶
Plot framewise displacement data.
Plots the framewise displacement data corresponding to different realizations.
- nifreeze.viz.motion_viz.plot_motion_overlay(rel_diff: ndarray, img_data: ndarray, brain_mask: ndarray, orientation: str, slice_idx: int, smooth: bool = True, ax: matplotlib.axes.Axes | None = None) matplotlib.axes.Axes[source]¶
Plot motion relative difference on a given orientation and slice of the imaging data.
The values of the relative difference can optionally be smoothed using a Gaussian filter for a more appealing visual result.
- Parameters:
rel_diff (
ndarray) – Relative motion difference.img_data (
ndarray) – Imaging data.brain_mask (
ndarray) – Brain mask.orientation (
str) – Orientation. Can be one of obj:ORIENTATIONS.slice_idx (
int) – Slice index to plot.smooth (
bool, optional) –Trueto smooth the motion relative difference.ax (
Axes, optional) – Figure axis.
- Returns:
ax – Figure plot axis.
- Return type:
Axes
- nifreeze.viz.motion_viz.plot_volumewise_motion(frames: ndarray, motion_params: ndarray, ax: ndarray | None = None) ndarray[source]¶
Plot mean volume-wise motion parameters.
Plots the mean translation and rotation parameters along the
x,y, andzaxes.- Parameters:
frames (
ndarray) – Frame indices.motion_params (
ndarray) – Motion parameters.Motion parameters: translation and rotation. Each row represents one frame, and columns represent each coordinate axisx,y, andz. Translation parameters are followed by rotation parameters column-wise.ax (
ndarray, optional) – Figure axes.
- Returns:
ax – Figure plot axes array.
- Return type: