Thank you, Bruce. Is seems that the cut works well in tksurfer, however I am unable to save the cut surface, if I use save or save as, it saves the original (whole) surface. What should I do? Octavian.
On Thu, Nov 1, 2012 at 11:49 AM, Bruce Fischl fischl@nmr.mgh.harvard.eduwrote:
the easiest thing would be to copy it into surface as lh.bem then run tksurfer on it
On Thu, 1 Nov 2012, octavian lie wrote:
Thank you for your quick prompt, how do I pull the inner skull surface
into tksurfer, given it is in /bem and not in /surf, and does not have a lh or rh option? Octavian
On Thu, Nov 1, 2012 at 11:41 AM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote: Hi Octavian
sure, define a sagittal cutting plane in tksurfer, or in matlab setripflag=1 for all vertices with the x coord > 0 (or < 0)
cheers Bruce On Thu, 1 Nov 2012, octavian lie wrote: Dear all, Is there a way to crop a surface in FS, freeview or matlab? Ihave the inner_skull_surface in BEM folder, and I want to see just the right half, akin to cropping along the A (RAS) axis from the left. This is in order to visualize the inside of the surface with some electrode applications. Also, if the surface can be created in MNE just on the right side that will solve it. Help much appreciated, Octavian Lie.
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/**compliancelinehttp://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.
save it as a patch On Thu, 1 Nov 2012, octavian lie wrote:
Thank you, Bruce. Is seems that the cut works well in tksurfer, however I am unable to save the cut surface, if I use save or save as, it saves the original (whole) surface. What should I do? Octavian.
On Thu, Nov 1, 2012 at 11:49 AM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote: the easiest thing would be to copy it into surface as lh.bem then run tksurfer on it On Thu, 1 Nov 2012, octavian lie wrote:
Thank you for your quick prompt, how do I pull the inner skull surface into tksurfer, given it is in /bem and not in /surf, and does not have a lh or rh option? Octavian On Thu, Nov 1, 2012 at 11:41 AM, Bruce Fischl <fischl@nmr.mgh.harvard.edu> wrote: Hi Octavian sure, define a sagittal cutting plane in tksurfer, or in matlab set ripflag=1 for all vertices with the x coord > 0 (or < 0) cheers Bruce On Thu, 1 Nov 2012, octavian lie wrote: Dear all, Is there a way to crop a surface in FS, freeview or matlab? I have the inner_skull_surface in BEM folder, and I want to see just the right half, akin to cropping along the A (RAS) axis from the left. This is in order to visualize the inside of the surface with some electrode applications. Also, if the surface can be created in MNE just on the right side that will solve it. Help much appreciated, Octavian Lie. 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.
Dear Bruce, One last question. I saved the cut surface as rh.inner-skull-surface (original was rh.sub_inner_skull_surface) as a patch, but when trying to see it in tksurfer, I get the following error message:
tksurfer sub rh inner-skull-surface subject is sub hemi is rh surface is inner-skull-surface surfer: current subjects dir: /usr/local/freesurfer/subjects surfer: not in "scripts" dir ==> using cwd for session root surfer: session root data dir ($session) set to: surfer: /home/ovl checking for nofix files in 'inner-skull-surface' Reading image info (/usr/local/freesurfer/subjects/graff) Reading /usr/local/freesurfer/subjects/graff/mri/orig.mgz surfer: Reading header info from /usr/local/freesurfer/subjects/graff/mri/orig.mgz mrisFindNeighbors: /usr/local/freesurfer/subjects/graff/surf/rh.inner-skull-surface: face[0].v[0] = 0, but face 0 not in vertex 0 face list
What should I do so that the cut surface is interpreted as surface for import in matlab and electrode projection?
Octavian
It is no longer a surface - it is a patch and you need to load it that way. It's a different file format
Bruce
On Nov 1, 2012, at 1:22 PM, octavian lie octavian.lie@gmail.com wrote:
Dear Bruce, One last question. I saved the cut surface as rh.inner-skull-surface (original was rh.sub_inner_skull_surface) as a patch, but when trying to see it in tksurfer, I get the following error message:
tksurfer sub rh inner-skull-surface subject is sub hemi is rh surface is inner-skull-surface surfer: current subjects dir: /usr/local/freesurfer/subjects surfer: not in "scripts" dir ==> using cwd for session root surfer: session root data dir ($session) set to: surfer: /home/ovl checking for nofix files in 'inner-skull-surface' Reading image info (/usr/local/freesurfer/subjects/graff) Reading /usr/local/freesurfer/subjects/graff/mri/orig.mgz surfer: Reading header info from /usr/local/freesurfer/subjects/graff/mri/orig.mgz mrisFindNeighbors: /usr/local/freesurfer/subjects/graff/surf/rh.inner-skull-surface: face[0].v[0] = 0, but face 0 not in vertex 0 face list
What should I do so that the cut surface is interpreted as surface for import in matlab and electrode projection?
Octavian
Dear Bruce,
Thank you for your assist. I see the difference between patch and surface, but I would need to get he cut surface in matlab. I do not know how to set the ripflag=1 for x<0. Here is the code I use to upload surfaces in Matlab:
function [vertex_coords, faces] = read_surf(fname)
%QUAD_FILE_MAGIC_NUMBER = (-1 & 0x00ffffff) ; %NEW_QUAD_FILE_MAGIC_NUMBER = (-3 & 0x00ffffff) ; TRIANGLE_FILE_MAGIC_NUMBER = 16777214 ; QUAD_FILE_MAGIC_NUMBER = 16777215 ; fid = fopen(fname, 'rb', 'b') ; if (fid < 0) str = sprintf('could not open curvature file %s.', fname) ; error(str) ;
end magic = fread3(fid) ; if (magic == QUAD_FILE_MAGIC_NUMBER) vnum = fread3(fid) ; %number of vertices fnum = fread3(fid) ; %number of faces vertex_coords = fread(fid, vnum*3, 'int16') ./ 100 ; if (nargout > 1) for i=1:fnum for n=1:4 faces(i,n) = fread3(fid) ; end end end elseif (magic == TRIANGLE_FILE_MAGIC_NUMBER) fgets(fid) ; fgets(fid) ; vnum = fread(fid, 1, 'int32') ; %number of vertices fnum = fread(fid, 1, 'int32') ; %number of faces vertex_coords = fread(fid, vnum*3, 'float32') + 1 ; vertex_coords = reshape(vertex_coords, 3, vnum)'; faces = fread(fid, fnum*3, 'int32') + 1 ; faces = reshape(faces, 3, fnum)' ; end fclose(fid) ;
Can something be done with this, or do I need to transform the surface before importing it into matlab?
Thank you for your help
you should be able to use the read_patch.m that is in our matlab dir
cheers Bruce On Thu, 1 Nov 2012, octavian lie wrote:
Dear Bruce, Thank you for your assist. I see the difference between patch and surface, but I would need to get he cut surface in matlab. I do not know how to set the ripflag=1 for x<0. Here is the code I use to upload surfaces in Matlab: function [vertex_coords, faces] = read_surf(fname)
%QUAD_FILE_MAGIC_NUMBER = (-1 & 0x00ffffff) ; %NEW_QUAD_FILE_MAGIC_NUMBER = (-3 & 0x00ffffff) ; TRIANGLE_FILE_MAGIC_NUMBER = 16777214 ; QUAD_FILE_MAGIC_NUMBER = 16777215 ; fid = fopen(fname, 'rb', 'b') ; if (fid < 0) str = sprintf('could not open curvature file %s.', fname) ; error(str) ;
end magic = fread3(fid) ; if (magic == QUAD_FILE_MAGIC_NUMBER) vnum = fread3(fid) ; %number of vertices fnum = fread3(fid) ; %number of faces vertex_coords = fread(fid, vnum*3, 'int16') ./ 100 ; if (nargout > 1) for i=1:fnum for n=1:4 faces(i,n) = fread3(fid) ; end end end elseif (magic == TRIANGLE_FILE_MAGIC_NUMBER) fgets(fid) ; fgets(fid) ; vnum = fread(fid, 1, 'int32') ; %number of vertices fnum = fread(fid, 1, 'int32') ; %number of faces vertex_coords = fread(fid, vnum*3, 'float32') + 1 ; vertex_coords = reshape(vertex_coords, 3, vnum)'; faces = fread(fid, fnum*3, 'int32') + 1 ; faces = reshape(faces, 3, fnum)' ; end fclose(fid) ; Can something be done with this, or do I need to transform the surface before importing it into matlab? Thank you for your help
freesurfer@nmr.mgh.harvard.edu