Read head position from .fif file

Dear all,

I am actually trying to read the head position from my .fif file,
but I get this error: "Could not convert string to float"

here is my line of code:

raw_fname = data_path + 'raw/cb140229_mag_run1.fif'
# Read head position
head_pos = mne.chpi.read_head_pos(raw_fname) [error is at that point]
raw_sss = maxwell_filter(raw, calibration=cal_fname, cross_talk =
ctc_fname, head_pos=None)

I am wondering what I am doing wrong, or if I can read head position from
the .fif file.
Any help is welcome,

Best,
Beno?t MARTIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160713/2390b953/attachment.html

Hi Beno?t,

I think you need a *.pos file not *.fif file to read the head position
(like the one attached). It's generated by maxfilter. Also, this is only
required if you plan to do movement compensation ...

Eric, shouldn't you be able to read the head position directly from the
*.fif files because you have the head_to_dev transforms?

Best regards,
Mainak

Dear all,

I am actually trying to read the head position from my .fif file,
but I get this error: "Could not convert string to float"

here is my line of code:

raw_fname = data_path + 'raw/cb140229_mag_run1.fif'
# Read head position
head_pos = mne.chpi.read_head_pos(raw_fname) [error is at that point]
raw_sss = maxwell_filter(raw, calibration=cal_fname, cross_talk =
ctc_fname, head_pos=None)

I am wondering what I am doing wrong, or if I can read head position from
the .fif file.
Any help is welcome,

Best,
Beno?t MARTIN

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160713/1a4c5aca/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simulated_quats.pos
Type: application/octet-stream
Size: 1380 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160713/1a4c5aca/attachment.obj

Eric, shouldn't you be able to read the head position directly from the
*.fif files because you have the head_to_dev transforms?

The initial head position is stored in info['dev_head_t'], yeah. However
the time-varying head position, which is needed for movement compensation,
isn't stored in the FIF file until 1) movement compensation is performed in
Python or MaxFilter, or 2) MaxFilter is run in head-position-only mode as
`maxfilter -headpos ...`.

We have done some work in MNE-Python on estimating the head positions
directly, but it's still experimental. So for now you can do something like
this to get a suitable head-position text file:

maxfilter -f test_raw.fif -headpos -format short -hp test_raw_hp.pos

Note that this MaxFilter mode will also write out a test_raw_quat.fif file,
which is the same as the input file, but with the head positions added as
channels. But for MNE-Python it's easiest to use the ASCII text file output
test_raw_hp.pos instead.

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160713/7f400202/attachment.html

Thanks a lot for helping and for the solutions,
Best,
Beno?t

2016-07-13 18:55 GMT+02:00 Eric Larson <larson.eric.d at gmail.com>:

Eric, shouldn't you be able to read the head position directly from the

*.fif files because you have the head_to_dev transforms?

The initial head position is stored in info['dev_head_t'], yeah. However
the time-varying head position, which is needed for movement compensation,
isn't stored in the FIF file until 1) movement compensation is performed in
Python or MaxFilter, or 2) MaxFilter is run in head-position-only mode as
`maxfilter -headpos ...`.

We have done some work in MNE-Python on estimating the head positions
directly, but it's still experimental. So for now you can do something like
this to get a suitable head-position text file:

maxfilter -f test_raw.fif -headpos -format short -hp test_raw_hp.pos

Note that this MaxFilter mode will also write out a test_raw_quat.fif
file, which is the same as the input file, but with the head positions
added as channels. But for MNE-Python it's easiest to use the ASCII text
file output test_raw_hp.pos instead.

Eric

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160715/198e6f49/attachment-0001.html