-
Notifications
You must be signed in to change notification settings - Fork 12
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
Smaps estimation module in mri-nufft #90
Conversation
Co-authored-by: Pierre-Antoine Comby <pierre-antoine.comby@crans.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some tweaks for the documentation and integration with mri-nufft.
There are some duplicated code with #89 , do you want to do several PR or a single one ?
fe897f0
to
15109c6
Compare
Removed the unnessary rebase which was really confusing and repetitive. |
@paquiteau can you see the issue please, its from brainwebdl, not something I touched? Also I think now its ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. The review raised some improvements possibilites.
The CI is fine, the download of brainweb had failed for some reason, nothing that a rerun can't fix :)
"""Get the density compensation function from its name.""" | ||
try: | ||
method = register_smaps.registry["sensitivity_maps"][name] | ||
except KeyError as e: | ||
raise ValueError( | ||
f"Unknown density compensation method {name}. Available methods are \n" | ||
f"{list(register_smaps.registry['sensitivity_maps'].keys())}" | ||
) from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget this ;)
method = get_smaps(method) | ||
if not callable(method): | ||
raise ValueError(f"Unknown smaps method: {method}") | ||
self.smaps, self.SOS = method( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring should be fine. Maybe rename it as _SOS
, it's not something that users should rely onto, as it is not always available. If we want to expose it we could use a property wrapping around it (and compute the SOS on the fly when this method is not used). Somethink like:
@property()
def SOS(self):
"""Returns the sum of square of the smaps.
If available, else return None"""
if not self.uses_sense:
return None
if hasattr(self, "_sos"):
return self._sos
else:
xp = get_array_module(self.smaps)
return xp.sum(self.smaps**2, axis=0)
Add Smaps estimation module in mri-nufft to makes creation of Fourier operator streamlined.
This should be merged after #89