Skip to content

Commit

Permalink
Phase contribution (#1737)
Browse files Browse the repository at this point in the history
Add Paganin phase retrieval methods

Signed-off-by: Hannah Robarts <[email protected]>
Co-authored-by: Jakob Sauer Jørgensen <[email protected]>
  • Loading branch information
hrobarts and jakobsj authored Jul 16, 2024
1 parent 23e3c05 commit 48d89c9
Show file tree
Hide file tree
Showing 7 changed files with 934 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- New Features:
- Added method to plot filter in `GenericFilteredBackProjection` (#1667)
- Added wavelet operator, wrapping PyWavelets operator as a CIL operator (#1618)
- Added PaganinProcessor processor, to perform phase retrieval from phase contrast images (#1737)
- Added L1Sparsity function, allowing calculations of `|Ax-b|_1` and its proximal, in the case of orthogonal operators, `A` (#1618)
- Options in algorithms GD, ISTA and FISTA to pass a `cil.optimisation.utilities.StepSizeRule` or a `cil.optimisation.utilities.Preconditioner`(#1768)
- an implementation of the Armijo Rule as a child class of `cil.optimisation.utilities.StepSizeRule` (#1768)
Expand Down
34 changes: 32 additions & 2 deletions Wrappers/Python/cil/framework/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,22 @@ def get_centre_slice(self):
return self

def calculate_magnification(self):
return [None, None, 1.0]
'''Method to calculate magnification and distance from the sample to
the detector using the detector positions and the rotation axis.
For parallel beam geometry magnification = 1
Returns
-------
list
A list containing the [0] distance from the source to the rotate
axis, [1] distance from the rotate axis to the detector,
[2] magnification of the system
'''
ab = (self.rotation_axis.position - self.detector.position)
dist_center_detector = float(numpy.sqrt(ab.dot(ab)))

return [None, dist_center_detector, 1.0]

class Parallel3D(SystemConfiguration):
r'''This class creates the SystemConfiguration of a parallel beam 3D tomographic system
Expand Down Expand Up @@ -1116,7 +1131,22 @@ def __eq__(self, other):
return False

def calculate_magnification(self):
return [None, None, 1.0]
'''Method to calculate magnification and distance from the sample to
the detector using the detector positions and the rotation axis.
For parallel beam geometry magnification = 1
Returns
-------
list
A list containing the [0] distance from the source to the rotate
axis, [1] distance from the rotate axis to the detector,
[2] magnification of the system
'''
ab = (self.rotation_axis.position - self.detector.position)
dist_center_detector = float(numpy.sqrt(ab.dot(ab)))

return [None, dist_center_detector, 1.0]

def get_centre_slice(self):
"""Returns the 2D system configuration corresponding to the centre slice
Expand Down
Loading

0 comments on commit 48d89c9

Please sign in to comment.