[Mne_analysis] MNE Matlab fiff_write_coord_trans function help
dgw
dgwakeman at gmail.com
Thu Oct 25 09:39:15 EDT 2012
Hi Kambiz,
>From your description of approach "a" it seems like you should start a
bit closer to the beginning. i.e. read the raw fiff file change the
device to head transformation matrix and write it out again. You
shouldn't need to deal with those other functions. I would use
mne_ex_read_write_raw as a guide. I am not sure of what you tried to
do exactly, but the above approach is simpler. It sounds as though you
were trying to simply overwrite directly into an already written file,
which I do not believe is supported in the MATLAB toolbox (or if it
is, it may be more complicated to use than simply reading in the file
and writing it out again). You need to read in the whole file and
write it back out.
D
On Wed, Oct 24, 2012 at 6:38 PM, Kambiz Tavabi <ktavabi at uw.edu> wrote:
> Greetings all,
> I accidently sent this email to mne_support at nmr, if you're getting this
> again, I am sorry for the duplicate.
> I am trying to define a new device-to-head transformation matrix and either
> (a) over write the transformation matrix in a existing raw fif file or (b)
> write a new 'dummy' fif file. I get the impression option (a) is more
> feasible, using some of the MNE Matlab functions.
> To that end I tried using the function fiff_write_coord_trans to overwrite a
> coordinate transfomation structure to a raw fif file. The device-to-head
> transformation matrix output from fiff_read_meas_info is of type double
> precision, once I make the desired changes to that matrix and pass the new
> coordinate transfomation structure to fiff_write_coord I get an error at
> line 53:
>
> ln51-count = fwrite(fid,int32(FIFF_COORD_TRANS),'int32');
> ln52-if count ~= 1
> ln53- error(me,'write failed');
> ln54-end
>
> I suspect the problem is due to mismatch between 'int32' and 'double'
> precision types. But I get the same error if I convert the transformation
> matrix to int32, not to mention the values are now quite different as
> compared to the original double precision matrix output by
> fiff_read_meas_info. Anyone know what's going on here? or know of a fix or
> workaround?
>
> Thanks in advance
> Kambiz
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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
> http://www.partners.org/complianceline . 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.
>
More information about the Mne_analysis
mailing list