-
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
Random sampling #220
base: master
Are you sure you want to change the base?
Random sampling #220
Conversation
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.
Great idea for an additional tool. A bunch of comments mostly about aligning this function with other similar tools and also avoiding redundancy with PR #206
if accel == 0: | ||
return np.arange(dim_size) # type: ignore | ||
|
||
indexes = list(range(dim_size)) |
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.
Why pick positions over a discrete grid when uniform and gaussian pdfs are defined over continuous spaces ? We could remove dim_size
entirely as it would be only relevant when pdf
is an array which already contains dim_size
in its shape
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.
That's a good point. There are two reason: 1) this function was initially written 2 years ago for creating cartesian mask, and it evolved from there 2) this enforces a stacking that lies on the cartesian grid, making it suitable for Stacked-NUFFT (2.5 D) optimization.
A solution could be to resort to the continuous case if dim_size = None
, but then accel does not make a lot of sense anymore (accelerating compared to the continuous kz is not defined)
@Daval-G What do you think of this updated version ? also do not hesitate to check the example as well |
2ece4be
to
c4dc349
Compare
c4dc349
to
630486c
Compare
@paquiteau I am starting again to look at this request, but I won't finish tonight. I see that a bunch of my old comments are un-answered, could you have a look ? Thx |
I think now I have address everything you asked for :) |
This PR adds random sampling extension for trajectories.
In particular, it adds a trajectory expansion function (
stack_random
) to stack 2D trajectory following a certain distribution.([ ] Add ND sampling (e.g poisson disc))An example of stack of spiral with uniform sampling (but fully sampled in the center of k-space)