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

Smaps estimation module in mri-nufft #90

Merged
merged 58 commits into from
May 24, 2024
Merged

Conversation

chaithyagr
Copy link
Member

Add Smaps estimation module in mri-nufft to makes creation of Fourier operator streamlined.
This should be merged after #89

Copy link
Member

@paquiteau paquiteau left a 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 ?

pyproject.toml Show resolved Hide resolved
src/mrinufft/extras/smaps.py Outdated Show resolved Hide resolved
src/mrinufft/extras/smaps.py Outdated Show resolved Hide resolved
src/mrinufft/io/nsp.py Outdated Show resolved Hide resolved
src/mrinufft/operators/base.py Outdated Show resolved Hide resolved
@chaithyagr chaithyagr force-pushed the smaps branch 4 times, most recently from fe897f0 to 15109c6 Compare April 11, 2024 11:06
@chaithyagr
Copy link
Member Author

Removed the unnessary rebase which was really confusing and repetitive.

@chaithyagr chaithyagr marked this pull request as ready for review May 21, 2024 16:28
@chaithyagr chaithyagr requested a review from paquiteau May 21, 2024 16:28
@chaithyagr
Copy link
Member Author

@paquiteau can you see the issue please, its from brainwebdl, not something I touched? Also I think now its ready for review.

Copy link
Member

@paquiteau paquiteau left a 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 :)

Comment on lines +6 to +13
"""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
Copy link
Member

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(
Copy link
Member

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)

@paquiteau paquiteau added this to the v0.9.0 milestone May 23, 2024
@paquiteau paquiteau merged commit afb3843 into mind-inria:master May 24, 2024
6 of 7 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