Error running make_forward_solution: Head<-->sensor transform not found

Hi All,

I'm getting an error when I run mne.make_forward_solution, but only if I
try to save the result.

That is, if I set fname=None then the whole thing runs fine, but if I set
fname=<filename>, it fails in the call to write_forward_solution with the
error:
Head<-->sensor transform not found

Seems like write_forward_solution is expecting values in info under
dev_head_t or ctf_head_t, which never got set.

I think it may be related to the fact that I'm loading (just EEG) data from
a brainvision file using mne.io.read_raw_brainvision.

I've been struggling to figure out how to include the digitizer information
in the preprocessed data. My digitizer info is in a .fif file that
otherwise doesn't contain any measurement data (I can't even figure out how
to load it using the python MNE). So far the only thing I've done with that
file is to use it to update the channel locations with a call to the C
implementation:
    call(['mne_check_eeg_locations',
          '--file', fname,
          '--dig', op.join(subjects_dir,subject,subject + '.fif'),
          '--fix'])

I'm new to all of this (including python) so any help would be much
appreciated! I've attached the code (apologies for the mess).

Thanks,
Emily
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20151117/e57b3044/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_eeganes07_151112.py
Type: text/x-python-script
Size: 4538 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20151117/e57b3044/attachment.bin

Hi Emily,
   Perhaps you could try converting the digitization data to one of the
formats (e.g., .hpts) accepted by mne.channels.read_montage(.) using
the C-version of mne_convert_dig_data (if they are already not
available in one of those formats). Once you do that and read it into
python as a Montage object using mne.channels.read_montage(.), you
could supply it as to the montage argument in
mne.io.read_raw_brainvision(.).

Also, the digitization data should contain cardinal points (like nasion,
LPA, RAP) for the head along with the EEG sensor locations.. That way,
"head coordinated" and "sensor coordinates" can be matched in the Montage.

HTH,
Hari

Can you simplify the script to use a minimal number of files and lines to
reproduce the error (e.g., hopefully it doesn't depend on bad channels at
all), and upload the necessary files and script somewhere? I guess that
error could happen if you only have sensors in head coordinates to start
with -- we can probably work around it.

It shouldn't be too difficult to add that digitization information without
having to resort to MNE-C tools. Feel free to open an mne-python issue
about this stuff so we can hash out a solution, then we can report back to
this thread.

Eric