Skip to content
Snippets Groups Projects
Commit ec6ca756 authored by Fidel Alfaro Almagro's avatar Fidel Alfaro Almagro :speech_balloon:
Browse files

Scmall change in the acqparam generation function

parent 3b25d24e
No related branches found
No related tags found
No related merge requests found
Pipeline #17724 passed
......@@ -94,14 +94,11 @@ def get_acqparams_row(phase_encode, im, im_json):
"""
Creates a row for the acqparams file from topup based
>>> get_acqparams_row("j-", 0.01)
"0 -1 0 0.01\n"
>>> get_acqparams_row("i")
"1 0 0 0.05\n"
Args:
phase_encode: phase encode direction (string with two elements, first one should be i, j, or k, second one should be + or -)
im: image file to get the number of lines to calculate the readout time
phase_encode: phase encode direction (string with two elements, first
one should be i, j, or k, second one should be + or -)
im: image file to get the number of lines to calculate the
readout time
im_json: json file corresponding to the previous image
"""
......@@ -115,11 +112,12 @@ def get_acqparams_row(phase_encode, im, im_json):
if sign in dimensions:
orient, sign = sign, orient
if orient not in dimensions or sign not in '+-':
raise ValueError(f"Unrecognised phase encode direction {phase_encode}; should by like i- or j+")
raise ValueError('Unrecognised phase encode direction ' +
f'{phase_encode}; should by like i- or j+')
dimension = dimensions.index(orient)
elements[dimension] = '1' if sign == '+' else '-1'
else:
raise ValueError(f"Unrecognised phase encode direction {phase_encode}")
raise ValueError(f'Unrecognised phase encode direction {phase_encode}')
imAP = nib.load(im)
numlines = imAP.header['dim'][dimension]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment