-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from NicoleJurjew/PSMR_24_PET_introductory
Psmr24 pet introductory
- Loading branch information
Showing
13 changed files
with
433 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
def MLEM(acquired_data, acq_model, initial_image, num_iterations): | ||
estimated_image = initial_image.clone() | ||
sensitivity = acq_model.backward(acquired_data.get_uniform_copy(1)) | ||
for i in range(num_iterations): | ||
quotient = acquired_data/acq_model.forward(estimated_image) # y / (Ax + b) | ||
quotient.fill(numpy.nan_to_num(quotient.as_array())) | ||
mult_update = acq_model.backward(quotient)/sensitivity # A^t * quotient / A^t1 | ||
mult_update.fill(numpy.nan_to_num(mult_update.as_array())) | ||
return estimated_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
def OSEM(acquired_data, acq_model, initial_image, num_iterations): | ||
estimated_image=initial_image.clone() | ||
# some stuff here - hint, this will be similar to your solution for MLEM | ||
# but you will have to additionally iterate over your subsets | ||
for i in range(num_iterations): | ||
for s in range(acq_model.num_subsets): | ||
|
||
subs_sensitivity = acq_model.backward(acquired_data.get_uniform_copy(1), subset_num=s) | ||
|
||
quotient = acquired_data/acq_model.forward(estimated_image, subset_num=s) # y / (Ax + b) | ||
quotient.fill(numpy.nan_to_num(quotient.as_array())) | ||
|
||
mult_update = acq_model.backward(quotient, subset_num=s)/subs_sensitivity # A^t * quotient / A^t1 | ||
mult_update.fill(numpy.nan_to_num(mult_update.as_array())) | ||
|
||
estimated_image *= mult_update # update (in place) | ||
|
||
estimated_image.maximum(0) | ||
|
||
# some stuff here | ||
return estimated_image |
Oops, something went wrong.