-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cd_pipeline
- Loading branch information
Showing
5 changed files
with
15 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from mrpro.algorithms.csm.iterative_walsh import iterative_walsh | ||
from mrpro.algorithms.csm.walsh import walsh | ||
from mrpro.algorithms.csm.inati import inati |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/algorithms/csm/test_iterative_walsh.py → tests/algorithms/csm/test_walsh.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
"""Tests the iterative Walsh algorithm.""" | ||
|
||
import torch | ||
from mrpro.algorithms.csm import iterative_walsh | ||
from mrpro.algorithms.csm import walsh | ||
from mrpro.data import SpatialDimension | ||
from tests.algorithms.csm.conftest import multi_coil_image | ||
from tests.helper import relative_image_difference | ||
|
||
|
||
def test_iterative_Walsh(ellipse_phantom, random_kheader): | ||
"""Test the iterative Walsh method.""" | ||
def test_walsh(ellipse_phantom, random_kheader): | ||
"""Test the Walsh method.""" | ||
idata, csm_ref = multi_coil_image(n_coils=4, ph_ellipse=ellipse_phantom, random_kheader=random_kheader) | ||
|
||
# Estimate coil sensitivity maps. | ||
# iterative_walsh should be applied for each other dimension separately | ||
# walsh should be applied for each other dimension separately | ||
smoothing_width = SpatialDimension(z=1, y=5, x=5) | ||
csm = iterative_walsh(idata.data[0, ...], smoothing_width, power_iterations=3) | ||
csm = walsh(idata.data[0, ...], smoothing_width) | ||
|
||
# Phase is only relative in csm calculation, therefore only the abs values are compared. | ||
assert relative_image_difference(torch.abs(csm), torch.abs(csm_ref[0, ...])) <= 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters