CorpusCallosum.utils.visualization

CorpusCallosum.utils.visualization.plot_contours(slice_or_slab, split_contours=None, midline_equidistant=None, levelpaths=None, output_path=None, ac_coords_vox=None, pc_coords_vox=None, vox2ras=None, title='')[source]

Creates a figure of the contours (shape) and the subdivisions of the corpus callosum.

Parameters:
slice_or_slabnp.ndarray

Intensities of the current slice, midslice or midslab (will plot middle slice).

split_contourslist[np.ndarray], optional

List of contour arrays for each subdivision (ignore contours on None) in upright AS coordinates each with shape (N, 2).

midline_equidistantnp.ndarray, optional

Midline points at equidistant spacing (ignore midline on None) in upright AS coordinates with shape (2, N).

levelpathslist[np.ndarray], optional

List of level paths for visualization (ignore level paths on None) in upright AS coordinates each with shape (2, N).

output_pathstr or Path or list of Paths, optional

Path to save the plot (show and do not save on None).

ac_coords_voxnp.ndarray, optional

AC coordinates for visualization (ignore AC on None) in LIA voxel coordinates.

pc_coords_voxnp.ndarray, optional

PC coordinates for visualization (ignore PC on None) in LIA voxel coordinates.

vox2rasAffineMatrix4x4, optional

Slice vox2ras transformation matrix.

titlestr, default=””

Title for the plot.

Notes

Creates a visualization of the corpus callosum contours and their subdivisions. If output_path is provided, saves the plot to that location.

CorpusCallosum.utils.visualization.plot_standardized_space(ax_row, vol, ac_coords, pc_coords)[source]

Plot standardized space visualization across three views.

Parameters:
ax_rowlist[plt.Axes]

Row of axes to plot on (should be length 3).

volnp.ndarray

Volume data to visualize.

ac_coordsnp.ndarray

AC coordinates in standardized space.

pc_coordsnp.ndarray

PC coordinates in standardized space.

Notes

Creates three views: - Axial (top view) - Sagittal (side view) - Coronal (front view)

CorpusCallosum.utils.visualization.visualize_coordinate_spaces(orig, upright, standardized, ac_coords_orig, pc_coords_orig, ac_coords_3d, pc_coords_3d, ac_coords_standardized, pc_coords_standardized, output_plot_path)[source]

Visualize the AC and PC coordinates in different coordinate spaces.

Creates a figure showing the anterior and posterior commissure points in three different coordinate spaces for testing/debugging.

Parameters:
orignibabel.Nifti1Image

Original image volume.

uprightnp.ndarray

Volume in fsaverage space.

standardizednp.ndarray

Volume in standardized space.

ac_coords_orignp.ndarray

AC coordinates in original space.

pc_coords_orignp.ndarray

PC coordinates in original space.

ac_coords_3dnp.ndarray

AC coordinates in fsaverage space.

pc_coords_3dnp.ndarray

PC coordinates in fsaverage space.

ac_coords_standardizednp.ndarray

AC coordinates in standardized space.

pc_coords_standardizednp.ndarray

PC coordinates in standardized space.

output_plot_pathstr or Path

Directory to save visualization.

Notes

Saves a visualization of the anterior (red) and posterior (blue) commisure in three different view: 1. the orig image (orig), 2. fs-average standardized image space, and 3. standardized image space as a single image named ‘ac_pc_spaces.png’ in output_dir.