Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alessandro Felder <[email protected]>
  • Loading branch information
niksirbi and alessandrofelder authored Oct 28, 2024
1 parent a0aed25 commit 3a0102d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion brainglobe_template_builder/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def plot_orthographic(
slices_list = list(show_slices)

# Pad the image with zeros to make it cubic
# so projections along different axes have the same size
img, pad_sizes = _pad_with_zeros(img, target=max(img.shape))
slices_list = [s + pad_sizes[i] for i, s in enumerate(slices_list)]

Expand Down Expand Up @@ -97,6 +98,9 @@ def plot_grid(
**kwargs,
) -> tuple[plt.Figure, np.ndarray]:
"""Plot image volume as a grid of slices along a given anatomical section.
Image contrast is auto-adjusted to 1-99% of range unless `vmin` and `vmax` are specified
as keyword arguments.
Parameters
----------
Expand All @@ -110,7 +114,8 @@ def plot_grid(
by default "frontal".
n_slices : int, optional
Number of slices to show, by default 12. Slices will be evenly spaced,
starting from the first and ending with the last slice.
starting from the first and ending with the last slice. If a higher value
than the number of slices in the image is chosen, all slices are shown.
save_path : Path, optional
Path to save the plot, by default None (no saving).
**kwargs
Expand Down

0 comments on commit 3a0102d

Please sign in to comment.