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
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
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: fischl@nmr.mgh.harvard.edu To: aguthorm@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.
thanks Don
are you guys still using this function?
Bruce On Wed, 25 Jan 2012, Don Hagler wrote:
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: fischl@nmr.mgh.harvard.edu To: aguthorm@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
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.
Hi Bruce,
Yes, some in our group still use it, although I personally have switched to using a matlab function that computes the normal vectors directly from the surface files.
Don
Date: Wed, 25 Jan 2012 20:50:28 -0500 From: fischl@nmr.mgh.harvard.edu To: dhaglerjr@hotmail.com CC: aguthorm@lanl.gov; freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] write dipoles function
thanks Don
are you guys still using this function?
Bruce On Wed, 25 Jan 2012, Don Hagler wrote:
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: fischl@nmr.mgh.harvard.edu To: aguthorm@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
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.
Thank you, Don. That worked perfectly.
Amy
On Jan 25, 2012, at 6:21 PM, Don Hagler wrote:
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: fischl@nmr.mgh.harvard.edumailto:fischl@nmr.mgh.harvard.edu To: aguthorm@lanl.govmailto:aguthorm@lanl.gov CC: freesurfer@nmr.mgh.harvard.edumailto: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.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto: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@nmr.mgh.harvard.edu