Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
1) I would like to know how to view the time-varying solution over the cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single 'frame' of data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original cortex? For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a 140000x1x1x500 volume!
2) I wish to view the average data across several subjects, mapped onto the fsaverage subject template. I have seen that mris_preproc can warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
Many thanks in advance,
Padraig
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution over the
cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single 'frame' of data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original cortex? For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a 140000x1x1x500 volume!
You can't do this with the mgh format. You can use compressed mgh (mgz), and that will compress all the 0s, but that probably does not take you where you need to be. How are you decimating your data? One way would be to create a decimated average subject with a lower order icosahedron and then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that mris_preproc can warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames will be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for time-varying data (MEG) CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution over the
cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single 'frame' of data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original cortex? For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a 140000x1x1x500 volume!
You can't do this with the mgh format. You can use compressed mgh (mgz), and that will compress all the 0s, but that probably does not take you where you need to be. How are you decimating your data? One way would be to create a decimated average subject with a lower order icosahedron and then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that mris_preproc can warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames will be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_________________________________________________________________ Climb to the top of the charts! Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Hi Don, have you tried using mri_surf2surf with --mapmethod nnf ? That will prevent the interpolation and map each ico4 to the nearest ico7.
doug
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for time-varying
data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution over
the
cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single
'frame' of
data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original
cortex?
For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a
140000x1x1x500
volume!
You can't do this with the mgh format. You can use compressed mgh
(mgz),
and that will compress all the 0s, but that probably does not take you where you need to be. How are you decimating your data? One way
would be
to create a decimated average subject with a lower order icosahedron
and
then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that mris_preproc
can
warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames will be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now! http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Hi Doug,
No, I haven't tried it for this, but I have read the help before. It says this: "If nnf is chosen, then the value at the target vertex is set to that of the closest source vertex."
If you wanted to go from a sparsely valued single subject surface (i.e. decimated dipoles) to ico4, it seems that you would probably miss many of your dipole vertices because they wouldn't necessarily be the ones closest to the ico4 vertices. Going from decimated dipoles to ico7 may work ok, although you may still miss a few dipoles, which is why smoothing before sampling to ico seems to be a good idea. And we have to smooth anyway before doing group analysis because the ico7 vertices that correspond to a single subject's decimated dipoles will vary from subject to subject.
If we chose our decimated dipoles based on ico4, we do could group analysis without any smoothing on a much smaller number of vertices.
Don
Date: Tue, 22 Jan 2008 17:01:45 -0500 From: greve@nmr.mgh.harvard.edu To: dhaglerjr@hotmail.com Subject: Re: [Freesurfer] Creating average overlays for time-varying data (MEG) CC: p.kitterick@psych.york.ac.uk; freesurfer@nmr.mgh.harvard.edu
Hi Don, have you tried using mri_surf2surf with --mapmethod nnf ? That will prevent the interpolation and map each ico4 to the nearest ico7.
doug
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500
From: greve@nmr.mgh.harvard.edu
To: p.kitterick@psych.york.ac.uk
Subject: Re: [Freesurfer] Creating average overlays for
time-varying data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum
norm)
overlayed on the cortical surface, both at an individual and
group
level. I have successfully processed all of the participants
MRIs
using recon-all, and have decimated the cortical surface
(white) to
compute the MEG solution. I would be grateful if anyone could
help
with the following issues I have run into:
- I would like to know how to view the time-varying solution
over the
cortex using tksurfer. I have successfully exported the
overlay for a
single sample to a .w file (using matlab), and then smoothed
it
(mri_surf2surf) and viewed it on the cortical surface, which
works
great. But I am aware that .w format only supports a single
'frame' of
data. Some previous posts on the list suggest that exporting
the data
in .mgh format as a nverts x 1 x 1 x nsamples volume would
allow
visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for
the
vertices with values (i.e. left after decimation) when using
the mgh
format, and not a matrix of the total vertices in the
original cortex?
For example, if the surface has N vertices, and after
decimation I
have M vertices left, using the .w format I only need to
write out
data for the M vertices, along with a list of the vertex
numbers to
place them on the original surface. Can I do this with .mgh?
It is
difficult to get matlab to write out an mgh file with a
140000x1x1x500
volume!
You can't do this with the mgh format. You can use compressed mgh
(mgz),
and that will compress all the 0s, but that probably does not take
you
where you need to be. How are you decimating your data? One way
would be
to create a decimated average subject with a lower order
icosahedron and
then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects,
mapped
onto the fsaverage subject template. I have seen that
mris_preproc can
warp one or more overlays onto a single subject. My question
is: will
mris_preproc work with the type of .mgh files I described
above, i.e.
containing multiple frames of data overlay? Or am I better
trying to
do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames
will
be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422
In order to help us help you, please follow the steps in:
surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now!
A question related to this: is it possible to take a surface overlay (.w format) containing a set number of vertices, all with the same value, in one subject space and warp it to another subject while keeping the same number of vertices? I would like to try to define a set of source points on an average surface, and then warp those points back to each individual subject for source analysis. Perhaps the 'ico' option of mri_surf2surf solves this problem, but I am not fully clear on how that works. Any pointers to documentation on this would be most appreciated.
I have tried using mri_surf2surf to achieve this, but I either end up with too little (nnf) or too many vertices (nnfr) on the target surface. I have had some problems with resampling a sparse set of individual data points to an average surface and smoothing (on source or target surfaces), as the smoothing seems to introduce entirely new foci of activity, particularly around the insula. Therefore, I am trying to find a way to have a set of common source points so that smoothing can be avoided until the final step to display the data.
Thanks in advance,
P.
Don Hagler wrote:
If you wanted to go from a sparsely valued single subject surface (i.e. decimated dipoles) to ico4, it seems that you would probably miss many of your dipole vertices because they wouldn't necessarily be the ones closest to the ico4 vertices. Going from decimated dipoles to ico7 may work ok, although you may still miss a few dipoles, which is why smoothing before sampling to ico seems to be a good idea. And we have to smooth anyway before doing group analysis because the ico7 vertices that correspond to a single subject's decimated dipoles will vary from subject to subject.
To resample from ico4, use --srcsubject ico --srcicoorder 4
If you use nnf, some of the source vertices may not get sampled. If you use nnfr, you should get clusters of vertices for every ico4 vertex. You should be able to find the clusters and then pick the vertex with max intensity for each cluster. That set of max intensity vertices defines the mapping between ico 4 and the single subject.
If you do this, you can use the mgh format and then display directly on an ico4 surface. Doug mentioned that you could somehow create a downsampled average subject.
If you get this working, please let me know.
Date: Tue, 29 Jan 2008 00:25:08 +0000 From: p.kitterick@psych.york.ac.uk To: dhaglerjr@hotmail.com Subject: Re: [Freesurfer] Creating average overlays for time-varying data (MEG) CC: freesurfer@nmr.mgh.harvard.edu
A question related to this: is it possible to take a surface overlay (.w format) containing a set number of vertices, all with the same value, in one subject space and warp it to another subject while keeping the same number of vertices? I would like to try to define a set of source points on an average surface, and then warp those points back to each individual subject for source analysis. Perhaps the 'ico' option of mri_surf2surf solves this problem, but I am not fully clear on how that works. Any pointers to documentation on this would be most appreciated.
I have tried using mri_surf2surf to achieve this, but I either end up with too little (nnf) or too many vertices (nnfr) on the target surface. I have had some problems with resampling a sparse set of individual data points to an average surface and smoothing (on source or target surfaces), as the smoothing seems to introduce entirely new foci of activity, particularly around the insula. Therefore, I am trying to find a way to have a set of common source points so that smoothing can be avoided until the final step to display the data.
Thanks in advance,
P.
Don Hagler wrote:
If you wanted to go from a sparsely valued single subject surface (i.e. decimated dipoles) to ico4, it seems that you would probably miss many of your dipole vertices because they wouldn't necessarily be the ones closest to the ico4 vertices. Going from decimated dipoles to ico7 may work ok, although you may still miss a few dipoles, which is why smoothing before sampling to ico seems to be a good idea. And we have to smooth anyway before doing group analysis because the ico7 vertices that correspond to a single subject's decimated dipoles will vary from subject to subject.
-- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK
Tel: +44 (0) 1904 43 3170 Email: p.kitterick@psych.york.ac.uk _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail®-get your "fix". http://www.msnmobilefix.com/Default.aspx
Hi Don,
I think you can use --ico with make_average_subject to set the order of the icosahedron used (default=7).
cheers, Bruce
On Tue, 29 Jan 2008, Don Hagler wrote:
To resample from ico4, use --srcsubject ico --srcicoorder 4
If you use nnf, some of the source vertices may not get sampled. If you use nnfr, you should get clusters of vertices for every ico4 vertex. You should be able to find the clusters and then pick the vertex with max intensity for each cluster. That set of max intensity vertices defines the mapping between ico 4 and the single subject.
If you do this, you can use the mgh format and then display directly on an ico4 surface. Doug mentioned that you could somehow create a downsampled average subject.
If you get this working, please let me know.
Date: Tue, 29 Jan 2008 00:25:08 +0000 From: p.kitterick@psych.york.ac.uk To: dhaglerjr@hotmail.com Subject: Re: [Freesurfer] Creating average overlays for time-varying data (MEG) CC: freesurfer@nmr.mgh.harvard.edu
A question related to this: is it possible to take a surface overlay (.w format) containing a set number of vertices, all with the same value, in one subject space and warp it to another subject while keeping the same number of vertices? I would like to try to define a set of source points on an average surface, and then warp those points back to each individual subject for source analysis. Perhaps the 'ico' option of mri_surf2surf solves this problem, but I am not fully clear on how that works. Any pointers to documentation on this would be most appreciated.
I have tried using mri_surf2surf to achieve this, but I either end up with too little (nnf) or too many vertices (nnfr) on the target surface. I have had some problems with resampling a sparse set of individual data points to an average surface and smoothing (on source or target surfaces), as the smoothing seems to introduce entirely new foci of activity, particularly around the insula. Therefore, I am trying to find a way to have a set of common source points so that smoothing can be avoided until the final step to display the data.
Thanks in advance,
P.
Don Hagler wrote:
If you wanted to go from a sparsely valued single subject surface (i.e. decimated dipoles) to ico4, it seems that you would probably miss many of your dipole vertices because they wouldn't necessarily be the ones closest to the ico4 vertices. Going from decimated dipoles to ico7 may work ok, although you may still miss a few dipoles, which is why smoothing before sampling to ico seems to be a good idea. And we have to smooth anyway before doing group analysis because the ico7 vertices that correspond to a single subject's decimated dipoles will vary from subject to subject.
-- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK
Tel: +44 (0) 1904 43 3170 Email: p.kitterick@psych.york.ac.uk _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Need to know the score, the latest news, or you need your Hotmail®-get your "fix". http://www.msnmobilefix.com/Default.aspx
Dear Don and Doug,
Thank you for the suggestions. I have devised a workflow by using .w files for each timepoint/subject, and then using mri_surf2surf/mri_concat to average across participants. Ideally, I would like to use a study-specific average, so this approach will permit that.
I do find that having to use .mgh volume files for some of the operations for surface data less than ideal. Are there plans to support the .stc format in the freesurfer tools?
Many thanks again,
Padraig
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for time-varying
data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution over the
cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single 'frame' of data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original cortex? For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a 140000x1x1x500 volume!
You can't do this with the mgh format. You can use compressed mgh (mgz), and that will compress all the 0s, but that probably does not take you where you need to be. How are you decimating your data? One way would be to create a decimated average subject with a lower order icosahedron and then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that mris_preproc can warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames will be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now! http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
I'm not even sure what stc is. Is that the multi-frame .w file?
Pádraig Kitterick wrote:
Dear Don and Doug,
Thank you for the suggestions. I have devised a workflow by using .w files for each timepoint/subject, and then using mri_surf2surf/mri_concat to average across participants. Ideally, I would like to use a study-specific average, so this approach will permit that.
I do find that having to use .mgh volume files for some of the operations for surface data less than ideal. Are there plans to support the .stc format in the freesurfer tools?
Many thanks again,
Padraig
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for
time-varying data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution
over the
cortex using tksurfer. I have successfully exported the overlay
for a
single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single
'frame' of
data. Some previous posts on the list suggest that exporting the
data
in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the
mgh
format, and not a matrix of the total vertices in the original
cortex?
For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a
140000x1x1x500
volume!
You can't do this with the mgh format. You can use compressed mgh
(mgz),
and that will compress all the 0s, but that probably does not take
you
where you need to be. How are you decimating your data? One way
would be
to create a decimated average subject with a lower order
icosahedron and
then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that
mris_preproc can
warp one or more overlays onto a single subject. My question is:
will
mris_preproc work with the type of .mgh files I described above,
i.e.
containing multiple frames of data overlay? Or am I better
trying to
do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames
will
be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now! http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Yes, that's it exactly. It contains a start time in ms for the data, a timepoint length in ms, the IDs for the vertices and the vert x timepoint data matrix. It's read in by the mne_analyze tool from the MGH MEG/minimum-norm toolkit. The matlab toolkit included with the MGH MEG distribution includes read/write functions for it.
Padraig
Doug Greve wrote:
I'm not even sure what stc is. Is that the multi-frame .w file?
Pádraig Kitterick wrote:
Dear Don and Doug,
Thank you for the suggestions. I have devised a workflow by using .w files for each timepoint/subject, and then using mri_surf2surf/mri_concat to average across participants. Ideally, I would like to use a study-specific average, so this approach will permit that.
I do find that having to use .mgh volume files for some of the operations for surface data less than ideal. Are there plans to support the .stc format in the freesurfer tools?
Many thanks again,
Padraig
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for
time-varying data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution
over the
cortex using tksurfer. I have successfully exported the overlay
for a
single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single
'frame' of
data. Some previous posts on the list suggest that exporting the
data
in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the
mgh
format, and not a matrix of the total vertices in the original
cortex?
For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a
140000x1x1x500
volume!
You can't do this with the mgh format. You can use compressed mgh
(mgz),
and that will compress all the 0s, but that probably does not take
you
where you need to be. How are you decimating your data? One way
would be
to create a decimated average subject with a lower order
icosahedron and
then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that
mris_preproc can
warp one or more overlays onto a single subject. My question is:
will
mris_preproc work with the type of .mgh files I described above,
i.e.
containing multiple frames of data overlay? Or am I better
trying to
do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames
will
be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now! http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
As a final note on this, I have found an alternative way of creating .mgh overlay files with multiple frames from data in matlab. Some test reveal that writing out a data matrix of approx. 140000x1x1x400 in size takes >2gb memory and quite a long time (at least on my machine) in Matlab. To avoid this, I now write the data out in the previously mentioned .stc format (see MGH MEG toolkit for the script), which is just a multiframe .w file, and therefore only contains data from represented surface points. This is fast and efficient to do. To allow further analysis with the freesurfer tools, I have put together a script in Python which converts the sparse .stc file to an .mgh volume. It also fills in the surface points not used in the .stc file with zeros. The process for the same size matrix takes <1gb ram and takes about 15secs!
If anyone is doing MEG analysis in Matlab on a sparse set of surface points, and wants to export them to .mgh for smoothing or warping to an average subject, this script may well be helpful, particularly for those without high-end machines. Please feel to send me an email if you are interested and I'll gladly pass it on.
Padraig
Don Hagler wrote:
If you have problems writing out mgh files with 140000x1x1x500 volumes, maybe you need more memory (>=2GB?). Or a 64 bit machine? Or you could downsample your time courses if you haven't already.
I do use matlab to convert decimated source time course files (stc) to mgh. Before writing out the mgh file, I do sparse smoothing (10+ steps) followed by regular smoothing (10+ steps) on each frame. It is slow, but works fine on 64 bit machines with 2GB RAM. It probably works on 32 bit machines too, but I haven't used one in awhile. The largest number of frames I've tried is 450.
Resampling to ico7 for group averaging is straightforward with mri_surf2surf. I do group analysis one frame at time to conserve memory.
I don't think using mri_surf2surf to resample sparse data to ico4 (for example) would work well because of interpolation with neighboring zero values (but I haven't tried it).
An option that I am considering is to start with ico4 vertices and sample them to each subject in order to choose which vertices should be the set of "decimated" dipoles. The complication here is that mri_surf2surf does not give a one-to-one mapping between ico vertices and single subject vertices. I think it would be necessary to derive a look-up-table for each subject to provide such a one-to-one mapping. Then the ico resampling would be done not with mri_surf2surf, but with a matlab script that consults the look-up-table.
For display purposes, I guess you would still need to create an ico4 average subject.
Date: Mon, 21 Jan 2008 16:08:41 -0500 From: greve@nmr.mgh.harvard.edu To: p.kitterick@psych.york.ac.uk Subject: Re: [Freesurfer] Creating average overlays for time-varying
data (MEG)
CC: freesurfer@nmr.mgh.harvard.edu
Pádraig Kitterick wrote:
Dear list,
I am trying to use freesurfer to visualise MEG data (minimum norm) overlayed on the cortical surface, both at an individual and group level. I have successfully processed all of the participants MRIs using recon-all, and have decimated the cortical surface (white) to compute the MEG solution. I would be grateful if anyone could help with the following issues I have run into:
- I would like to know how to view the time-varying solution over the
cortex using tksurfer. I have successfully exported the overlay for a single sample to a .w file (using matlab), and then smoothed it (mri_surf2surf) and viewed it on the cortical surface, which works great. But I am aware that .w format only supports a single 'frame' of data. Some previous posts on the list suggest that exporting the data in .mgh format as a nverts x 1 x 1 x nsamples volume would allow visualisation of the timecourse in tksurfer.
My question is: is there a way to only write out the data for the vertices with values (i.e. left after decimation) when using the mgh format, and not a matrix of the total vertices in the original cortex? For example, if the surface has N vertices, and after decimation I have M vertices left, using the .w format I only need to write out data for the M vertices, along with a list of the vertex numbers to place them on the original surface. Can I do this with .mgh? It is difficult to get matlab to write out an mgh file with a 140000x1x1x500 volume!
You can't do this with the mgh format. You can use compressed mgh (mgz), and that will compress all the 0s, but that probably does not take you where you need to be. How are you decimating your data? One way would be to create a decimated average subject with a lower order icosahedron and then use that as the target for mri_surf2surf.
- I wish to view the average data across several subjects, mapped
onto the fsaverage subject template. I have seen that mris_preproc can warp one or more overlays onto a single subject. My question is: will mris_preproc work with the type of .mgh files I described above, i.e. containing multiple frames of data overlay? Or am I better trying to do the whole operation with .w files, with one per timepoint?
You can do it with multiple frame input (though the output frames will be a stack of original frames from all the subjects).
doug
Many thanks in advance,
Padraig
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Climb to the top of the charts! Play the word scramble challenge with star power. Play now! http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
freesurfer@nmr.mgh.harvard.edu