Skip to content

Commit

Permalink
Tweak motion quality reduction formula
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Dec 27, 2021
1 parent cab366d commit 465b2b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miqa/learning/nn_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def apply_transform(self, subject: torchio.Subject) -> torchio.Subject:

# now determine how much quality was reduced
applied_params = transformed_subject.applied_transforms[-1][1]
times = applied_params['times']['img']
time = applied_params['times']['img']
degrees = np.sum(np.absolute(applied_params['degrees']['img']))
translation = np.sum(np.absolute(applied_params['translation']['img']))
# motion earlier in the acquisition process produces more noticeable artifacts
quality_reduction = clamp(degrees + translation, 0, 10) * (1.0 - times)
quality_reduction = clamp(degrees + translation, 0, 10) * min(time, 1.0 - time)

# update the ground truth information
new_quality = original_quality - quality_reduction
Expand Down

0 comments on commit 465b2b7

Please sign in to comment.