Hi Bruce and Amy,

I think that menu command actually outputs a binary file, which I would give a 
.dip extension. Some matlab code for reading one is included below.

Don


function dipole_info=ts_read_dip_file(dip_file)
% ts_read_dip_file.m:   read dipole file for calculating forward solution
%
% dipole_info=ts_read_dip_file(dip_file)
%
% read freesurfer dip file for the location and orientation of the dipoles
% returns dipole_info containing x,y,z location and nx,ny,nz normal vector
%
% created:    05/07/05 by Mingxiong Huang as read_dipdec.m
% early mod:  11/27/05 by Don Hagler as read_dip_file.m
% last mod:   08/01/06 by Don Hagler
%

dipole_info = [];

% make sure file exists
[status,message,messageid]=fileattrib(dip_file);
if (status==0)
  fprintf('%s: file %s not found... quitting\n',mfilename,dip_file);
  return;
end

% read dip file to get the location of the dipole
fprintf('ts_read_dip_file: reading file %s...\n',dip_file);
fp=fopen(dip_file,'r','ieee-be.l64');
[ch]=fread(fp,1,'uchar');
[n_dipole]=fread(fp,1,'int32');
dipole_info=fread(fp,[6,n_dipole],'float');
fclose(fp);

fprintf('%s: %d dipoles\n',mfilename,n_dipole);




> Date: Wed, 25 Jan 2012 17:35:22 -0500
> From: fis...@nmr.mgh.harvard.edu
> To: aguth...@lanl.gov
> CC: freesurfer@nmr.mgh.harvard.edu
> Subject: Re: [Freesurfer] write dipoles function
> 
> Hi Amy
> 
> hmmm, no one has used that for ages that I know of! Looks like it is an 
> ascii file with:
> 
> #!ascii
> number of vertices
> x y z nx ny nz
> .
> .
> .
> vnum nbr_0 nbr_1 ... nbr_(vnum-1)
> .
> .
> .
> 
> 
> where ... means it is repeated for # of vertices, <x y z> are the vertex 
> coords and <nx ny nz> is the surface normal
> 
> On Wed, 25 Jan 2012, 
> Guthormsen, Amy M wrote:
> 
> > Hello,
> >
> > I would like to try out the Tools-->surface-->write dipoles function, but I 
> > don't know how to read the file that it outputs.  Do I need to use a 
> > special file extension when I name the file?
> >
> > Thank you,
> >
> > Amy
> > _______________________________________________
> > 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


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.

Reply via email to