Skip to content

Commit 4475574

Browse files
authored
Merge branch 'master' into add_prephasors
2 parents 5dba80c + d139f73 commit 4475574

File tree

7 files changed

+128
-20
lines changed

7 files changed

+128
-20
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: 🐛 Bug
3+
about: Report a problem
4+
labels: 'bug'
5+
---
6+
7+
## Problem
8+
9+
> A report of the problem you observed.
10+
11+
## Expectation
12+
13+
> A description of what you were expecting to observe instead.
14+
15+
## Suggestion
16+
17+
> Some ideas about how to solve that problem.
18+
19+
## Reproducibility
20+
21+
> Steps to reproduce your observations so we can see the problem too, ideally some minimal code example.
22+
23+
## Additional context
24+
25+
> More context about your project, operating system, hardware or whatever to better understand the issue.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: 🎇 Trajectory request
3+
about: Propose a new trajectory for MRI-nufft
4+
labels: ['trajectories', 'feature request']
5+
title: "Add trajectory"
6+
---
7+
8+
## The trajectory
9+
10+
> Describe the trajectory/sampling pattern, don't hesitate to add pictures.
11+
12+
## References
13+
14+
> Add publication and/or code references.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: 🛠️ Installation issues
3+
about: Failed to install MRI-nufft or one of its backend ?
4+
title: "Installation issue with "
5+
---
6+
7+
<!-- Please fill out the following sections to help us understand your issue.
8+
9+
Before submitting, please ensure that you have read the installation guidelines:
10+
https://mind-inria.github.io/mri-nufft/getting_started.html
11+
-->
12+
13+
## My System
14+
15+
- **OS**: [e.g. Ubuntu 20.04, macOS 11.2, Windows 10]
16+
- **Python version**: [e.g. 3.8.5]
17+
- **CUDA version**: [if applicable, e.g. 11.2]
18+
- **package manager** [e.g. pip, uv, conda]
19+
20+
## What I did
21+
22+
> Describe the steps you took to install MRI-nufft or its backend, including any commands you ran.
23+
24+
## What happened
25+
26+
> Describe the error messages or issues you encountered during installation.
27+
> If possible, include the full output of the installation command.
28+
29+
## Additional context
30+
31+
> Provide any additional information that might help diagnose the issue.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: ✨ Feature request
3+
about: Suggest a new feature for MRI-nufft
4+
labels: 'feature request'
5+
---
6+
7+
## Description & use cases
8+
9+
> Describe the feature you would like to see in MRI-nufft. Be as specific as possible about what you want to achieve.
10+
11+
12+
## Suggested implementation
13+
14+
> Describe how you envision the feature being implemented. This could include specific functions, classes, or changes to existing code.

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!---
2+
This is a suggested pull request template for mri-nufft.
3+
It's designed to capture information we've found to be useful in reviewing pull requests.
4+
5+
If there is other information that would be helpful to include, please don't hesitate to add it!
6+
7+
Please make sure your pull request also follows the
8+
[contribution guidelines](https://github.com/mind-inria/mri-nufft/blob/master/CONTRIBUTING.md) that
9+
will be enforced during the review process.
10+
-->
11+
12+
<!-- Please indicate after the # which issue you're closing with this PR.
13+
This is helpful for the maintainers AND will magically close the issue when this
14+
pull request is merged!
15+
If the PR closes multiple issues, includes "closes" before each one is listed.
16+
https://help.github.com/articles/closing-issues-using-keywords -->
17+
- Closes #
18+
19+
<!-- Please give a brief overview of what has changed in the PR.
20+
If you're not sure what to write, consider it a note to the maintainers to indicate
21+
what they should be looking for when they review the pull request. -->
22+
Changes proposed in this pull request:
23+
24+
-
25+
-

src/mrinufft/trajectories/display3D.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def get_gridded_trajectory(
101101
np.tile(np.linspace(1, 10, trajectory.shape[1]), (trajectory.shape[0],)),
102102
None,
103103
True,
104-
)
104+
) / (gridded_ones + np.finfo(np.float32).eps)
105105
elif grid_type == "inversion":
106106
data = grid_op.raw_op.adj_op(
107107
np.repeat(
@@ -110,7 +110,7 @@ def get_gridded_trajectory(
110110
)[: samples.shape[0]],
111111
None,
112112
True,
113-
)
113+
) / (gridded_ones + np.finfo(np.float32).eps)
114114
elif grid_type == "holes":
115115
data = np.abs(gridded_ones).squeeze() < threshold
116116
if elliptical_samp:
@@ -143,5 +143,5 @@ def get_gridded_trajectory(
143143
data = np.hstack([slews, np.zeros((slews.shape[0], 2, slews.shape[2]))])
144144
data = grid_op.raw_op.adj_op(
145145
np.linalg.norm(data, axis=-1).flatten(), None, True
146-
)
146+
) / (gridded_ones + np.finfo(np.float32).eps)
147147
return np.squeeze(np.abs(data))

src/mrinufft/trajectories/inits/travelling_salesman.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@ def _sort_by_coordinate(array: NDArray, coord: Coordinate) -> NDArray:
3030
f"Invalid `coord`='{coord}' for arrays with less than 3 dimensions."
3131
)
3232

33-
match coord.lower():
34-
case "x":
35-
coord = array[..., 0]
36-
case "y":
37-
coord = array[..., 1]
38-
case "z":
39-
coord = array[..., 2]
40-
case "r":
41-
coord = np.linalg.norm(array, axis=-1)
42-
case "phi":
43-
coord = np.sign(array[..., 1]) * np.arccos(
44-
array[..., 0] / nl.norm(array[..., :2], axis=-1)
45-
)
46-
case "theta":
47-
coord = np.arccos(array[..., 2] / nl.norm(array, axis=-1))
48-
case _:
49-
raise ValueError(f"Unknown coordinate `{coord}`")
33+
if coord == "x":
34+
coord = array[..., 0]
35+
elif coord == "y":
36+
coord = array[..., 1]
37+
elif coord == "z":
38+
coord = array[..., 2]
39+
elif coord == "r":
40+
coord = np.linalg.norm(array, axis=-1)
41+
elif coord == "phi":
42+
coord = np.sign(array[..., 1]) * np.arccos(
43+
array[..., 0] / nl.norm(array[..., :2], axis=-1)
44+
)
45+
elif coord == "theta":
46+
coord = np.arccos(array[..., 2] / nl.norm(array, axis=-1))
47+
else:
48+
raise ValueError(f"Unknown coordinate `{coord}`")
5049
order = np.argsort(coord)
5150
return array[order]
5251

0 commit comments

Comments
 (0)