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

dataset.py file structure enforcement and MLEM mask #209

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

jadball
Copy link
Contributor

@jadball jadball commented Feb 1, 2024

Apologies for many lines of changes, my code editor auto-linted things.
The changes to dataset.py are outlined:

  1. Added update_paths() method to DataSet class
    This function determines self.analysispath and a set of paths to directories and files such as self.pksfile and self.grainsfile
    This function is called during self.__init__() but also at the end of self.load() because the paths depend on self.sample and self.dataset which are not defined when the main load() function is called (because an empty DataSet() object is created and afterwards loaded from file).
  2. Added a default h5 file path to the self.save() and self.load() methods.
    If no h5 path is manually provided, h5name is set to self.dsfile_default which is calculated in self.update_paths()
    At the end of self.save() and self.load(), we know the file saved successfully, so we update self.dsfile equal to h5name (so we can keep track of where we saved to)

Only one actual change to roi_iradon.py :

  1. Added mask capability to MLEM function
    This mask is not given to the initial sensitivity_image iradon call because we invert the result which means dividing by zero.
    The mask is instead just applied right at the end before returning mlem_rec
    This avoids weird corner streak artifacts observed when running MLEM by 15+ iterations.

@jadball jadball requested a review from jonwright February 1, 2024 15:36
@jonwright
Copy link
Member

Looks good to me, Thanks!
For the formatting - it would be great to figure out how to add "black" as a commit hook so that this gets sorted out magically.

@jonwright jonwright merged commit 46dcfe4 into FABLE-3DXRD:master Feb 1, 2024
5 checks passed
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.

2 participants