Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindkilleen authored Oct 5, 2022
1 parent 11dceab commit 74a2649
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,21 @@ The following minimal example loads a CT volume from a NifTi `.nii.gz` file and
```python
from deepdrr import geo, Volume, MobileCArm
from deepdrr.projector import Projector # separate import for CUDA init
import matplotlib.pyplot as plt

volume = Volume.from_nifti('/path/to/ct_image.nii.gz')
carm = MobileCArm()
carm.reposition(volume.center_in_world)

with Projector(volume, carm=carm) as projector:
ct = Volume.from_nifti('/path/to/ct_image.nii.gz')

# Initialize the Projector object (allocates GPU memory)
with Projector(ct, carm=carm) as projector:
# Orient and position the patient model in world space.
ct.orient_patient(head_first=True, supine=True)
ct.place_center(carm.isocenter_in_world)

# Move the C-arm to the desired pose.
carm.move_to(alpha=30, beta=10, degrees=True)
projection = projector()

plt.imshow(projection, cmap='gray')
plt.show()

# Run projection
image = projector()
```

The script `example_projector.py` gives an alternative example. Additional tutorials are in progress at [deepdrr.readthedocs.io](https://deepdrr.readthedocs.io). Contributions are welcome.
Expand Down

0 comments on commit 74a2649

Please sign in to comment.