I. I use read_surf.m to import the pial surface into MATLAB: [cort.vert cort.tri]=read_surf('SUB1/surf/lh.pial');
2. I make a completely grey color map for the surface: map=repmat([1 1 1]*.7,length(cort.vert),1);
3. I load the label into MATLAB: inlabel=read_label('SUB1','res_FINAL');
4. I change the color map values of the vertices in the label to red: map(inlabel(:,1),:)=inlabel([1 0 0],size(inlabel,1),1);
5. I plot the surface using tripatch.m tripatch(cort,1,map);
You can download a MATLAB figure that shows all the vertices of the surface color coded by label (red=label, black=non-label) from here:
http://www.cogsci.ucsd.edu/~dgroppe/label_vertices.fig
If you rotate the figure you can see that some black vertices are interleaved in parts of the label area. thanks again, -David
On Sun, Jun 3, 2012 at 5:23 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
hmmm, and how are you displaying it in the second (patchy) view? I don't think tksurfer fills any holes by default
Bruce
On Sun, 3 Jun 2012, David Groppe wrote:
Thanks for the nigh-instantaneous response Bruce. None of the entries have -1 for a vertex number in the first column (see attached). The smallest value is 75. -David
On Sun, Jun 3, 2012 at 5:10 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
do any of the label entries have -1 for a vertex number in the first column? If so, tksurfer will sample it onto the surface finding the nearest surface vertex.
On Sun, 3 Jun 2012, David Groppe wrote:
Hi FreeSurfers, I am attempting to plot a label in MATLAB using the function read_label.m. The label was produced in tksurfer (see label_tksurfer.jpg) from a mask created by FSL. When I try to import the label into MATLAB via read_label.m, I get the correct number of nonzero vertices (i.e., the same number reported by tksurfer when I load the label). However the resulting plot is spotty (see label_matlab.jpg). I suspect that some vertices that are colored as the label in tksurfer are not actually part of the label file (i.e., tksurfer is automatically doing some filling in that I'm not aware of). Is this true? Any tips on how to solve the problem would be greatly appreciated. much thanks, -David
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.
-- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/
Do you change the vertex indices together 1-based in matlab? I don't see it...
Bruce
On Jun 3, 2012, at 9:06 PM, David Groppe david.m.groppe@gmail.com wrote:
I. I use read_surf.m to import the pial surface into MATLAB: [cort.vert cort.tri]=read_surf('SUB1/surf/lh.pial');
- I make a completely grey color map for the surface:
map=repmat([1 1 1]*.7,length(cort.vert),1);
- I load the label into MATLAB:
inlabel=read_label('SUB1','res_FINAL');
- I change the color map values of the vertices in the label to red:
map(inlabel(:,1),:)=inlabel([1 0 0],size(inlabel,1),1);
- I plot the surface using tripatch.m
tripatch(cort,1,map);
You can download a MATLAB figure that shows all the vertices of the surface color coded by label (red=label, black=non-label) from here:
http://www.cogsci.ucsd.edu/~dgroppe/label_vertices.fig
If you rotate the figure you can see that some black vertices are interleaved in parts of the label area. thanks again, -David
On Sun, Jun 3, 2012 at 5:23 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
hmmm, and how are you displaying it in the second (patchy) view? I don't think tksurfer fills any holes by default
Bruce
On Sun, 3 Jun 2012, David Groppe wrote:
Thanks for the nigh-instantaneous response Bruce. None of the entries have -1 for a vertex number in the first column (see attached). The smallest value is 75. -David
On Sun, Jun 3, 2012 at 5:10 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
do any of the label entries have -1 for a vertex number in the first column? If so, tksurfer will sample it onto the surface finding the nearest surface vertex.
On Sun, 3 Jun 2012, David Groppe wrote:
Hi FreeSurfers, I am attempting to plot a label in MATLAB using the function read_label.m. The label was produced in tksurfer (see label_tksurfer.jpg) from a mask created by FSL. When I try to import the label into MATLAB via read_label.m, I get the correct number of nonzero vertices (i.e., the same number reported by tksurfer when I load the label). However the resulting plot is spotty (see label_matlab.jpg). I suspect that some vertices that are colored as the label in tksurfer are not actually part of the label file (i.e., tksurfer is automatically doing some filling in that I'm not aware of). Is this true? Any tips on how to solve the problem would be greatly appreciated. much thanks, -David
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.
-- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/
-- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/
THAT was the problem. Thanks so much Bruce. I owe you one. -David
On Sunday, June 3, 2012, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
Do you change the vertex indices together 1-based in matlab? I don't see
it...
Bruce
On Jun 3, 2012, at 9:06 PM, David Groppe david.m.groppe@gmail.com wrote:
I. I use read_surf.m to import the pial surface into MATLAB: [cort.vert cort.tri]=read_surf('SUB1/surf/lh.pial');
- I make a completely grey color map for the surface:
map=repmat([1 1 1]*.7,length(cort.vert),1);
- I load the label into MATLAB:
inlabel=read_label('SUB1','res_FINAL');
- I change the color map values of the vertices in the label to red:
map(inlabel(:,1),:)=inlabel([1 0 0],size(inlabel,1),1);
- I plot the surface using tripatch.m
tripatch(cort,1,map);
You can download a MATLAB figure that shows all the vertices of the surface color coded by label (red=label, black=non-label) from here:
http://www.cogsci.ucsd.edu/~dgroppe/label_vertices.fig
If you rotate the figure you can see that some black vertices are
interleaved
in parts of the label area. thanks again, -David
On Sun, Jun 3, 2012 at 5:23 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu
wrote:
hmmm, and how are you displaying it in the second (patchy) view? I
don't
think tksurfer fills any holes by default
Bruce
On Sun, 3 Jun 2012, David Groppe wrote:
Thanks for the nigh-instantaneous response Bruce. None of the entries have -1 for a vertex number in the first column (see attached). The smallest value is 75. -David
On Sun, Jun 3, 2012 at 5:10 PM, Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
wrote:
do any of the label entries have -1 for a vertex number in the first column? If so, tksurfer will sample it onto the surface finding the nearest surface vertex.
On Sun, 3 Jun 2012, David Groppe wrote:
> Hi FreeSurfers, > I am attempting to plot a label in MATLAB using the function > read_label.m. The label was produced in tksurfer (see > label_tksurfer.jpg) from a mask created by FSL. When I try to
import
> the label into MATLAB via read_label.m, I get the correct number of > nonzero vertices (i.e., the same number reported by tksurfer when I > load the label). However the resulting plot is spotty (see > label_matlab.jpg). I suspect that some vertices that are colored as > the label in tksurfer are not actually part of the label file (i.e., > tksurfer is automatically doing some filling in that I'm not aware > of). Is this true? > Any tips on how to solve the problem would be greatly
appreciated.
> much thanks, > -David > >
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.
sure. Happy to help Bruce On Mon, 4 Jun 2012, David Groppe wrote:
THAT was the problem. Thanks so much Bruce. I owe you one. -David
On Sunday, June 3, 2012, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
Do you change the vertex indices together 1-based in matlab? I don't see
it...
Bruce
On Jun 3, 2012, at 9:06 PM, David Groppe david.m.groppe@gmail.com wrote:
I. I use read_surf.m to import the pial surface into MATLAB: [cort.vert cort.tri]=read_surf('SUB1/surf/lh.pial');
- I make a completely grey color map for the surface:
map=repmat([1 1 1]*.7,length(cort.vert),1);
- I load the label into MATLAB:
inlabel=read_label('SUB1','res_FINAL');
- I change the color map values of the vertices in the label to red:
map(inlabel(:,1),:)=inlabel([1 0 0],size(inlabel,1),1);
- I plot the surface using tripatch.m
tripatch(cort,1,map);
You can download a MATLAB figure that shows all the vertices of the surface color coded by label (red=label, black=non-label) from here:
http://www.cogsci.ucsd.edu/~dgroppe/label_vertices.fig
If you rotate the figure you can see that some black vertices are
interleaved
in parts of the label area. thanks again, -David
On Sun, Jun 3, 2012 at 5:23 PM, Bruce Fischl
fischl@nmr.mgh.harvard.edu wrote:
hmmm, and how are you displaying it in the second (patchy) view? I
don't
think tksurfer fills any holes by default
Bruce
On Sun, 3 Jun 2012, David Groppe wrote:
Thanks for the nigh-instantaneous response Bruce. None of the entries have -1 for a vertex number in the first column (see attached). The smallest value is 75. -David
On Sun, Jun 3, 2012 at 5:10 PM, Bruce Fischl
wrote: > > do any of the label entries have -1 for a vertex number in the first > column? > If so, tksurfer will sample it onto the surface finding the nearest > surface > vertex. > > > On Sun, 3 Jun 2012, David Groppe wrote: > >> Hi FreeSurfers, >> I am attempting to plot a label in MATLAB using the function >> read_label.m. The label was produced in tksurfer (see >> label_tksurfer.jpg) from a mask created by FSL. When I try to
import
>> the label into MATLAB via read_label.m, I get the correct number of >> nonzero vertices (i.e., the same number reported by tksurfer when I >> load the label). However the resulting plot is spotty (see >> label_matlab.jpg). I suspect that some vertices that are colored as >> the label in tksurfer are not actually part of the label file (i.e., >> tksurfer is automatically doing some filling in that I'm not aware >> of). Is this true? >> Any tips on how to solve the problem would be greatly
appreciated.
>> much thanks, >> -David >> >> > > > 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. >
-- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/
freesurfer@nmr.mgh.harvard.edu