Skip to content
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

Improve X-ray docs #578

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Improve X-ray docs #578

wants to merge 2 commits into from

Conversation

Michael-T-McCann
Copy link
Contributor

Addresses #576. Is there a better place to put the text about world coordinates?

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 93.52%. Comparing base (308b9ea) to head (82ecd10).

Files with missing lines Patch % Lines
scico/linop/xray/astra.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   93.58%   93.52%   -0.06%     
==========================================
  Files          92       92              
  Lines        6123     6127       +4     
==========================================
  Hits         5730     5730              
- Misses        393      397       +4     
Flag Coverage Δ
unittests 93.52% <20.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


Returns:
(num_angles, 2, 4) array of homogeneous projection matrices.

"""
if angles is not None and vectors is not None:
raise ValueError("`angles` and `vectors` are mutually exclusive.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "... mutually exclusive parameters" for clarity?

angles: Array of projection angles in radians.
vectors: Array of geometry specification vectors.
angles: Array of projection angles in radians, mutually
exclusive with `vectors`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "... radians. This parameter is mutually exclusive with ...", and likewise for the line below?

Also, before "Args:", "These options are ..." would be better as "These parameters are ..."

@@ -604,12 +620,15 @@ def __init__(

if not isinstance(det_count, (list, tuple)) or len(det_count) != 2:
raise ValueError("Expected det_count to be a tuple with 2 elements.")
if angles is not None and vectors is not None:
raise ValueError("`angles` and `vectors` are mutually exclusive.")
Copy link
Collaborator

@bwohlberg bwohlberg Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "Parameters angles and vectors ..."? Also, exceptions typically go to a text console, so no point in adding markup. (Also applies to other exceptions in this PR.)

@@ -65,13 +65,18 @@ def _project_coords(
x_volume: np.ndarray, vol_geom: VolumeGeometry, proj_geom: ProjectionGeometry
) -> np.ndarray:
"""
Transform volume (logical) coordinates into world coordinates based
Project volume (logical) coordinates into detector coordinates based
Copy link
Collaborator

@bwohlberg bwohlberg Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a change of terminology from "world coordinates" to "detector coordinates"? If so, corresponding changes are required elsewhere for consistency.

Why are volume coordinates "logical"?

@@ -65,13 +65,18 @@ def _project_coords(
x_volume: np.ndarray, vol_geom: VolumeGeometry, proj_geom: ProjectionGeometry
) -> np.ndarray:
"""
Transform volume (logical) coordinates into world coordinates based
Project volume (logical) coordinates into detector coordinates based
on ASTRA geometry objects.

Args:
x_volume: (..., 3) vector(s) of volume (AKA logical) coordinates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AKA is a bit jarring. Perhaps "i.e."?

and `v` with center `d`.
and `v` with center `d`. The term ""world"" emphasizes that the
function is intended to be used on 3D coordinates representing a
point in physical space, rather than a logical index into the volume
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"logical" implies an integer index into an array?

@@ -95,7 +100,10 @@ def project_world_coordinates(
"""Project world coordinates along ray into the specified basis.

Project world coordinates along `ray` into the basis described by `u`
and `v` with center `d`.
and `v` with center `d`. The term ""world"" emphasizes that the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why double quotes on either side of "world"?

@bwohlberg
Copy link
Collaborator

... Is there a better place to put the text about world coordinates?

The discussion might work better in the module docstring at the beginning of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants