Skip to content

Commit

Permalink
Merge pull request #116 from HiPCTProject/codspell
Browse files Browse the repository at this point in the history
Fix spelling mistakes
  • Loading branch information
dstansby authored Jun 27, 2024
2 parents a2799e1 + 373b872 commit 71ccbed
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [--write-changes]
exclude: src/hipct_reg/reg_inventory.csv
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This provides a starting point for the registration code.

Initial rotational registration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first step of the automated pipeline finds the approximate relative rotation about the z-axis betweeen the two datasets.
The first step of the automated pipeline finds the approximate relative rotation about the z-axis between the two datasets.
It does this by fixing the centre of rotation at the common point identified in both datasets, and then:

1. Scanning through the whole 0 - 360 degree angle range at a resolution of 2 degrees, and identifying the best match.
Expand Down
2 changes: 1 addition & 1 deletion docs/new_datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ will be shown in three panels, which show:
2. The registered ROI dataset (in the registered coordinates).
3. The original full-organ dataset.

Compare panels 2 and 3. If the reigstration looks good, hit the "Good" button
Compare panels 2 and 3. If the registration looks good, hit the "Good" button
and the registration parameters will be save to the registration inventory.
If the registration looks bad, type a reason in the notes text entry and
hit the "Bad" button. This will save the notes in the registration inventory.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
transform, reg_metric = run_registration(reg_input)

# %%
# This resturns two objects - the registered transform, and the registration metric.
# This returns two objects - the registered transform, and the registration metric.
# The transform maps from the physical coordinates of the ROI image to the physical
# coordinates of the full-organ image. For HiP-CT data these are just the voxel
# coordinates multiplied by the image resolution.
Expand Down
2 changes: 1 addition & 1 deletion notebooks/plot_size_xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_rot(df: pd.DataFrame) -> float:

# %% [markdown]
# ## Context
# The goal of this experiement is to verify the variation in registration parameters (rotation, translation, scale) as the size of the cuboids being registered increases. This should show at what point the registration converges (ie at what point adding more pixels isn't adding anything to the registration).
# The goal of this experiment is to verify the variation in registration parameters (rotation, translation, scale) as the size of the cuboids being registered increases. This should show at what point the registration converges (ie at what point adding more pixels isn't adding anything to the registration).
#
# ## Figure overview
# Each registration parameter (y-axis) is plotted against the size of the full-organ cuboid in the x-y plane. All cuboids have a thickness along the z-axis of 32 pixels. The high-resolution ROI cuboids have a larger number of pixels so they are the same physical size as the full-organ cuboids. Each colour represents a different dataset, taken from three different organs.
Expand Down
6 changes: 3 additions & 3 deletions notebooks/sitk_transfroms.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# - The pixel spacing in physical distance units.
# - The physical coordinate of the (0, 0) pixel.
#
# Here we put the raw data array into an `Image`, but for now leave the spacing and origin as default values. We also define a helper funciton to plot an `Image`, which we'll use throughout this notebook to understand what's going on.
# Here we put the raw data array into an `Image`, but for now leave the spacing and origin as default values. We also define a helper function to plot an `Image`, which we'll use throughout this notebook to understand what's going on.


# %%
Expand Down Expand Up @@ -79,7 +79,7 @@ def show_image(image: sitk.Image, ax: matplotlib.axes.Axes, **imshow_kwargs):
ax.set_title("Full resolution image")

# %% [markdown]
# To start with we'll just try registring a cut out of this image to the full image. This will illustrate how the translation element of transformations works.
# To start with we'll just try registering a cut out of this image to the full image. This will illustrate how the translation element of transformations works.

# %%
offset_cutout = (150, 100)
Expand Down Expand Up @@ -159,7 +159,7 @@ def get_reg_method() -> sitk.ImageRegistrationMethod:


# %% [markdown]
# Now we can get an instance of the registration method, and set the initial transform. In order to avoid changing the scaling or rotation angle during optimization we set the optimizer weights for these paramters to zero.
# Now we can get an instance of the registration method, and set the initial transform. In order to avoid changing the scaling or rotation angle during optimization we set the optimizer weights for these parameters to zero.
#
# Then we run the registration, and check the results...

Expand Down
2 changes: 1 addition & 1 deletion src/hipct_reg/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def get_reg_input(
The size of the full-organ scan cube can be changed.
Data is cahed on disk to ~/hipct/reg_data so it doesn't need to be re-downloaded.
Data is cached on disk to ~/hipct/reg_data so it doesn't need to be re-downloaded.
"""
full_dataset = datasets[full_name]
assert (
Expand Down
4 changes: 2 additions & 2 deletions src/hipct_reg/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class PixelTransformDict(TypedDict):
"""
Parameters for a pixel-to-pixel transfrom, mapping from a ROI to a full-organ
Parameters for a pixel-to-pixel transform, mapping from a ROI to a full-organ
image.
"""

Expand All @@ -29,7 +29,7 @@ def get_pixel_transform_params(
coord_transform: sitk.Similarity3DTransform,
) -> PixelTransformDict:
"""
Convert the registered transform to a pixel-to-pixel transfrom mapping from a ROI
Convert the registered transform to a pixel-to-pixel transform mapping from a ROI
to a full-organ image.
"""
translation = coord_transform.TransformPoint((0, 0, 0))
Expand Down
6 changes: 3 additions & 3 deletions src/hipct_reg/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def registration_rigid(
"""
Run a registration using a full rigid transform.
The returned transform maps from the ROI iamge to the full-organ image.
The returned transform maps from the ROI image to the full-organ image.
Parameters
----------
Expand All @@ -155,7 +155,7 @@ def registration_rigid(
Returns
-------
transform :
Registered transform from ROI iamge to the full-organ image.
Registered transform from ROI image to the full-organ image.
metric :
Registration metric at the final step. The registration metric is
Expand Down Expand Up @@ -276,7 +276,7 @@ def run_registration(
Returns
-------
transform :
Registered transform from ROI iamge to the full-organ image.
Registered transform from ROI image to the full-organ image.
metric :
Registration metric at the final step. The registration metric is
Expand Down

0 comments on commit 71ccbed

Please sign in to comment.