Skip to content

Conversation

@alineyyy
Copy link
Collaborator

This makes it possible to reconstruct 2D slices independently using CS method and ifft in pysap.py when data_loader.slice_2d = True.

@alineyyy alineyyy requested a review from paquiteau February 18, 2025 15:57
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.

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 :)

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.

Some comments to address, but this is on the right tracks

Comment on lines 407 to 408
"""Load slice MRD files k-space frames iteratively."""

Copy link
Member

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.

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,:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,:]

Comment on lines 56 to 59
if data_loader.n_coils > 1:
smaps = data_loader.get_smaps().squeeze()
else:
smaps = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the squeeze ?

Comment on lines 146 to 150
if isinstance(method, str):
method = get_density(method)
if not callable(method):
raise ValueError(f"Unknown density method: {method}")

Copy link
Member

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.

Comment on lines 165 to 167
if smaps is not None:
nufft_operator.smaps = smaps[...,i % data_loader.frame.n_shots]

Copy link
Member

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

@alineyyy alineyyy force-pushed the 2d-reconstructors branch from 06a0716 to f6198ca Compare March 14, 2025 13:33
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