Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Autofit a Siemens star to image for MTF calculation #80

Merged
merged 11 commits into from
Jul 13, 2022
Merged

Conversation

carterbox
Copy link
Contributor

@carterbox carterbox commented Jan 11, 2022

Instead of requiring the user to provide an phantom for compute_mtf_lwkj, autofit a phantom from given parameters.

@carterbox carterbox changed the title Siemens API: Autofit a Siemens star to image for MTF calculation Jan 11, 2022
@carterbox carterbox closed this Jul 13, 2022
@carterbox carterbox reopened this Jul 13, 2022
The n_sectors param was a little wierd because odd numbers of
blades would not be evenly spaced. This is because dark spaces
between blades were counted as blades. This fixes that and adds
a two functions to compute the spatial frequency at a given
radius or find a radius that computes a frequency.
Updating the mtf_lwkj method such that it is computed without requiring
a Phantom object as a template. This allows this function to be used on
real data with less work. There are new keywords for this function
because information needs to be supplied that was taken from the
Phantom. The frequency space is now sampled linearly.

The demo notebook has been updated with the new API.
Because:
- The number of samples could be set too low

Sampling the line at a radius with less points than PI * diameter
of the circle is insufficient to capture high frequency information
that we are tying to characterize. The number of angles is now
automatically at least PI * diameter. Technically, the smaller radii
are over sampled, but that should be fine.
Because:
  - brief code is better
  - more documentation is better

The size of the code for this MTF calcuation based on fitting a
periodic function was simplified and compresed. Documentation was
added. It should be easier to understand.
Because:
  - The Siemens Star that we are fitting is a square function
  - This prevents MTF values larger than 1

Swapped out the sin + cos function for computing the MTF by fitting a
function to the image of the Siemens star. Replaced it with a square
function from scipy.signal because this is the actual expected signal
from the image. The sine functions would cause MTF values higher than
unity because they have to be curved.
@carterbox carterbox changed the base branch from 0.5.x to 0.6.x July 13, 2022 20:26
src/xdesign/phantom/standards.py Outdated Show resolved Hide resolved
src/xdesign/phantom/standards.py Outdated Show resolved Hide resolved
src/xdesign/phantom/standards.py Outdated Show resolved Hide resolved
@carterbox carterbox marked this pull request as ready for review July 13, 2022 20:33
@carterbox carterbox merged commit bda3bdf into 0.6.x Jul 13, 2022
@carterbox carterbox deleted the siemens branch July 13, 2022 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant