dataset.py file structure enforcement and MLEM mask #209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies for many lines of changes, my code editor auto-linted things.
The changes to
dataset.py
are outlined:update_paths()
method toDataSet
classThis function determines
self.analysispath
and a set of paths to directories and files such asself.pksfile
andself.grainsfile
This function is called during
self.__init__()
but also at the end ofself.load()
because the paths depend onself.sample
andself.dataset
which are not defined when the mainload()
function is called (because an emptyDataSet()
object is created and afterwards loaded from file).self.save()
andself.load()
methods.If no h5 path is manually provided,
h5name
is set toself.dsfile_default
which is calculated inself.update_paths()
At the end of
self.save()
andself.load()
, we know the file saved successfully, so we updateself.dsfile
equal toh5name
(so we can keep track of where we saved to)Only one actual change to
roi_iradon.py
: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.