-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs: clarify volumetric array axis order is WHD (X,Y,Z), not HWD #8826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,19 +53,24 @@ def matshow3d( | |||||||||||||||||||||||||||||
| Create a 3D volume figure as a grid of images. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Args: | ||||||||||||||||||||||||||||||
| volume: 3D volume to display. data shape can be `BCHWD`, `CHWD` or `HWD`. | ||||||||||||||||||||||||||||||
| Higher dimensional arrays will be reshaped into (-1, H, W, [C]), `C` depends on `channel_dim` arg. | ||||||||||||||||||||||||||||||
| A list of channel-first (C, H[, W, D]) arrays can also be passed in, | ||||||||||||||||||||||||||||||
| volume: 3D volume to display. data shape can be `BCWHD`, `CWHD` or `WHD` | ||||||||||||||||||||||||||||||
| (axis 0 is columns/Width, axis 1 is rows/Height, axis 2 is Depth, matching | ||||||||||||||||||||||||||||||
| arrays returned by MONAI's NIfTI/ITK readers). | ||||||||||||||||||||||||||||||
| Higher dimensional arrays will be reshaped into (-1, spatial0, spatial1, [C]), | ||||||||||||||||||||||||||||||
| `C` depends on `channel_dim` arg. | ||||||||||||||||||||||||||||||
| A list of channel-first (C, W[, H, D]) arrays can also be passed in, | ||||||||||||||||||||||||||||||
| in which case they will be displayed as a padded and stacked volume. | ||||||||||||||||||||||||||||||
| fig: matplotlib figure or Axes to use. If None, a new figure will be created. | ||||||||||||||||||||||||||||||
| title: title of the figure. | ||||||||||||||||||||||||||||||
| figsize: size of the figure. | ||||||||||||||||||||||||||||||
| frames_per_row: number of frames to display in each row. If None, sqrt(firstdim) will be used. | ||||||||||||||||||||||||||||||
| frame_dim: for higher dimensional arrays, which dimension from (`-1`, `-2`, `-3`) is moved to | ||||||||||||||||||||||||||||||
| the `-3` dimension. dim and reshape to (-1, H, W) shape to construct frames, default to `-3`. | ||||||||||||||||||||||||||||||
| the `-3` dimension. dim and reshape to (-1, spatial0, spatial1) shape to construct frames, | ||||||||||||||||||||||||||||||
| default to `-3`. | ||||||||||||||||||||||||||||||
| channel_dim: if not None, explicitly specify the channel dimension to be transposed to the | ||||||||||||||||||||||||||||||
| last dimensionas shape (-1, H, W, C). this can be used to plot RGB color image. | ||||||||||||||||||||||||||||||
| if None, the channel dimension will be flattened with `frame_dim` and `batch_dim` as shape (-1, H, W). | ||||||||||||||||||||||||||||||
| last dimensionas shape (-1, spatial0, spatial1, C). this can be used to plot RGB color image. | ||||||||||||||||||||||||||||||
| if None, the channel dimension will be flattened with `frame_dim` and `batch_dim` as | ||||||||||||||||||||||||||||||
| shape (-1, spatial0, spatial1). | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix docstring typos in Line 68 and Line 71 have wording issues ( Proposed doc fix- frame_dim: for higher dimensional arrays, which dimension from (`-1`, `-2`, `-3`) is moved to
- the `-3` dimension. dim and reshape to (-1, spatial0, spatial1) shape to construct frames,
+ frame_dim: for higher dimensional arrays, which dimension from (`-1`, `-2`, `-3`) is moved to
+ the `-3` dimension, then reshaped to (-1, spatial0, spatial1) to construct frames,
default to `-3`.
channel_dim: if not None, explicitly specify the channel dimension to be transposed to the
- last dimensionas shape (-1, spatial0, spatial1, C). this can be used to plot RGB color image.
+ last dimension as shape (-1, spatial0, spatial1, C). this can be used to plot RGB color image.As per coding guidelines, "Review the Python code for quality and correctness... Suggest any enhancements for code improving ... comprehensibility." 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| note that it can only support 3D input image. default is None. | ||||||||||||||||||||||||||||||
| vmin: `vmin` for the matplotlib `imshow`. | ||||||||||||||||||||||||||||||
| vmax: `vmax` for the matplotlib `imshow`. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct axis-index wording for
inputsshape[1, C, W, H, D].Line 48-Line 50 currently state axis 0/1/2 as Width/Height/Depth, but for this tensor axis 0 is batch and axis 1 is channel. Please describe spatial axes explicitly.
Proposed doc fix
As per coding guidelines, "Docstrings should be present for all definition which describe each variable...," which includes correct axis semantics.
🤖 Prompt for AI Agents