sdcflows.utils.phasemanip module#

Utilities to manipulate phase and phase difference maps.

sdcflows.utils.phasemanip.au2rads(in_file, newpath=None)[source]#

Convert the input phase map in arbitrary units (a.u.) to rads.

sdcflows.utils.phasemanip.delta_te(in_values)[source]#

Read \(\Delta_\text{TE}\) from BIDS metadata dict.

Examples

>>> t = delta_te({"EchoTime1": 0.00522, "EchoTime2": 0.00768})
>>> f"{t:.5f}"
'0.00246'
>>> t = delta_te({'EchoTimeDifference': 0.00246})
>>> f"{t:.5f}"
'0.00246'
>>> delta_te({"EchoTime1": "a"})  
Traceback (most recent call last):
ValueError:
>>> delta_te({"EchoTime2": "a"})  
Traceback (most recent call last):
ValueError:
>>> delta_te({})  
Traceback (most recent call last):
ValueError:
>>> delta_te({"EchoTimeDifference": "a"})  
Traceback (most recent call last):
ValueError:
sdcflows.utils.phasemanip.phdiff2fmap(in_file, delta_te, newpath=None)[source]#

Convert the input phase-difference map into a fieldmap in Hz.

sdcflows.utils.phasemanip.subtract_phases(in_phases, in_meta, newpath=None)[source]#

Calculate the phase-difference map, given two input phase maps.