Skip to content
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

Added fidcsi and fidall options for GE SVS - for special case of pulse-acquire scans #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions spec2nii/GE/ge_pfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def _process_svs_pfile(pfile):

if psd in ('mrs-press', 'probe-p', 'probe-s', 'probe-p_ach'):
data, meta, dwelltime, fname_suffix = _process_probe_p(pfile)
elif psd in ('fidcsi', 'fidall'):
data, meta, dwelltime, fname_suffix = _process_fidcsi_pa(pfile) # Special case where MRSI dims = (1, 1, 1)
elif psd in ('oslaser', 'slaser_cni') and numecho == 1: # MM: If non-edited data, use _process_oslaser
data, meta, dwelltime, fname_suffix = _process_oslaser(pfile)
elif psd == 'oslaser' and numecho > 1: # MM: If edited data, use _process_gaba
Expand Down Expand Up @@ -158,6 +160,29 @@ def _process_probe_p(pfile):
return [metab, water], [meta, meta_ref], dwelltime, ['', '_ref']


def _process_fidcsi_pa(pfile):
"""Extract metabolite data from a pulse-acquire fidcsi/fidall pfile - a special case of MRSI where dims = (1, 1, 1)

:param Pfile pfile: Pfile object
:return: List numpy data arrays
:return: List of file name suffixes
"""

metab = pfile.map.raw_suppressed # typically (1,1,1,navg,ncoil,npts)
water = pfile.map.raw_unsuppressed # typically (1,1,1,navg,ncoil,npts)
metab = np.concat((water, metab), axis=3)
metab = np.transpose(metab, [0, 1, 2, 5, 4, 3]) # swap to (1,1,1,npts,ncoil,navg)

dwelltime = 1 / pfile.hdr.rhr_spectral_width

meta = _populate_metadata(pfile)

meta.set_dim_info(0, 'DIM_COIL')
meta.set_dim_info(1, 'DIM_DYN')

return [metab,], [meta,], dwelltime, ['',]


def _process_oslaser(pfile):
"""Extract metabolite and reference data from a oslaser format pfile

Expand Down
Loading