Repository of a Brainlife App that computes time varying head positions from raw.info provided in the raw.fif when the cHPI were recorded
(see the mne tutorial).
- Compute the cHPI
- Input file are:
- a MEG file in
.fifformat containing cHPI information, - an optional fine calibration file in
.dat, - an optional crosstalk compensation file in
.fif, - an optional head position file in
.pos, - an optional destination file in
.fif, - an optional events file in
.tsv, - an optional channels file in
.tsv.
- a MEG file in
- Input parameters are:
param_compute_amplitudes_t_step_min:float, minimum time step to use to compute cHPI amplitudes. Default is 0.01.param_compute_amplitudes_t_window:float, time window to use to estimate the amplitudes. Default is 0.2.param_compute_amplitudes_ext_order:int, the external order for SSS-like interfence suppression to compute cHPI amplitudes. Default is 1.param_compute_amplitudes_tmin:float, start time of the raw data to use in seconds to compute cHPI amplitudes. Default is 0.param_compute_amplitudes_tmax:float, optional, end time of the raw data to use in seconds to compute cHPI amplitudes. Default isNone.param_compute_locs_t_step_max:float, maximum step to use to compute HPI coils locations. Default is 1.param_compute_locs_too_close:str, how to handle HPI positions too close to sensors when computing HPI coils locations. Can be 'raise', (default), 'warning', or 'info'.param_compute_locs_adjust_dig:bool, if True, adjust the digitization locations used for fitting when computing HPI coils locations. Default is False.param_compute_head_pos_dist_limit:float, minimum distance (m) to accept for coil position fitting when computing head positions. Default is 0.005.param_compute_head_pos_gof_limit:float, minimum goodness of fit to accept for each coil to compute head positions. Default is 0.98.param_compute_head_pos_adjust_dig:bool, if True, adjust the digitization locations used for fitting when computing head positions. Default is False.
- Ouput file is a
.posfile containing the head positions, which can be read bymne.chpi.read_head_posand will be used in Maxwell Filtering (see the corresponding BL App).
brainlife.io is publicly funded and for the sustainability of the project it is helpful to Acknowledge the use of the platform. We kindly ask that you acknowledge the funding below in your code and publications. Copy and past the following lines into your repository when using this code.
- Avesani, P., McPherson, B., Hayashi, S. et al. The open diffusion data derivatives, brain data upcycling via integrated publishing of derivatives and reproducible open cloud services. Sci Data 6, 69 (2019). https://doi.org/10.1038/s41597-019-0073-y
This App is still private on Brainlife.
- git clone this repo
- Inside the cloned directory, create
config.jsonwith the same keys as inconfig.json.examplebut with paths to your input files and values of the input parameters.
{
"fif": "rest1-raw.fif"
}- Launch the App by executing
main
./mainThe output file is .pos file.