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 frame-wise displacement data.

Plots the frame-wise displacement data corresponding to different realizations.

Parameters:
  • fd (DataFrame) – Frame-wise displacement values corresponding.

  • labels (list) – Labels for legend.

  • cmap_name (str, optional) – Colormap name.

  • ax (Axes, optional) – Figure axes.

Returns:

ax – Figure plot axis.

Return type:

Axes

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 as an overlay 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 be plot.

  • smooth (bool, optional) – True to 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`, and z axes.

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 axis x, y`, and z. Translation parameters are followed by rotation parameters column-wise.

  • ax (ndarray, optional) – Figure axes.

Returns:

ax – Figure plot axes array.

Return type:

ndarray