Skip to content

Commit

Permalink
use CUDARDP if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisThielemans committed Jul 10, 2024
1 parent 8437da1 commit 821a868
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion petric.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def construct_RDP(penalty_strength, initial_image, kappa, max_scaling=1e-3):
initial_image: used to determine a smoothing factor (epsilon).
kappa: used to pass voxel-dependent weights.
"""
prior = STIR.RelativeDifferencePrior()
try:
prior = STIR.CudaRelativeDifferencePrior()
except:
prior = STIR.RelativeDifferencePrior()

# need to make it differentiable
epsilon = initial_image.max() * max_scaling
prior.set_epsilon(epsilon)
Expand Down

0 comments on commit 821a868

Please sign in to comment.