Skip to content

Commit

Permalink
Cleanup tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Aug 14, 2023
1 parent ed30621 commit 1f95c9c
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 62 deletions.
2 changes: 1 addition & 1 deletion diffdrr/siddon.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def siddon_raycast(
spacing: torch.Tensor,
eps: float = 1e-8,
):
"""Compute Siddon's method."""
"""An auto-differentiable implementation of the raycasting algorithm known as Siddon's method."""
dims = torch.tensor(volume.shape) + 1
alphas, maxidx = _get_alphas(source, target, spacing, dims, eps)
alphamid = (alphas[..., 0:-1] + alphas[..., 1:]) / 2
Expand Down
2 changes: 1 addition & 1 deletion notebooks/api/01_siddon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
" spacing: torch.Tensor,\n",
" eps: float=1e-8,\n",
"):\n",
" \"\"\"Compute Siddon's method.\"\"\"\n",
" \"\"\"An auto-differentiable implementation of the raycasting algorithm known as Siddon's method.\"\"\"\n",
" dims = torch.tensor(volume.shape) + 1\n",
" alphas, maxidx = _get_alphas(source, target, spacing, dims, eps)\n",
" alphamid = (alphas[..., 0:-1] + alphas[..., 1:]) / 2\n",
Expand Down
12 changes: 11 additions & 1 deletion notebooks/tutorials/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,17 @@
"source": [
"### Sparse rendering\n",
"\n",
"You can also render random sparse subsets of the pixels in a DRR. This is useful for speeding up registration tasks."
"You can also render random sparse subsets of the pixels in a DRR."
]
},
{
"cell_type": "raw",
"id": "296277be-6b59-4f77-b846-b1521d300221",
"metadata": {},
"source": [
"::: {.callout-tip}\n",
"Sparse DRR rendering can be useful in registration and reconstruction tasks when coupled with a pixel-wise loss, such as MSE.\n",
":::"
]
},
{
Expand Down
203 changes: 145 additions & 58 deletions notebooks/tutorials/optimizers.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/tutorials/timing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"height = 100\n",
"\n",
"drr = DRR(volume, spacing, sdr=300.0, height=height, delx=4.0).to(device)\n",
"%timeit drr(rotations, translations)\n",
"!%timeit drr(rotations, translations)\n",
"del drr"
]
},
Expand Down

0 comments on commit 1f95c9c

Please sign in to comment.