Commit 6f254386 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

Detects echo time in FID sidecar file

parent ec1ae277
......@@ -295,6 +295,8 @@ def main():
# Echo time
if args.TE is not None:
echotime = args.TE*1E-3
elif 'TE' in dataheader:
echotime = dataheader['TE']
elif 'meta' in basisheader:
if 'TE' in basisheader['meta']:
echotime = basisheader['meta']['TE']
......@@ -306,6 +308,8 @@ def main():
echotime = None
# Internal and Water quantification if requested
if (mrs.H2O is None) or (echotime is None):
if echotime is None:
warnings.warn('H2O file provided but could not determine TE: no absolute quantification will be performed.',UserWarning)
res.calculateConcScaling(mrs,referenceMetab=args.internal_ref)
elif args.tissue_frac is None:
res.calculateConcScaling(mrs,
......
......@@ -43,7 +43,9 @@ def readNIFTI(datafile,squeezeSVS=True):
'json':jsonParams,
'centralFrequency':jsonParams['ImagingFrequency'],
'dwelltime':jsonParams['Dwelltime'],
'bandwidth':1/jsonParams['Dwelltime']}
'bandwidth':1/jsonParams['Dwelltime']}
if "EchoTime" in jsonParams:
header['TE'] = jsonParams['EchoTime']
# If there is only one FID (SVS) and squeezeSVS is true then
# remove singleton dimensions
......@@ -212,4 +214,4 @@ def readAndGenFSLBasis(file,readoutShift,bandwidth,points):
'dwelltime':1/bandwidth,
'fwhm':lw}
return FID, metabo, header
\ No newline at end of file
return FID, metabo, header
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment