Thanks.

For the record, I used mris_convert to convert a .surf file to a .mgh file, then I used mri= MRIread(file.mgh), and I changed the mri.vol for the source data in a 1 x nvertices x 1 x ntimepoints, and save it with MRIwrite.

Cheers,
Dorothy

On Wed, Mar 15, 2017 at 9:34 AM, Douglas N Greve <greve@nmr.mgh.harvard.edu> wrote:
you can use mri_surf2surf to convert a .w file to another format


On 03/15/2017 12:33 PM, Bruce Fischl wrote:
> I see. We don't really support w files anymore. Can you write it out
> as a .mgz/.mgh instead? Have sourcedata be nvertices x 1 x 1 x
> ntimepoints and use MRIwrite or save_mgh
>
> On Wed, 15 Mar 2017, Dorothy Sincasto wrote:
>
>> Hi Bruce,
>> first I do:
>>
>> [vertex_coords, faces, magic] =
>> read_surf('rh.13475.midthickness.decimated.05.surf')
>>
>> I have a time series variable sourcedata =  6149X 149646. Is a double
>> and
>> the numbers are in the range of -1.181711152525857e-14
>>
>> then i try to write it:
>>
>> write_wfile(/'path/rh.13475.midthickness.decimated.05.MEG.mgz',sourcedata,
>>
>> vertex_coords),
>>
>>  and I get this error:
>>
>> Error using bitshift
>>
>> Double inputs must have integer values in the range of ASSUMEDTYPE.
>>
>>
>> Error in fwrite3 (line 26)
>>
>> b1 = bitand(bitshift(val, -16), 255) ;
>>
>>
>> Error in write_wfile (line 58)
>>
>>   fwrite3(fid, v(i)) ;          % vertex number (0-based)
>>
>>
>>
>> Thanks
>>
>> Dorothy
>>
>>
>> On Tue, Mar 14, 2017 at 7:28 PM, Bruce Fischl
>> <fischl@nmr.mgh.harvard.edu>
>> wrote:
>>       Can you send us the full command you ran and the full screen
>>       output?
>>
>>       Thanks
>>       Bruce
>>
>>       > On Mar 14, 2017, at 9:33 PM, Dorothy Sincasto
>>       <dsincasto@gmail.com> wrote:
>>       >
>>       > Hi,
>>       >
>>       > I have MEG time series for every vertex in a decimated surface
>>       (~6000 vertices). I want to create a file (i think is called
>>       overlay) in which the timeseries are saved, like an fMRI mgz
>>       overlay. How can I do that with matlab?
>>       >
>>       > I have tried read_surf for reading the midthickness surface
>>       file, and then using the vertex coordinates and the MEG time
>>       series variable as input for write_wfile. however i get the
>>       error:
>>       >
>>       > Error using bitshift
>>       > Double inputs must have integer values in the range of
>>       ASSUMEDTYPE.
>>       >
>>       > Error in fwrite3 (line 26)
>>       > b1 = bitand(bitshift(val, -16), 255) ;
>>       >
>>       > Error in write_wfile (line 58)
>>       >   fwrite3(fid, v(i)) ;          % vertex number (0-based)
>>       >
>>       > It seems that's not the function I need to use.
>>       >
>>       > Thanks
>>       > Dorothy
>> > _______________________________________________
>> > Freesurfer mailing list
>> > Freesurfer@nmr.mgh.harvard.edu
>> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
>> _______________________________________________
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
>> 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.
>>
>>
>>
>>
>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422

Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer