Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcencini committed Jan 24, 2024
1 parent 2a0511a commit fc8a096
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/deepmr/io/header/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def read_acquisition_header(filepath, *args, device="cpu", verbose=False, **kwar
if verbose == 2:
print(f"Readout time: {round(float(head.t[-1]), 2)} ms")
if head.traj is not None:
print(f"Trajectory range: ({head.traj.min()},{head.traj.max()})")
print(
f"Trajectory shape: (ncontrasts={head.traj.shape[0]}, nviews={head.traj.shape[1]}, nsamples={head.traj.shape[2]}, ndim={head.traj.shape[-1]})"
)
Expand Down
17 changes: 16 additions & 1 deletion src/deepmr/io/image/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,21 @@ def read_image(filepath, acqheader=None, device="cpu", verbose=0):
head.dcf = acqheader.dcf
if acqheader.t is not None:
head.t = acqheader.t

if acqheader.user is not None:
head.user = acqheader.user
if acqheader.FA is not None:
head.FA = acqheader.FA
if acqheader.TR is not None:
head.TR = acqheader.TR
if acqheader.TE is not None:
head.TE = acqheader.TE
if acqheader.TI is not None:
head.TI = acqheader.TI

# remove flip and transpose
head.transpose = None
head.flip = None

# final report
if verbose == 2:
print(
Expand All @@ -183,6 +197,7 @@ def read_image(filepath, acqheader=None, device="cpu", verbose=0):
if head.t is not None:
print(f"Readout time: {round(float(head.t[-1]), 2)} ms")
if head.traj is not None:
print(f"Trajectory range: ({head.traj.min()},{head.traj.max()})")
print(
f"Trajectory shape: (ncontrasts={head.traj.shape[0]}, nviews={head.traj.shape[1]}, nsamples={head.traj.shape[2]}, ndim={head.traj.shape[-1]})"
)
Expand Down
1 change: 1 addition & 0 deletions src/deepmr/io/kspace/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def read_rawdata(filepath, acqheader=None, device="cpu", verbose=0):
if verbose == 2:
print(f"Readout time: {round(float(head.t[-1]), 2)} ms")
if head.traj is not None:
print(f"Trajectory range: ({head.traj.min()},{head.traj.max()})")
print(
f"Trajectory shape: (ncontrasts={head.traj.shape[0]}, nviews={head.traj.shape[1]}, nsamples={head.traj.shape[2]}, ndim={head.traj.shape[-1]})"
)
Expand Down

0 comments on commit fc8a096

Please sign in to comment.