-
Notifications
You must be signed in to change notification settings - Fork 4
2D reconstructor using CS method and ifft #10
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
base: main
Are you sure you want to change the base?
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.
Looks promising :)
Could you cleanup the debugging comments please ?
Also, I think some (light) refactoring could be done to reduce the number of if data_loader.slice_2d call.
A potentially more durable solution would to create a "Slice2D dataloader" that adapt the problem from a N_frames x (N_slices x ...) to (N_slices x N_frammes) x ... And that has the proper shape as well. This would likely fit nicely with what Albane is doing :)
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.
Some comments to address, but this is on the right tracks
src/snake/mrd_utils/loader.py
Outdated
| """Load slice MRD files k-space frames iteratively.""" | ||
|
|
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.
Add a bit more documentation about this, mention that it augments a base data_loader for instance, and what it modifies compares to it.
src/snake/mrd_utils/loader.py
Outdated
| traj = traj.reshape(n_acq_per_frame, -1, 3) | ||
| data = data.reshape(self.frame.n_coils, n_acq_per_frame, -1) | ||
|
|
||
| return traj[idx%self.frame.n_shots,:,:2], data[:,idx%self.frame.n_shots,:] |
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.
| return traj[idx%self.frame.n_shots,:,:2], data[:,idx%self.frame.n_shots,:] | |
| shot_loc = idx%self.frame.n_shots | |
| return traj[shot_loc,:,:2], data[:,shot_loc,:] |
| if data_loader.n_coils > 1: | ||
| smaps = data_loader.get_smaps().squeeze() | ||
| else: | ||
| smaps = None |
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 the squeeze ?
| if isinstance(method, str): | ||
| method = get_density(method) | ||
| if not callable(method): | ||
| raise ValueError(f"Unknown density method: {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.
no need for the error raising here, MRI-NUFFT will do it on its own.
| if smaps is not None: | ||
| nufft_operator.smaps = smaps[...,i % data_loader.frame.n_shots] | ||
|
|
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.
this only works in 2D
06a0716 to
f6198ca
Compare
This makes it possible to reconstruct 2D slices independently using CS method and ifft in
pysap.pywhendata_loader.slice_2d = True.