External Email - Use Caution
Dear Freesurfer community,
I obtained score matrices of surfaces after performing diffusion embedding map on fMRI data.
I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare between two groups.
After obtaining the p-value map, I would like to label the surface in order to identify the regions of significant difference between both groups.
Would it be possible to use Freview in order to do it? If so, which format should I use for my SurfStatP output p-value map? How would you do it, (tools to convert into a specific format, surfaces and atlas to load on Freeview, which format for those ones)? I would be very grateful if you could detail a bit, as I am new to these tools!
Thanks in advance,
Loïc Daumail
External Email - Use Caution
Also, one more thing:
My data is on fsaverage5 resolution.
Thanks in advance,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 09:49, Loïc Daumail loic.daumail@gmail.com a écrit :
Dear Freesurfer community,
I obtained score matrices of surfaces after performing diffusion embedding map on fMRI data.
I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare between two groups.
After obtaining the p-value map, I would like to label the surface in order to identify the regions of significant difference between both groups.
Would it be possible to use Freview in order to do it? If so, which format should I use for my SurfStatP output p-value map? How would you do it, (tools to convert into a specific format, surfaces and atlas to load on Freeview, which format for those ones)? I would be very grateful if you could detail a bit, as I am new to these tools!
Thanks in advance,
Loïc Daumail
Hi Loic
if you are on the fsaverage surface you can save the -log10(p) values using save_mgh.m, then load them in freeview and threshold them or whatever
cheers Bruce On Mon, 20 May 2019, Loïc Daumail wrote:
External Email - Use Caution
Also, one more thing:
My data is on fsaverage5 resolution.
Thanks in advance,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 09:49, Loïc Daumail loic.daumail@gmail.com a écrit : Dear Freesurfer community,
I obtained score matrices of surfaces after performing diffusion embedding map on fMRI data.
I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare between two groups.
After obtaining the p-value map, I would like to label the surface in order to identify the regions of significant difference between both groups.
Would it be possible to use Freview in order to do it? If so, which format should I use for my SurfStatP output p-value map? How would you do it, (tools to convert into a specific format, surfaces and atlas to load on Freeview, which format for those ones)? I would be very grateful if you could detail a bit, as I am new to these tools!
Thanks in advance,
Loïc Daumail
External Email - Use Caution
Hi Bruce,
Thanks for your response. Is it also fine for fsaverage5 surface or I need to switch my data to fsaverage?
Thanks,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 15:52, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
Hi Loic
if you are on the fsaverage surface you can save the -log10(p) values using save_mgh.m, then load them in freeview and threshold them or whatever
cheers Bruce On Mon, 20 May 2019, Loïc Daumail wrote:
External Email - Use CautionAlso, one more thing:
My data is on fsaverage5 resolution.
Thanks in advance,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 09:49, Loïc Daumail loic.daumail@gmail.com a
écrit :
Dear Freesurfer community,I obtained score matrices of surfaces after performing diffusion
embedding map on fMRI data.
I am now using the SurfStat toolbox(Matlab) in order to obtain p-value
maps to compare between
two groups.
After obtaining the p-value map, I would like to label the surface in
order to identify the
regions of significant difference between both groups.
Would it be possible to use Freview in order to do it? If so, which format should I use for my SurfStatP output p-value map? How would you do it, (tools to convert into a specific format, surfaces
and atlas to load on
Freeview, which format for those ones)? I would be very grateful if you could detail a bit, as I am new to these
tools!
Thanks in advance,
Loïc Daumail
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
sure. All the fsaverages are in the same space (they are subsets of fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce,
Thanks for your response. Is it also fine for fsaverage5 surface or I need to switch my data to fsaverage?
Thanks,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 15:52, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit : Hi Loic
if you are on the fsaverage surface you can save the -log10(p) values using save_mgh.m, then load them in freeview and threshold them or whatever cheers Bruce On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Also, one more thing: > > My data is on fsaverage5 resolution. > > Thanks in advance, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit : > Dear Freesurfer community, > > I obtained score matrices of surfaces after performing diffusion embedding map on fMRI data. > > I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare between > two groups. > > After obtaining the p-value map, I would like to label the surface in order to identify the > regions of significant difference between both groups. > > Would it be possible to use Freview in order to do it? > If so, which format should I use for my SurfStatP output p-value map? > How would you do it, (tools to convert into a specific format, surfaces and atlas to load on > Freeview, which format for those ones)? > I would be very grateful if you could detail a bit, as I am new to these tools! > > Thanks in advance, > > Loïc Daumail > > >_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in order to label my surfaces? Is their format compatible? I saw surfstat only accepts a limited array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
sure. All the fsaverages are in the same space (they are subsets of fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
Thanks for your response. Is it also fine for fsaverage5 surface or I
need to switch my data to
fsaverage?
Thanks,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 15:52, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
Hi Loic if you are on the fsaverage surface you can save the -log10(p)values
using save_mgh.m, then load them in freeview and threshold them or whatever cheers Bruce On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Also, one more thing: > > My data is on fsaverage5 resolution. > > Thanks in advance, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Dear Freesurfer community, > > I obtained score matrices of surfaces after performing diffusionembedding map on fMRI
data. > > I am now using the SurfStat toolbox(Matlab) in order to obtainp-value maps to compare
between > two groups. > > After obtaining the p-value map, I would like to label thesurface in order to
identify the > regions of significant difference between both groups. > > Would it be possible to use Freview in order to do it? > If so, which format should I use for my SurfStatP output p-valuemap?
> How would you do it, (tools to convert into a specific format,surfaces and atlas to
load on > Freeview, which format for those ones)? > I would be very grateful if you could detail a bit, as I am newto these tools!
> > Thanks in advance, > > Loïc Daumail > > >_______________________________________________ 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
External Email - Use Caution
Hi Loïc,
you can load the atlases using `read_annotation` in Matlab, then of course use them for whatever purpose you like (including in surfstat). This code should get you started:
subjects_dir = '/data/mystudy'; subject_id = 'subject1'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end
To color the regions in surfstat, you would then need to set a colormap that has the correct number of colors (36 for Desikan, I think), using the colortable variable.
Best,
Tim
On May 23, 2019 at 11:35 AM Loïc Daumail loic.daumail@gmail.com wrote:
External Email - Use CautionHi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in order to label my surfaces? Is their format compatible? I saw surfstat only accepts a limited array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
sure. All the fsaverages are in the same space (they are subsets of fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
Thanks for your response. Is it also fine for fsaverage5 surface or I
need to switch my data to
fsaverage?
Thanks,
Sincerely,
Loïc
Le lun. 20 mai 2019 à 15:52, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
Hi Loic if you are on the fsaverage surface you can save the -log10(p)values
using save_mgh.m, then load them in freeview and threshold them or whatever cheers Bruce On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Also, one more thing: > > My data is on fsaverage5 resolution. > > Thanks in advance, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Dear Freesurfer community, > > I obtained score matrices of surfaces after performing diffusionembedding map on fMRI
data. > > I am now using the SurfStat toolbox(Matlab) in order to obtainp-value maps to compare
between > two groups. > > After obtaining the p-value map, I would like to label thesurface in order to
identify the > regions of significant difference between both groups. > > Would it be possible to use Freview in order to do it? > If so, which format should I use for my SurfStatP output p-valuemap?
> How would you do it, (tools to convert into a specific format,surfaces and atlas to
load on > Freeview, which format for those ones)? > I would be very grateful if you could detail a bit, as I am newto these tools!
> > Thanks in advance, > > Loïc Daumail > > >_______________________________________________ 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone else on the list knows? I don't. You can label surfaces manually with the dev version of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in order to label my surfaces? Is their format compatible? I saw surfstat only accepts a limited array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit : sure. All the fsaverages are in the same space (they are subsets of fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote:
> > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5 surface or I need to switch my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit : > Hi Loic > > if you are on the fsaverage surface you can save the -log10(p) values > using save_mgh.m, then load them in freeview and threshold them or > whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit : > > Dear Freesurfer community, > > > > I obtained score matrices of surfaces after performing diffusion embedding map on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare > between > > two groups. > > > > After obtaining the p-value map, I would like to label the surface in order to > identify the > > regions of significant difference between both groups. > > > > Would it be possible to use Freview in order to do it? > > If so, which format should I use for my SurfStatP output p-value map? > > How would you do it, (tools to convert into a specific format, surfaces and atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail a bit, as I am new to these tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > 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
External Email - Use Caution
Afaik SurfStat is not maintained anymore and I think it's been this way for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says 'Updated 26 September 2008'. I'm not sure whether that's really true, but at least for the last 14 months (the only time frame I know about), there have not been any changes to that website or any new releases of SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone else on the list knows? I don't. You can label surfaces manually with the dev version of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in order to label my surfaces? Is their format compatible? I saw surfstat only accepts a limited array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit : sure. All the fsaverages are in the same space (they are subsets of fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote:
> > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5 surface or I need to switch my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit : > Hi Loic > > if you are on the fsaverage surface you can save the -log10(p) values > using save_mgh.m, then load them in freeview and threshold them or > whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit : > > Dear Freesurfer community, > > > > I obtained score matrices of surfaces after performing diffusion embedding map on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) in order to obtain p-value maps to compare > between > > two groups. > > > > After obtaining the p-value map, I would like to label the surface in order to > identify the > > regions of significant difference between both groups. > > > > Would it be possible to use Freview in order to do it? > > If so, which format should I use for my SurfStatP output p-value map? > > How would you do it, (tools to convert into a specific format, surfaces and atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail a bit, as I am new to these tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
External Email - Use Caution
Hi Tim,
Thanks a lot for your help, indeed, this is exactly what I needed! I wrote this : " subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; subject_id = 'sub-004'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end fig1 = figure(); SurfStatView(mean_rest, surf.b); SurfStatColormap(colortable.table(:,1:3)/255); " However, the image I obtain seems a bit fuzzy...( see attached) Is it because of my data?
Thanks in advance,
Loïc
Le jeu. 23 mai 2019 à 17:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionAfaik SurfStat is not maintained anymore and I think it's been this way for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says 'Updated 26 September 2008'. I'm not sure whether that's really true, but at least for the last 14 months (the only time frame I know about), there have not been any changes to that website or any new releases of SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl fischl@nmr.mgh.harvard.edu
wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone else on
the
list knows? I don't. You can label surfaces manually with the dev
version
of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in
order to label my surfaces?
Is their format compatible? I saw surfstat only accepts a limited
array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
sure. All the fsaverages are in the same space (they are subsetsof
fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5surface or I need to switch
my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit :
> Hi Loic > > if you are on the fsaverage surface you can save the-log10(p) values
> using save_mgh.m, then load them in freeview andthreshold them or
> whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> > Dear Freesurfer community, > > > > I obtained score matrices of surfaces after performingdiffusion embedding map
on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) in orderto obtain p-value maps to
compare > between > > two groups. > > > > After obtaining the p-value map, I would like to labelthe surface in order to
> identify the > > regions of significant difference between both groups. > > > > Would it be possible to use Freview in order to do it? > > If so, which format should I use for my SurfStatPoutput p-value map?
> > How would you do it, (tools to convert into a specificformat, surfaces and
atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail a bit, asI am new to these
tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Loïc,
that does not look correct, the data is definitely off. I'm not sure where the variables `mean_rest` and `surf.b` come from in your code, and I suspect that something is wrong with them.
In the meantime, I got interested in this myself and put together some code that will load the Desikan data for both hemispheres and display it in surfstat. Feel free to use it, there also is an example screenshot of the results:
https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best,
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
On May 27, 2019 at 11:01 AM Loïc Daumail loic.daumail@gmail.com wrote:
External Email - Use CautionHi Tim,
Thanks a lot for your help, indeed, this is exactly what I needed! I wrote this : " subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; subject_id = 'sub-004'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end fig1 = figure(); SurfStatView(mean_rest, surf.b); SurfStatColormap(colortable.table(:,1:3)/255); " However, the image I obtain seems a bit fuzzy...( see attached) Is it because of my data?
Thanks in advance,
Loïc
Le jeu. 23 mai 2019 à 17:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionAfaik SurfStat is not maintained anymore and I think it's been this way for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says 'Updated 26 September 2008'. I'm not sure whether that's really true, but at least for the last 14 months (the only time frame I know about), there have not been any changes to that website or any new releases of SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl fischl@nmr.mgh.harvard.edu
wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone else on
the
list knows? I don't. You can label surfaces manually with the dev
version
of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in surfstat in
order to label my surfaces?
Is their format compatible? I saw surfstat only accepts a limited
array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
sure. All the fsaverages are in the same space (they are subsetsof
fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5surface or I need to switch
my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit :
> Hi Loic > > if you are on the fsaverage surface you can save the-log10(p) values
> using save_mgh.m, then load them in freeview andthreshold them or
> whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> > Dear Freesurfer community, > > > > I obtained score matrices of surfaces after performingdiffusion embedding map
on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) in orderto obtain p-value maps to
compare > between > > two groups. > > > > After obtaining the p-value map, I would like to labelthe surface in order to
> identify the > > regions of significant difference between both groups. > > > > Would it be possible to use Freview in order to do it? > > If so, which format should I use for my SurfStatPoutput p-value map?
> > How would you do it, (tools to convert into a specificformat, surfaces and
atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail a bit, asI am new to these
tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
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
External Email - Use Caution
Hi Tim,
'mean_rest' is a diffusion embedding map, which contains scores for every vertex on fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionHi Loïc,
that does not look correct, the data is definitely off. I'm not sure where the variables `mean_rest` and `surf.b` come from in your code, and I suspect that something is wrong with them.
In the meantime, I got interested in this myself and put together some code that will load the Desikan data for both hemispheres and display it in surfstat. Feel free to use it, there also is an example screenshot of the results:
https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best,
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
On May 27, 2019 at 11:01 AM Loïc Daumail loic.daumail@gmail.com wrote:
External Email - Use CautionHi Tim,
Thanks a lot for your help, indeed, this is exactly what I needed! I wrote this : " subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; subject_id = 'sub-004'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end fig1 = figure(); SurfStatView(mean_rest, surf.b); SurfStatColormap(colortable.table(:,1:3)/255); " However, the image I obtain seems a bit fuzzy...( see attached) Is it because of my data?
Thanks in advance,
Loïc
Le jeu. 23 mai 2019 à 17:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionAfaik SurfStat is not maintained anymore and I think it's been this way for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it
says
'Updated 26 September 2008'. I'm not sure whether that's really true,
but
at least for the last 14 months (the only time frame I know about),
there
have not been any changes to that website or any new releases of
SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl fischl@nmr.mgh.harvard.edu
wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone else
on
the
list knows? I don't. You can label surfaces manually with the dev
version
of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in
surfstat in
order to label my surfaces?
Is their format compatible? I saw surfstat only accepts a limited
array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
a écrit :
sure. All the fsaverages are in the same space (they aresubsets
of
fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5surface or I need to switch
my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit :
> Hi Loic > > if you are on the fsaverage surface you can save the-log10(p) values
> using save_mgh.m, then load them in freeview andthreshold them or
> whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> > Dear Freesurfer community, > > > > I obtained score matrices of surfaces afterperforming
diffusion embedding map
on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) inorder
to obtain p-value maps to
compare > between > > two groups. > > > > After obtaining the p-value map, I would like tolabel
the surface in order to
> identify the > > regions of significant difference between bothgroups.
> > > > Would it be possible to use Freview in order to doit?
> > If so, which format should I use for my SurfStatPoutput p-value map?
> > How would you do it, (tools to convert into aspecific
format, surfaces and
atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail abit, as
I am new to these
tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main,
Germany
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Tim,
Your link works perfectly, it's awesome! Thanks a lot,
Best,
Loïc
Le lun. 27 mai 2019 à 11:43, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Tim,
'mean_rest' is a diffusion embedding map, which contains scores for every vertex on fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionHi Loïc,
that does not look correct, the data is definitely off. I'm not sure where the variables `mean_rest` and `surf.b` come from in your code, and I suspect that something is wrong with them.
In the meantime, I got interested in this myself and put together some code that will load the Desikan data for both hemispheres and display it in surfstat. Feel free to use it, there also is an example screenshot of the results:
https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best,
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
On May 27, 2019 at 11:01 AM Loïc Daumail loic.daumail@gmail.com
wrote:
External Email - Use CautionHi Tim,
Thanks a lot for your help, indeed, this is exactly what I needed! I wrote this : " subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; subject_id = 'sub-004'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end fig1 = figure(); SurfStatView(mean_rest, surf.b); SurfStatColormap(colortable.table(:,1:3)/255); " However, the image I obtain seems a bit fuzzy...( see attached) Is it because of my data?
Thanks in advance,
Loïc
Le jeu. 23 mai 2019 à 17:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionAfaik SurfStat is not maintained anymore and I think it's been this
way
for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it
says
'Updated 26 September 2008'. I'm not sure whether that's really true,
but
at least for the last 14 months (the only time frame I know about),
there
have not been any changes to that website or any new releases of
SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu
wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone
else on
the
list knows? I don't. You can label surfaces manually with the dev
version
of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am coming back to this request as I was wondering: would it be possible to load freesurfer surface atlases in
surfstat in
order to label my surfaces?
Is their format compatible? I saw surfstat only accepts a limited
array of formats...
Thanks, Best,
Loïc
Le lun. 20 mai 2019 à 16:15, Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
a écrit :
sure. All the fsaverages are in the same space (they aresubsets
of
fsaverage) On Mon, 20 May 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > Thanks for your response. Is it also fine for fsaverage5surface or I need to switch
my data to > fsaverage? > > Thanks, > > Sincerely, > > Loïc > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <fischl@nmr.mgh.harvard.edu> a écrit :
> Hi Loic > > if you are on the fsaverage surface you can save the-log10(p) values
> using save_mgh.m, then load them in freeview andthreshold them or
> whatever > > cheers > Bruce > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Also, one more thing: > > > > My data is on fsaverage5 resolution. > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> > Dear Freesurfer community, > > > > I obtained score matrices of surfaces afterperforming
diffusion embedding map
on fMRI > data. > > > > I am now using the SurfStat toolbox(Matlab) inorder
to obtain p-value maps to
compare > between > > two groups. > > > > After obtaining the p-value map, I would like tolabel
the surface in order to
> identify the > > regions of significant difference between bothgroups.
> > > > Would it be possible to use Freview in order todo it?
> > If so, which format should I use for my SurfStatPoutput p-value map?
> > How would you do it, (tools to convert into aspecific
format, surfaces and
atlas to > load on > > Freeview, which format for those ones)? > > I would be very grateful if you could detail abit, as
I am new to these
tools! > > > > Thanks in advance, > > > > Loïc Daumail > > > > > >_______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > >_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.eduhttps://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
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main,
Germany
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Bruce,
I am reaching out to you, as I am trying to load the surface scalar values of diffusion embedding for overlay on a pial surface in Freeview.
I used save_mgh to save a scalar matrix containing surface embedding values in an .mgz format. However I can't load it in freeview, be either only half of the matrix data (one hemisphere I assume) or the whole matrix saved in the same file.
Is there anything specific I need to do in order to be able to visualize a scalar overlay on a surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or .mgh. I am not even sure save_mgh can do all this...
Thanks in advance,
Sincerely,
Loïc
Le lun. 27 mai 2019 à 11:54, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Tim,
Your link works perfectly, it's awesome! Thanks a lot,
Best,
Loïc
Le lun. 27 mai 2019 à 11:43, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Tim,
'mean_rest' is a diffusion embedding map, which contains scores for every vertex on fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionHi Loïc,
that does not look correct, the data is definitely off. I'm not sure where the variables `mean_rest` and `surf.b` come from in your code, and I suspect that something is wrong with them.
In the meantime, I got interested in this myself and put together some code that will load the Desikan data for both hemispheres and display it in surfstat. Feel free to use it, there also is an example screenshot of the results:
https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best,
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
On May 27, 2019 at 11:01 AM Loïc Daumail loic.daumail@gmail.com
wrote:
External Email - Use CautionHi Tim,
Thanks a lot for your help, indeed, this is exactly what I needed! I wrote this : " subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; subject_id = 'sub-004'; hemi = 'lh';
aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', sprintf("%s.aparc.annot", hemi)); [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); fprintf("Read aparc parcellation file '%s' containing %d regions.\n", aparc_file_this_hemi, length(colortable.struct_names)); for sidx = 1:length(colortable.struct_names) region = colortable.struct_names{sidx}; struct_code = colortable.table(sidx, 5); vertices_of_struct_roi = find(label == struct_code); fprintf("Found region '%s' with %d verts.\n", region, length(vertices_of_struct_roi)); end fig1 = figure(); SurfStatView(mean_rest, surf.b); SurfStatColormap(colortable.table(:,1:3)/255); " However, the image I obtain seems a bit fuzzy...( see attached) Is it because of my data?
Thanks in advance,
Loïc
Le jeu. 23 mai 2019 à 17:20, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionAfaik SurfStat is not maintained anymore and I think it's been this
way
for quite a while now. Maybe someone else knows better?
The website is at http://www.math.mcgill.ca/keith/surfstat/ and it
says
'Updated 26 September 2008'. I'm not sure whether that's really
true, but
at least for the last 14 months (the only time frame I know about),
there
have not been any changes to that website or any new releases of
SurfStat.
Tim
On May 23, 2019 at 4:36 PM Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
wrote:
Hi Loic
sorry, can you ask whoever maintains surfstat? Or maybe someone
else on
the
list knows? I don't. You can label surfaces manually with the dev
version
of freeview if you want.
cheers Bruce
On Thu, 23 May 2019, Loïc Daumail wrote:
> > External Email - Use Caution > > Hi Bruce, > > I am coming back to this request as I was wondering: > would it be possible to load freesurfer surface atlases in
surfstat in
order to label my surfaces?
> Is their format compatible? I saw surfstat only accepts a limited
array of formats...
> > Thanks, > Best, > > Loïc > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
a écrit :
> sure. All the fsaverages are in the same space (they are
subsets
of
> fsaverage) > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Hi Bruce, > > > > Thanks for your response. Is it also fine for fsaverage5
surface or I need to switch
> my data to > > fsaverage? > > > > Thanks, > > > > Sincerely, > > > > Loïc > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl <
fischl@nmr.mgh.harvard.edu> a écrit :
> > Hi Loic > > > > if you are on the fsaverage surface you can save
the
-log10(p) values
> > using save_mgh.m, then load them in freeview and
threshold them or
> > whatever > > > > cheers > > Bruce > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > External Email - Use Caution > > > > > > Also, one more thing: > > > > > > My data is on fsaverage5 resolution. > > > > > > Thanks in advance, > > > > > > Sincerely, > > > > > > Loïc > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail <
loic.daumail@gmail.com> a écrit :
> > > Dear Freesurfer community, > > > > > > I obtained score matrices of surfaces after
performing
diffusion embedding map
> on fMRI > > data. > > > > > > I am now using the SurfStat toolbox(Matlab) in
order
to obtain p-value maps to
> compare > > between > > > two groups. > > > > > > After obtaining the p-value map, I would like to
label
the surface in order to
> > identify the > > > regions of significant difference between both
groups.
> > > > > > Would it be possible to use Freview in order to
do it?
> > > If so, which format should I use for my SurfStatP
output p-value map?
> > > How would you do it, (tools to convert into a
specific
format, surfaces and
> atlas to > > load on > > > Freeview, which format for those ones)? > > > I would be very grateful if you could detail a
bit, as
I am new to these
> tools! > > > > > > Thanks in advance, > > > > > > Loïc Daumail > > > > > > > > >_______________________________________________ > > 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
> > >_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main,
Germany
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe
cheers Bruce
On Thu, 20 Jun 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce,
I am reaching out to you, as I am trying to load the surface scalar values of diffusion embedding for overlay on a pial surface in Freeview.
I used save_mgh to save a scalar matrix containing surface embedding values in an .mgz format. However I can't load it in freeview, be either only half of the matrix data (one hemisphere I assume) or the whole matrix saved in the same file.
Is there anything specific I need to do in order to be able to visualize a scalar overlay on a surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or .mgh. I am not even sure save_mgh can do all this...
Thanks in advance,
Sincerely,
Loïc
Le lun. 27 mai 2019 à 11:54, Loïc Daumail loic.daumail@gmail.com a écrit : Hi Tim,
Your link works perfectly, it's awesome! Thanks a lot,
Best,
Loïc
Le lun. 27 mai 2019 à 11:43, Loïc Daumail loic.daumail@gmail.com a écrit : Hi Tim,
'mean_rest' is a diffusion embedding map, which contains scores for every vertex on fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit : External Email - Use Caution
Hi Loïc, that does not look correct, the data is definitely off. I'm not sure where the variables `mean_rest` and `surf.b` come from in your code, and I suspect that something is wrong with them. In the meantime, I got interested in this myself and put together some code that will load the Desikan data for both hemispheres and display it in surfstat. Feel free to use it, there also is an example screenshot of the results: https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desikan Best, Tim -- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote: > > > External Email - Use Caution > > Hi Tim, > > Thanks a lot for your help, indeed, this is exactly what I needed! > I wrote this : > " > subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; > subject_id = 'sub-004'; > hemi = 'lh'; > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', > sprintf("%s.aparc.annot", hemi)); > [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); > fprintf("Read aparc parcellation file '%s' containing %d regions.\n", > aparc_file_this_hemi, length(colortable.struct_names)); > for sidx = 1:length(colortable.struct_names) > region = colortable.struct_names{sidx}; > struct_code = colortable.table(sidx, 5); > vertices_of_struct_roi = find(label == struct_code); > fprintf("Found region '%s' with %d verts.\n", region, > length(vertices_of_struct_roi)); > end > fig1 = figure(); > SurfStatView(mean_rest, surf.b); > SurfStatColormap(colortable.table(:,1:3)/255); > " > However, the image I obtain seems a bit fuzzy...( see attached) > Is it because of my data? > > Thanks in advance, > > Loïc > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit : > > > External Email - Use Caution > > > > Afaik SurfStat is not maintained anymore and I think it's been this way > > for quite a while now. Maybe someone else knows better? > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says > > 'Updated 26 September 2008'. I'm not sure whether that's really true, but > > at least for the last 14 months (the only time frame I know about), there > > have not been any changes to that website or any new releases of SurfStat. > > > > Tim > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > wrote: > > > > > > > > > Hi Loic > > > > > > sorry, can you ask whoever maintains surfstat? Or maybe someone else on > > the > > > list knows? I don't. You can label surfaces manually with the dev > > version > > > of freeview if you want. > > > > > > cheers > > > Bruce > > > > > > > > > On Thu, 23 May 2019, Loïc > > > Daumail wrote: > > > > > > > > > > > External Email - Use Caution > > > > > > > > Hi Bruce, > > > > > > > > I am coming back to this request as I was wondering: > > > > would it be possible to load freesurfer surface atlases in surfstat in > > order to label my surfaces? > > > > Is their format compatible? I saw surfstat only accepts a limited > > array of formats... > > > > > > > > Thanks, > > > > Best, > > > > > > > > Loïc > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > a écrit : > > > > sure. All the fsaverages are in the same space (they are subsets > > of > > > > fsaverage) > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > Thanks for your response. Is it also fine for fsaverage5 > > surface or I need to switch > > > > my data to > > > > > fsaverage? > > > > > > > > > > Thanks, > > > > > > > > > > Sincerely, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > Hi Loic > > > > > > > > > > if you are on the fsaverage surface you can save the > > -log10(p) values > > > > > using save_mgh.m, then load them in freeview and > > threshold them or > > > > > whatever > > > > > > > > > > cheers > > > > > Bruce > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > loic.daumail@gmail.com> a écrit : > > > > > > Dear Freesurfer community, > > > > > > > > > > > > I obtained score matrices of surfaces after performing > > diffusion embedding map > > > > on fMRI > > > > > data. > > > > > > > > > > > > I am now using the SurfStat toolbox(Matlab) in order > > to obtain p-value maps to > > > > compare > > > > > between > > > > > > two groups. > > > > > > > > > > > > After obtaining the p-value map, I would like to label > > the surface in order to > > > > > identify the > > > > > > regions of significant difference between both groups. > > > > > > > > > > > > Would it be possible to use Freview in order to do it? > > > > > > If so, which format should I use for my SurfStatP > > output p-value map? > > > > > > How would you do it, (tools to convert into a specific > > format, surfaces and > > > > atlas to > > > > > load on > > > > > > Freeview, which format for those ones)? > > > > > > I would be very grateful if you could detail a bit, as > > I am new to these > > > > tools! > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > 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 > > > > > > > > > > > >_______________________________________________ > > > Freesurfer mailing list > > > Freesurfer@nmr.mgh.harvard.edu > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > -- > > Dr. Tim Schäfer > > Postdoc Computational Neuroimaging > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > Psychotherapy > > University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > > > > _______________________________________________ > > 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 _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Bruce,
Thanks for your tip. Unfortunately, I am still running through an error... I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining elements with zeros, and also tried with rand().
The other issue is that I am not so sure which part of the matrix is for lh and the other one for rh. Thus, I divided 18715/2 and took the 9357 first elements of the 18715 matrix. Then filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with freeview using the following command line: freeview -f ~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by loic Fri Jun 21 12:15:53 2019 [0]PETSC ERROR: Libraries linked from /autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/linux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe
cheers Bruce
On Thu, 20 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am reaching out to you, as I am trying to load the surface scalar
values of diffusion embedding
for overlay on a pial surface in Freeview.
I used save_mgh to save a scalar matrix containing surface embedding
values in an .mgz format.
However I can't load it in freeview, be either only half of the matrix
data (one hemisphere I
assume) or the whole matrix saved in the same file.
Is there anything specific I need to do in order to be able to visualize
a scalar overlay on a
surface? Is .mgz a wrong format for scalar values? I also tried with
.nii.gz, or .mgh. I am not even
sure save_mgh can do all this...
Thanks in advance,
Sincerely,
Loïc
Le lun. 27 mai 2019 à 11:54, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Tim,Your link works perfectly, it's awesome! Thanks a lot,
Best,
Loïc
Le lun. 27 mai 2019 à 11:43, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Tim,'mean_rest' is a diffusion embedding map, which contains scores for
every vertex on
fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also
tried forjust
lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit : External Email - Use Caution
Hi Loïc, that does not look correct, the data is definitely off. I'm notsure where
the variables `mean_rest` and `surf.b` come from in your code, andI suspect
that something is wrong with them. In the meantime, I got interested in this myself and put togethersome code
that will load the Desikan data for both hemispheres and displayit in
surfstat. Feel free to use it, there also is an example screenshotof the
results:https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best, Tim -- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt amMain, Germany
> On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com>wrote:
> > > External Email - Use Caution > > Hi Tim, > > Thanks a lot for your help, indeed, this is exactly what Ineeded!
> I wrote this : > " > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> subject_id = 'sub-004'; > hemi = 'lh'; > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id,'label',
> sprintf("%s.aparc.annot", hemi)); > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> fprintf("Read aparc parcellation file '%s' containing %dregions.\n",
> aparc_file_this_hemi, length(colortable.struct_names)); > for sidx = 1:length(colortable.struct_names) > region = colortable.struct_names{sidx}; > struct_code = colortable.table(sidx, 5); > vertices_of_struct_roi = find(label == struct_code); > fprintf("Found region '%s' with %d verts.\n", region, > length(vertices_of_struct_roi)); > end > fig1 = figure(); > SurfStatView(mean_rest, surf.b); > SurfStatColormap(colortable.table(:,1:3)/255); > " > However, the image I obtain seems a bit fuzzy...( see attached) > Is it because of my data? > > Thanks in advance, > > Loïc > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> > > External Email - Use Caution > > > > Afaik SurfStat is not maintained anymore and I think it's beenthis way
> > for quite a while now. Maybe someone else knows better? > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/and it says
> > 'Updated 26 September 2008'. I'm not sure whether that'sreally true,
but > > at least for the last 14 months (the only time frame I knowabout),
there > > have not been any changes to that website or any new releasesof
SurfStat. > > > > Tim > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > wrote: > > > > > > > > > Hi Loic > > > > > > sorry, can you ask whoever maintains surfstat? Or maybesomeone else
on > > the > > > list knows? I don't. You can label surfaces manually withthe dev
> > version > > > of freeview if you want. > > > > > > cheers > > > Bruce > > > > > > > > > On Thu, 23 May 2019, Loïc > > > Daumail wrote: > > > > > > > > > > > External Email - Use Caution > > > > > > > > Hi Bruce, > > > > > > > > I am coming back to this request as I was wondering: > > > > would it be possible to load freesurfer surface atlases insurfstat
in > > order to label my surfaces? > > > > Is their format compatible? I saw surfstat only accepts alimited
> > array of formats... > > > > > > > > Thanks, > > > > Best, > > > > > > > > Loïc > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > a écrit : > > > > sure. All the fsaverages are in the same space (theyare
subsets > > of > > > > fsaverage) > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > Thanks for your response. Is it also fine forfsaverage5
> > surface or I need to switch > > > > my data to > > > > > fsaverage? > > > > > > > > > > Thanks, > > > > > > > > > > Sincerely, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > Hi Loic > > > > > > > > > > if you are on the fsaverage surface you cansave the
> > -log10(p) values > > > > > using save_mgh.m, then load them in freeviewand
> > threshold them or > > > > > whatever > > > > > > > > > > cheers > > > > > Bruce > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > loic.daumail@gmail.com> a écrit : > > > > > > Dear Freesurfer community, > > > > > > > > > > > > I obtained score matrices of surfaces after performing > > diffusion embedding map > > > > on fMRI > > > > > data. > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in order
> > to obtain p-value maps to > > > > compare > > > > > between > > > > > > two groups. > > > > > > > > > > > > After obtaining the p-value map, I wouldlike to
label > > the surface in order to > > > > > identify the > > > > > > regions of significant difference betweenboth
groups. > > > > > > > > > > > > Would it be possible to use Freview inorder to do
it? > > > > > > If so, which format should I use for mySurfStatP
> > output p-value map? > > > > > > How would you do it, (tools to convertinto a
specific > > format, surfaces and > > > > atlas to > > > > > load on > > > > > > Freeview, which format for those ones)? > > > > > > I would be very grateful if you coulddetail a bit,
as > > I am new to these > > > > tools! > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > >
> > > > > 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
> > > > > > > > > > > >_______________________________________________ > > > Freesurfer mailing list > > > Freesurfer@nmr.mgh.harvard.edu > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > -- > > Dr. Tim Schäfer > > Postdoc Computational Neuroimaging > > Department of Child and Adolescent Psychiatry, Psychosomaticsand
> > Psychotherapy > > University Hospital Frankfurt, Goethe University Frankfurt amMain,
Germany > > > > _______________________________________________ > > 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 _______________________________________________ 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
External Email - Use Caution
Me again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/lh_emb_' char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Bruce,
Thanks for your tip. Unfortunately, I am still running through an error... I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining elements with zeros, and also tried with rand().
The other issue is that I am not so sure which part of the matrix is for lh and the other one for rh. Thus, I divided 18715/2 and took the 9357 first elements of the 18715 matrix. Then filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with freeview using the following command line: freeview -f ~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by loic Fri Jun 21 12:15:53 2019 [0]PETSC ERROR: Libraries linked from /autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/linux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 [0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe
cheers Bruce
On Thu, 20 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionHi Bruce,
I am reaching out to you, as I am trying to load the surface scalar
values of diffusion embedding
for overlay on a pial surface in Freeview.
I used save_mgh to save a scalar matrix containing surface embedding
values in an .mgz format.
However I can't load it in freeview, be either only half of the matrix
data (one hemisphere I
assume) or the whole matrix saved in the same file.
Is there anything specific I need to do in order to be able to
visualize a scalar overlay on a
surface? Is .mgz a wrong format for scalar values? I also tried with
.nii.gz, or .mgh. I am not even
sure save_mgh can do all this...
Thanks in advance,
Sincerely,
Loïc
Le lun. 27 mai 2019 à 11:54, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Tim,Your link works perfectly, it's awesome! Thanks a lot,
Best,
Loïc
Le lun. 27 mai 2019 à 11:43, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Tim,'mean_rest' is a diffusion embedding map, which contains scores for
every vertex on
fsaverage5 surface resolution. 'surf.b' is the pial surface of both hemispheres of fsaverage5... I
also tried forjust
lh hemisphere, but it gives me the same result...
Thanks for the link!
Best,
Loïc
Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org a écrit : External Email - Use Caution
Hi Loïc, that does not look correct, the data is definitely off. I'm notsure where
the variables `mean_rest` and `surf.b` come from in your code,and I suspect
that something is wrong with them. In the meantime, I got interested in this myself and put togethersome code
that will load the Desikan data for both hemispheres and displayit in
surfstat. Feel free to use it, there also is an examplescreenshot of the
results:https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
Best, Tim -- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt amMain, Germany
> On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > External Email - Use Caution > > Hi Tim, > > Thanks a lot for your help, indeed, this is exactly what Ineeded!
> I wrote this : > " > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> subject_id = 'sub-004'; > hemi = 'lh'; > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id,'label',
> sprintf("%s.aparc.annot", hemi)); > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> fprintf("Read aparc parcellation file '%s' containing %dregions.\n",
> aparc_file_this_hemi, length(colortable.struct_names)); > for sidx = 1:length(colortable.struct_names) > region = colortable.struct_names{sidx}; > struct_code = colortable.table(sidx, 5); > vertices_of_struct_roi = find(label == struct_code); > fprintf("Found region '%s' with %d verts.\n", region, > length(vertices_of_struct_roi)); > end > fig1 = figure(); > SurfStatView(mean_rest, surf.b); > SurfStatColormap(colortable.table(:,1:3)/255); > " > However, the image I obtain seems a bit fuzzy...( see attached) > Is it because of my data? > > Thanks in advance, > > Loïc > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> > > External Email - Use Caution > > > > Afaik SurfStat is not maintained anymore and I think it'sbeen this way
> > for quite a while now. Maybe someone else knows better? > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/and it says
> > 'Updated 26 September 2008'. I'm not sure whether that'sreally true,
but > > at least for the last 14 months (the only time frame I knowabout),
there > > have not been any changes to that website or any new releasesof
SurfStat. > > > > Tim > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > wrote: > > > > > > > > > Hi Loic > > > > > > sorry, can you ask whoever maintains surfstat? Or maybesomeone else
on > > the > > > list knows? I don't. You can label surfaces manually withthe dev
> > version > > > of freeview if you want. > > > > > > cheers > > > Bruce > > > > > > > > > On Thu, 23 May 2019, Loïc > > > Daumail wrote: > > > > > > > > > > > External Email - Use Caution > > > > > > > > Hi Bruce, > > > > > > > > I am coming back to this request as I was wondering: > > > > would it be possible to load freesurfer surface atlasesin surfstat
in > > order to label my surfaces? > > > > Is their format compatible? I saw surfstat only accepts alimited
> > array of formats... > > > > > > > > Thanks, > > > > Best, > > > > > > > > Loïc > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > a écrit : > > > > sure. All the fsaverages are in the same space(they are
subsets > > of > > > > fsaverage) > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > Thanks for your response. Is it also fine forfsaverage5
> > surface or I need to switch > > > > my data to > > > > > fsaverage? > > > > > > > > > > Thanks, > > > > > > > > > > Sincerely, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > Hi Loic > > > > > > > > > > if you are on the fsaverage surface you cansave the
> > -log10(p) values > > > > > using save_mgh.m, then load them infreeview and
> > threshold them or > > > > > whatever > > > > > > > > > > cheers > > > > > Bruce > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail<
> > loic.daumail@gmail.com> a écrit : > > > > > > Dear Freesurfer community, > > > > > > > > > > > > I obtained score matrices of surfacesafter
performing > > diffusion embedding map > > > > on fMRI > > > > > data. > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in order
> > to obtain p-value maps to > > > > compare > > > > > between > > > > > > two groups. > > > > > > > > > > > > After obtaining the p-value map, I wouldlike to
label > > the surface in order to > > > > > identify the > > > > > > regions of significant difference betweenboth
groups. > > > > > > > > > > > > Would it be possible to use Freview inorder to do
it? > > > > > > If so, which format should I use for mySurfStatP
> > output p-value map? > > > > > > How would you do it, (tools to convertinto a
specific > > format, surfaces and > > > > atlas to > > > > > load on > > > > > > Freeview, which format for those ones)? > > > > > > I would be very grateful if you coulddetail a bit,
as > > I am new to these > > > > tools! > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > >
> > > > > 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
> > > > > > > > > > > >_______________________________________________ > > > Freesurfer mailing list > > > Freesurfer@nmr.mgh.harvard.edu > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > -- > > Dr. Tim Schäfer > > Postdoc Computational Neuroimaging > > Department of Child and Adolescent Psychiatry, Psychosomaticsand
> > Psychotherapy > > University Hospital Frankfurt, Goethe University Frankfurt amMain,
Germany > > > > _______________________________________________ > > 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 _______________________________________________ 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
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use Caution
Me again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/lh_emb_' char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M); Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com a écrit : Hi Bruce,
Thanks for your tip. Unfortunately, I am still running through an error... I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining elements with zeros, and also tried with rand().
The other issue is that I am not so sure which part of the matrix is for lh and the other one for rh. Thus, I divided 18715/2 and took the 9357 first elements of the 18715 matrix. Then filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with freeview using the following command line: freeview -f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh _format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by loic Fri Jun 21 12:15:53 2019 [0]PETSC ERROR: Libraries linked from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit : Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surface scalar values of diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surface embedding values in an .mgz format. > However I can't load it in freeview, be either only half of the matrix data (one hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able to visualize a scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or .mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit : > Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit : > Hi Tim, > > 'mean_rest' is a diffusion embedding map, which contains scores for every vertex on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> a écrit : > External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off. I'm not sure where > the variables `mean_rest` and `surf.b` come from in your code, and I suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and put together some code > that will load the Desikan data for both hemispheres and display it in > surfstat. Feel free to use it, there also is an example screenshot of the > results: > > > https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desikan > > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry, Psychosomatics and > Psychotherapy > University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote: > > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactly what I needed! > > I wrote this : > > " > > subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; > > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', > > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); > > fprintf("Read aparc parcellation file '%s' containing %d regions.\n", > > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label == struct_code); > > fprintf("Found region '%s' with %d verts.\n", region, > > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( see attached) > > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit : > > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I think it's been this way > > > for quite a while now. Maybe someone else knows better? > > > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says > > > 'Updated 26 September 2008'. I'm not sure whether that's really true, > but > > > at least for the last 14 months (the only time frame I know about), > there > > > have not been any changes to that website or any new releases of > SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Or maybe someone else > on > > > the > > > > list knows? I don't. You can label surfaces manually with the dev > > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I was wondering: > > > > > would it be possible to load freesurfer surface atlases in surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat only accepts a limited > > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the same space (they are > subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it also fine for fsaverage5 > > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaverage surface you can save the > > > -log10(p) values > > > > > > using save_mgh.m, then load them in freeview and > > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices of surfaces after > performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStat toolbox(Matlab) in order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map, I would like to > label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significant difference between both > groups. > > > > > > > > > > > > > > Would it be possible to use Freview in order to do > it? > > > > > > > If so, which format should I use for my SurfStatP > > > output p-value map? > > > > > > > How would you do it, (tools to convert into a > specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for those ones)? > > > > > > > I would be very grateful if you could detail a bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > > 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 > > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > > Psychotherapy > > > University Hospital Frankfurt, Goethe University Frankfurt am Main, > Germany > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > 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
External Email - Use Caution
Hi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay',
['/home/loic/Documents/emb_output/mgh_format/lh_emb_'
char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Bruce,Thanks for your tip. Unfortunately, I am still running through an
error...
I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining
elements with zeros, and
also tried with rand().
The other issue is that I am not so sure which part of the matrix is for
lh and the other one
for rh. Thus, I divided 18715/2 and took the 9357 first elements of the
18715 matrix. Then
filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with
freeview using the following
command line: freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access
out of range [0]PETSC ERROR: Try option -start_in_debugger or
-on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR:
or try http://valgrind.org on linux or man libgmalloc on Apple to find
memory corruption
errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link,
and run
[0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15
17:29:26 CDT 2008 HG
revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53
2019 [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc
--with-fc=g77
--download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3
CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
[0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
[unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
Hi Loïc the .mgz file should having dimensions nvertices x 1 x 1 forfreeview to
know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surfacescalar values of
diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surfaceembedding values in
an .mgz format. > However I can't load it in freeview, be either only half of thematrix data (one
hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able tovisualize a
scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I also triedwith .nii.gz, or
.mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > 'mean_rest' is a diffusion embedding map, which contains scoresfor every vertex
on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres offsaverage5... I also tried
forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off.I'm not sure where
> the variables `mean_rest` and `surf.b` come from in yourcode, and I
suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and puttogether some
code > that will load the Desikan data for both hemispheres anddisplay it in
> surfstat. Feel free to use it, there also is an examplescreenshot of the
> results: > > >https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry,Psychosomatics and
> Psychotherapy > University Hospital Frankfurt, Goethe University Frankfurtam Main,
Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactly whatI needed!
> > I wrote this : > > " > > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir,subject_id, 'label',
> > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> > fprintf("Read aparc parcellation file '%s' containing %dregions.\n",
> > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label == struct_code); > > fprintf("Found region '%s' with %d verts.\n", region, > > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( seeattached)
> > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org>a écrit :
> > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I thinkit's been this
way > > > for quite a while now. Maybe someone else knows better? > > > > > > The website is athttp://www.math.mcgill.ca/keith/surfstat/ and it
says > > > 'Updated 26 September 2008'. I'm not sure whetherthat's really true,
> but > > > at least for the last 14 months (the only time frame Iknow about),
> there > > > have not been any changes to that website or any newreleases of
> SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Ormaybe someone else
> on > > > the > > > > list knows? I don't. You can label surfaces manuallywith the dev
> > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I waswondering:
> > > > > would it be possible to load freesurfer surfaceatlases in
surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat onlyaccepts a limited
> > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the samespace (they are
> subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it also finefor fsaverage5
> > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaverage surfaceyou can save the
> > > -log10(p) values > > > > > > using save_mgh.m, then load them infreeview and
> > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumailwrote:
> > > > > > > > > > > > > > > > > > > > External Email - UseCaution
> > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5resolution.
> > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, LoïcDaumail <
> > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices ofsurfaces after
> performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in
order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map, Iwould like to
> label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significant differencebetween both
> groups. > > > > > > > > > > > > > > Would it be possible to useFreview in order to do
> it? > > > > > > > If so, which format should I usefor my SurfStatP
> > > output p-value map? > > > > > > > How would you do it, (tools toconvert into a
> specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for thoseones)?
> > > > > > > I would be very grateful if youcould detail a
bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > >
> > > > > > 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
> > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry,Psychosomatics and
> > > Psychotherapy > > > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
> Germany > > > > > > _______________________________________________ > > > 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
> > _______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl <fischl@nmr.mgh.harvard.edumailto:fischl@nmr.mgh.harvard.edu> a écrit : I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/lh_emb_' char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail <loic.daumail@gmail.commailto:loic.daumail@gmail.com> a écrit : Hi Bruce,
Thanks for your tip. Unfortunately, I am still running through an error... I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining elements with zeros, and also tried with rand().
The other issue is that I am not so sure which part of the matrix is for lh and the other one for rh. Thus, I divided 18715/2 and took the 9357 first elements of the 18715 matrix. Then filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with freeview using the following command line: freeview -f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh _format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by loic Fri Jun 21 12:15:53 2019 [0]PETSC ERROR: Libraries linked from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl <fischl@nmr.mgh.harvard.edumailto:fischl@nmr.mgh.harvard.edu> a écrit : Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surface scalar values of diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surface embedding values in an .mgz format. > However I can't load it in freeview, be either only half of the matrix data (one hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able to visualize a scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or .mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com<mailto:loic.daumail@gmail.com>> a écrit : > Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com<mailto:loic.daumail@gmail.com>> a écrit : > Hi Tim, > > 'mean_rest' is a diffusion embedding map, which contains scores for every vertex on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org<mailto:ts%2Bml@rcmd.org>> a écrit : > External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off. I'm not sure where > the variables `mean_rest` and `surf.b` come from in your code, and I suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and put together some code > that will load the Desikan data for both hemispheres and display it in > surfstat. Feel free to use it, there also is an example screenshot of the > results: > > > https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desikan > > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry, Psychosomatics and > Psychotherapy > University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com<mailto:loic.daumail@gmail.com>> wrote: > > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactly what I needed! > > I wrote this : > > " > > subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; > > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', > > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); > > fprintf("Read aparc parcellation file '%s' containing %d regions.\n", > > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label == struct_code); > > fprintf("Found region '%s' with %d verts.\n", region, > > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( see attached) > > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org<mailto:ts%2Bml@rcmd.org>> a écrit : > > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I think it's been this way > > > for quite a while now. Maybe someone else knows better? > > > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says > > > 'Updated 26 September 2008'. I'm not sure whether that's really true, > but > > > at least for the last 14 months (the only time frame I know about), > there > > > have not been any changes to that website or any new releases of > SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu<mailto:fischl@nmr.mgh.harvard.edu>> > > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Or maybe someone else > on > > > the > > > > list knows? I don't. You can label surfaces manually with the dev > > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I was wondering: > > > > > would it be possible to load freesurfer surface atlases in surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat only accepts a limited > > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu<mailto:fischl@nmr.mgh.harvard.edu>> > > > a écrit : > > > > > sure. All the fsaverages are in the same space (they are > subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it also fine for fsaverage5 > > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > > fischl@nmr.mgh.harvard.edu<mailto:fischl@nmr.mgh.harvard.edu>> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaverage surface you can save the > > > -log10(p) values > > > > > > using save_mgh.m, then load them in freeview and > > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > > loic.daumail@gmail.com<mailto:loic.daumail@gmail.com>> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices of surfaces after > performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStat toolbox(Matlab) in order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map, I would like to > label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significant difference between both > groups. > > > > > > > > > > > > > > Would it be possible to use Freview in order to do > it? > > > > > > > If so, which format should I use for my SurfStatP > > > output p-value map? > > > > > > > How would you do it, (tools to convert into a > specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for those ones)? > > > > > > > I would be very grateful if you could detail a bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > > Freesurfer mailing list > > > > > > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > > > > > > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > Freesurfer mailing list > > > > > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > > Psychotherapy > > > University Hospital Frankfurt, Goethe University Frankfurt am Main, > Germany > > > > > > _______________________________________________ > > > Freesurfer mailing list > > > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > _______________________________________________ > > Freesurfer mailing list > > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > >_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu<mailto: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
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Hi Doug,
Thanks for your help!
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ reading from lh.thickness... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 0, -1) k_ras = (0, 1, 0) writing to template.mgh... " There is progess though, as here, we see that template.mgh seems not empty: " mri_info template.mgh Volume information for template.mgh type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 0 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Also, using MRIread and MRIwrite, we can see that it's not empty neither:
" Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 1 x 10242 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -0.5, xend: 0.5 ystart: -5121.0, yend: 5121.0 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 5120.5000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -5120.5000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 "
But then, trying to load the overlay on the lh.pial still isn't possible, with endless "FreadFloat: fread failed"
Thanks in advance for your help,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < DGREVE@mgh.harvard.edu> a écrit :
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use CautionHi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay',
['/home/loic/Documents/emb_output/mgh_format/lh_emb_'
char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Bruce,Thanks for your tip. Unfortunately, I am still running through an
error...
I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining
elements with zeros, and
also tried with rand().
The other issue is that I am not so sure which part of the matrix is
for lh and the other one
for rh. Thus, I divided 18715/2 and took the 9357 first elements of the
18715 matrix. Then
filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with
freeview using the following
command line: freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access
out of range [0]PETSC ERROR: Try option -start_in_debugger or
-on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR:
or try http://valgrind.org on linux or man libgmalloc on Apple to find
memory corruption
errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link,
and run
[0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15
17:29:26 CDT 2008 HG
revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53
2019 [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc
--with-fc=g77
--download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3
CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
[0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
[unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
Hi Loïc the .mgz file should having dimensions nvertices x 1 x 1 forfreeview to
know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surfacescalar values of
diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surfaceembedding values in
an .mgz format. > However I can't load it in freeview, be either only half of thematrix data (one
hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able tovisualize a
scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I also triedwith .nii.gz, or
.mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > 'mean_rest' is a diffusion embedding map, which contains scoresfor every vertex
on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres offsaverage5... I also tried
forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off.I'm not sure where
> the variables `mean_rest` and `surf.b` come from in yourcode, and I
suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and puttogether some
code > that will load the Desikan data for both hemispheres anddisplay it in
> surfstat. Feel free to use it, there also is an examplescreenshot of the
> results: > > >https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry,Psychosomatics and
> Psychotherapy > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactlywhat I needed!
> > I wrote this : > > " > > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir,subject_id, 'label',
> > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> > fprintf("Read aparc parcellation file '%s' containing%d regions.\n",
> > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label ==struct_code);
> > fprintf("Found region '%s' with %d verts.\n",region,
> > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( seeattached)
> > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit :
> > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I thinkit's been this
way > > > for quite a while now. Maybe someone else knowsbetter?
> > > > > > The website is athttp://www.math.mcgill.ca/keith/surfstat/ and it
says > > > 'Updated 26 September 2008'. I'm not sure whetherthat's really true,
> but > > > at least for the last 14 months (the only time frameI know about),
> there > > > have not been any changes to that website or any newreleases of
> SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Ormaybe someone else
> on > > > the > > > > list knows? I don't. You can label surfacesmanually with the dev
> > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I waswondering:
> > > > > would it be possible to load freesurfer surfaceatlases in
surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat onlyaccepts a limited
> > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the samespace (they are
> subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it also finefor fsaverage5
> > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl<
> > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaverage surfaceyou can save the
> > > -log10(p) values > > > > > > using save_mgh.m, then load them infreeview and
> > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumailwrote:
> > > > > > > > > > > > > > > > > > > > External Email - UseCaution
> > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5resolution.
> > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, LoïcDaumail <
> > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices ofsurfaces after
> performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in
order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map,I would like to
> label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significant differencebetween both
> groups. > > > > > > > > > > > > > > Would it be possible to useFreview in order to do
> it? > > > > > > > If so, which format should I usefor my SurfStatP
> > > output p-value map? > > > > > > > How would you do it, (tools toconvert into a
> specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for thoseones)?
> > > > > > > I would be very grateful if youcould detail a
bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > >
> > > > > > 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
> > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry,Psychosomatics and
> > > Psychotherapy > > > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
> Germany > > > > > > _______________________________________________ > > > 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
> > _______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://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
External Email - Use Caution
I also tried saving the last file in 10242 x 1 x 1.. but nothing is coming neither.
Thanks,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 16:50, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Doug,
Thanks for your help!
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ reading from lh.thickness... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 0, -1) k_ras = (0, 1, 0) writing to template.mgh... " There is progess though, as here, we see that template.mgh seems not empty: " mri_info template.mgh Volume information for template.mgh type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 0 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Also, using MRIread and MRIwrite, we can see that it's not empty neither:
" Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 1 x 10242 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -0.5, xend: 0.5 ystart: -5121.0, yend: 5121.0 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 5120.5000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -5120.5000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 "
But then, trying to load the overlay on the lh.pial still isn't possible, with endless "FreadFloat: fread failed"
Thanks in advance for your help,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < DGREVE@mgh.harvard.edu> a écrit :
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use CautionHi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay',
['/home/loic/Documents/emb_output/mgh_format/lh_emb_'
char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com a
écrit :
Hi Bruce,Thanks for your tip. Unfortunately, I am still running through an
error...
I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining
elements with zeros, and
also tried with rand().
The other issue is that I am not so sure which part of the matrix is
for lh and the other one
for rh. Thus, I divided 18715/2 and took the 9357 first elements of
the 18715 matrix. Then
filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with
freeview using the following
command line: freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access
out of range [0]PETSC ERROR: Try option -start_in_debugger or
-on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR:
or try http://valgrind.org on linux or man libgmalloc on Apple to
find memory corruption
errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link,
and run
[0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15
17:29:26 CDT 2008 HG
revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53
2019 [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc
--with-fc=g77
--download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3
CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
[0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
[unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu
a écrit :
Hi Loïc the .mgz file should having dimensions nvertices x 1 x 1 forfreeview to
know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surfacescalar values of
diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surfaceembedding values in
an .mgz format. > However I can't load it in freeview, be either only half ofthe matrix data (one
hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able tovisualize a
scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I alsotried with .nii.gz, or
.mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > 'mean_rest' is a diffusion embedding map, which containsscores for every vertex
on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres offsaverage5... I also tried
forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off.I'm not sure where
> the variables `mean_rest` and `surf.b` come from in yourcode, and I
suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and puttogether some
code > that will load the Desikan data for both hemispheres anddisplay it in
> surfstat. Feel free to use it, there also is an examplescreenshot of the
> results: > > >https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry,Psychosomatics and
> Psychotherapy > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactlywhat I needed!
> > I wrote this : > > " > > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir,subject_id, 'label',
> > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> > fprintf("Read aparc parcellation file '%s' containing%d regions.\n",
> > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label ==struct_code);
> > fprintf("Found region '%s' with %d verts.\n",region,
> > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( seeattached)
> > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit :
> > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I thinkit's been this
way > > > for quite a while now. Maybe someone else knowsbetter?
> > > > > > The website is athttp://www.math.mcgill.ca/keith/surfstat/ and it
says > > > 'Updated 26 September 2008'. I'm not sure whetherthat's really true,
> but > > > at least for the last 14 months (the only time frameI know about),
> there > > > have not been any changes to that website or any newreleases of
> SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Ormaybe someone else
> on > > > the > > > > list knows? I don't. You can label surfacesmanually with the dev
> > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I waswondering:
> > > > > would it be possible to load freesurfer surfaceatlases in
surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat onlyaccepts a limited
> > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the samespace (they are
> subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it alsofine for fsaverage5
> > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, BruceFischl <
> > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaveragesurface you can save the
> > > -log10(p) values > > > > > > using save_mgh.m, then load themin freeview and
> > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumailwrote:
> > > > > > > > > > > > > > > > > > > > External Email - UseCaution
> > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5resolution.
> > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49,Loïc Daumail <
> > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices ofsurfaces after
> performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in
order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map,I would like to
> label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significantdifference between both
> groups. > > > > > > > > > > > > > > Would it be possible to useFreview in order to do
> it? > > > > > > > If so, which format should I usefor my SurfStatP
> > > output p-value map? > > > > > > > How would you do it, (tools toconvert into a
> specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for thoseones)?
> > > > > > > I would be very grateful if youcould detail a
bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > >
> > > > > > 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
> > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry,Psychosomatics and
> > > Psychotherapy > > > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
> Germany > > > > > > _______________________________________________ > > > 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
> > _______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://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
External Email - Use Caution
Hi Freesurfer, Getting back the former request, I am still trying to load an overlay of my data onto a surface.. but it still doesn't work well. Here is the info of my overlay: " mri_info lh_emb_comp_sub-002.mgz Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Here is what I get when loading on freeview:
" freeview -f ~/Documents/recon_all_success/freesurfer/sub-002/surf/lh.pial:overlay=lh_emb_comp_sub-002.mgz Number of vertices in overlay data does not match with surface. QClipboard: Unable to receive an event from the clipboard manager in a reasonable time " The data was normalized in MNI space. When I try to load it in FSLeyes, it works, but the overlay is completely absent, it seems that it's empty. On the FSLeyes GUI, it's written 'overlay out of bounds'... The endpoint of this process would be to define ROIs in specific regions, and Freeview is very handy with atlases. Any advice is welcome!
Thanks in advance,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 17:01, Loïc Daumail loic.daumail@gmail.com a écrit :
I also tried saving the last file in 10242 x 1 x 1.. but nothing is coming neither.
Thanks,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 16:50, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Doug,
Thanks for your help!
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ reading from lh.thickness... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 0, -1) k_ras = (0, 1, 0) writing to template.mgh... " There is progess though, as here, we see that template.mgh seems not empty: " mri_info template.mgh Volume information for template.mgh type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 0 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Also, using MRIread and MRIwrite, we can see that it's not empty neither:
" Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 1 x 10242 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -0.5, xend: 0.5 ystart: -5121.0, yend: 5121.0 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 5120.5000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -5120.5000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 "
But then, trying to load the overlay on the lh.pial still isn't possible, with endless "FreadFloat: fread failed"
Thanks in advance for your help,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < DGREVE@mgh.harvard.edu> a écrit :
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use CautionHi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay',
['/home/loic/Documents/emb_output/mgh_format/lh_emb_'
char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com
a écrit :
Hi Bruce,Thanks for your tip. Unfortunately, I am still running through an
error...
I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining
elements with zeros, and
also tried with rand().
The other issue is that I am not so sure which part of the matrix is
for lh and the other one
for rh. Thus, I divided 18715/2 and took the 9357 first elements of
the 18715 matrix. Then
filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with
freeview using the following
command line: freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access
out of range [0]PETSC ERROR: Try option -start_in_debugger or
-on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR:
or try http://valgrind.org on linux or man libgmalloc on Apple to
find memory corruption
errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile,
link, and run
[0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15
17:29:26 CDT 2008 HG
revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53
2019 [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc
--with-fc=g77
--download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3
CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
[0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
[unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl <
fischl@nmr.mgh.harvard.edu> a écrit :
Hi Loïc the .mgz file should having dimensions nvertices x 1 x 1 forfreeview to
know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surfacescalar values of
diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surfaceembedding values in
an .mgz format. > However I can't load it in freeview, be either only half ofthe matrix data (one
hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be ableto visualize a
scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I alsotried with .nii.gz, or
.mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > 'mean_rest' is a diffusion embedding map, which containsscores for every vertex
on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres offsaverage5... I also tried
forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off.I'm not sure where
> the variables `mean_rest` and `surf.b` come from inyour code, and I
suspect > that something is wrong with them. > > In the meantime, I got interested in this myself andput together some
code > that will load the Desikan data for both hemispheresand display it in
> surfstat. Feel free to use it, there also is an examplescreenshot of the
> results: > > >https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry,Psychosomatics and
> Psychotherapy > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactlywhat I needed!
> > I wrote this : > > " > > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir,subject_id, 'label',
> > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> > fprintf("Read aparc parcellation file '%s' containing%d regions.\n",
> > aparc_file_this_hemi,length(colortable.struct_names));
> > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label ==struct_code);
> > fprintf("Found region '%s' with %d verts.\n",region,
> > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( seeattached)
> > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit :
> > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and Ithink it's been this
way > > > for quite a while now. Maybe someone else knowsbetter?
> > > > > > The website is athttp://www.math.mcgill.ca/keith/surfstat/ and it
says > > > 'Updated 26 September 2008'. I'm not sure whetherthat's really true,
> but > > > at least for the last 14 months (the only timeframe I know about),
> there > > > have not been any changes to that website or anynew releases of
> SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Ormaybe someone else
> on > > > the > > > > list knows? I don't. You can label surfacesmanually with the dev
> > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I waswondering:
> > > > > would it be possible to load freesurfer surfaceatlases in
surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat onlyaccepts a limited
> > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the samespace (they are
> subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it alsofine for fsaverage5
> > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, BruceFischl <
> > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaveragesurface you can save the
> > > -log10(p) values > > > > > > using save_mgh.m, then load themin freeview and
> > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumailwrote:
> > > > > > > > > > > > > > > > > > > > External Email - UseCaution
> > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5resolution.
> > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49,Loïc Daumail <
> > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices ofsurfaces after
> performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in
order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-valuemap, I would like to
> label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significantdifference between both
> groups. > > > > > > > > > > > > > > Would it be possible to useFreview in order to do
> it? > > > > > > > If so, which format should Iuse for my SurfStatP
> > > output p-value map? > > > > > > > How would you do it, (tools toconvert into a
> specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format forthose ones)?
> > > > > > > I would be very grateful if youcould detail a
bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > >
> > > > > > 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
> > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry,Psychosomatics and
> > > Psychotherapy > > > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
> Germany > > > > > > _______________________________________________ > > > 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
> > _______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://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
External Email - Use Caution
I found it hard to read the quoted mails and to follow along, but if I'm not mistaken you are trying to overlay a self-created mgh file with dimension 10242x1x1 onto the pial surface of sub-002 at sub-002/surf/lh.pial.
How many vertices does sub-002/surf/lh.pial have? If the answer is not 10242, this is not gonna work.
In one of the earlier mails you mentioned fsaverage5. Could it it be that you really intend to overlay onto $FREESURFER_HOME/subjects/fsaverage5/surf/lh.pial?
Best,
Tim
On June 26, 2019 at 10:48 AM Loïc Daumail loic.daumail@gmail.com wrote:
External Email - Use CautionHi Freesurfer, Getting back the former request, I am still trying to load an overlay of my data onto a surface.. but it still doesn't work well. Here is the info of my overlay: " mri_info lh_emb_comp_sub-002.mgz Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Here is what I get when loading on freeview:
" freeview -f ~/Documents/recon_all_success/freesurfer/sub-002/surf/lh.pial:overlay=lh_emb_comp_sub-002.mgz Number of vertices in overlay data does not match with surface. QClipboard: Unable to receive an event from the clipboard manager in a reasonable time " The data was normalized in MNI space. When I try to load it in FSLeyes, it works, but the overlay is completely absent, it seems that it's empty. On the FSLeyes GUI, it's written 'overlay out of bounds'... The endpoint of this process would be to define ROIs in specific regions, and Freeview is very handy with atlases. Any advice is welcome!
Thanks in advance,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 17:01, Loïc Daumail loic.daumail@gmail.com a écrit :
I also tried saving the last file in 10242 x 1 x 1.. but nothing is coming neither.
Thanks,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 16:50, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Doug,
Thanks for your help!
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ reading from lh.thickness... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 0, -1) k_ras = (0, 1, 0) writing to template.mgh... " There is progess though, as here, we see that template.mgh seems not empty: " mri_info template.mgh Volume information for template.mgh type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 0 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Also, using MRIread and MRIwrite, we can see that it's not empty neither:
" Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 1 x 10242 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -0.5, xend: 0.5 ystart: -5121.0, yend: 5121.0 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 5120.5000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -5120.5000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 "
But then, trying to load the overlay on the lh.pial still isn't possible, with endless "FreadFloat: fread failed"
Thanks in advance for your help,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < DGREVE@mgh.harvard.edu> a écrit :
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use CautionHi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) '_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I don't see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in order to visualize this .mgz file on the left hemisphere pial surface in Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit :
I don't think it matters but I would use eye instead of nan for M. But the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use CautionMe again,
Also, here is how I save the matrix on matlab:
M = nan(4,4); save_mgh('freeview_overlay',
['/home/loic/Documents/emb_output/mgh_format/lh_emb_'
char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M);
Thanks,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 12:25, Loïc Daumail loic.daumail@gmail.com
a écrit :
Hi Bruce,Thanks for your tip. Unfortunately, I am still running through an
error...
I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining
elements with zeros, and
also tried with rand().
The other issue is that I am not so sure which part of the matrix is
for lh and the other one
for rh. Thus, I divided 18715/2 and took the 9357 first elements of
the 18715 matrix. Then
filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with
freeview using the following
command line: freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
_format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR:
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access
out of range [0]PETSC ERROR: Try option -start_in_debugger or
-on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR:
or try http://valgrind.org on linux or man libgmalloc on Apple to
find memory corruption
errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile,
link, and run
[0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Signal received! [0]PETSC ERROR:
[0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15
17:29:26 CDT 2008 HG
revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR:
[0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53
2019 [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc
--with-fc=g77
--download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3
CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
[0]PETSC ERROR:
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
[unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl <
fischl@nmr.mgh.harvard.edu> a écrit :
Hi Loïc the .mgz file should having dimensions nvertices x 1 x 1 forfreeview to
know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surfacescalar values of
diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surfaceembedding values in
an .mgz format. > However I can't load it in freeview, be either only half ofthe matrix data (one
hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be ableto visualize a
scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I alsotried with .nii.gz, or
.mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit :
> Hi Tim, > > 'mean_rest' is a diffusion embedding map, which containsscores for every vertex
on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres offsaverage5... I also tried
forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> aécrit :
> External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off.I'm not sure where
> the variables `mean_rest` and `surf.b` come from inyour code, and I
suspect > that something is wrong with them. > > In the meantime, I got interested in this myself andput together some
code > that will load the Desikan data for both hemispheresand display it in
> surfstat. Feel free to use it, there also is an examplescreenshot of the
> results: > > >https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry,Psychosomatics and
> Psychotherapy > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote:
> > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactlywhat I needed!
> > I wrote this : > > " > > subjects_dir ='/home/loic/Documents/recon_all_success/freesurfer/';
> > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir,subject_id, 'label',
> > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] =read_annotation(aparc_file_this_hemi);
> > fprintf("Read aparc parcellation file '%s' containing%d regions.\n",
> > aparc_file_this_hemi,length(colortable.struct_names));
> > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label ==struct_code);
> > fprintf("Found region '%s' with %d verts.\n",region,
> > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( seeattached)
> > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit :
> > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and Ithink it's been this
way > > > for quite a while now. Maybe someone else knowsbetter?
> > > > > > The website is athttp://www.math.mcgill.ca/keith/surfstat/ and it
says > > > 'Updated 26 September 2008'. I'm not sure whetherthat's really true,
> but > > > at least for the last 14 months (the only timeframe I know about),
> there > > > have not been any changes to that website or anynew releases of
> SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu>
> > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Ormaybe someone else
> on > > > the > > > > list knows? I don't. You can label surfacesmanually with the dev
> > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I waswondering:
> > > > > would it be possible to load freesurfer surfaceatlases in
surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat onlyaccepts a limited
> > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the samespace (they are
> subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it alsofine for fsaverage5
> > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, BruceFischl <
> > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaveragesurface you can save the
> > > -log10(p) values > > > > > > using save_mgh.m, then load themin freeview and
> > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumailwrote:
> > > > > > > > > > > > > > > > > > > > External Email - UseCaution
> > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5resolution.
> > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49,Loïc Daumail <
> > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices ofsurfaces after
> performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStattoolbox(Matlab) in
order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-valuemap, I would like to
> label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significantdifference between both
> groups. > > > > > > > > > > > > > > Would it be possible to useFreview in order to do
> it? > > > > > > > If so, which format should Iuse for my SurfStatP
> > > output p-value map? > > > > > > > How would you do it, (tools toconvert into a
> specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format forthose ones)?
> > > > > > > I would be very grateful if youcould detail a
bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > >
> > > > > > 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
> > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > >https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry,Psychosomatics and
> > > Psychotherapy > > > University Hospital Frankfurt, Goethe UniversityFrankfurt am Main,
> Germany > > > > > > _______________________________________________ > > > 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
> > _______________________________________________ > 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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
External Email - Use Caution
Hi Tim,
Thanks a lot for the effort! Indeed, I self-created an mgh file from a matrix of 10242x1x1 elements. After a few adjustments, it perfectly works in order to view the data on Freeview. I overlayed the individuals' data on lh.pial of fsaverage5 (created during recon-all), as our diffusion embedding data has the same resolution.
Thanks everyone for all of your help!!
Sincerely,
Loïc
Le mer. 26 juin 2019 à 11:14, Tim Schäfer ts+ml@rcmd.org a écrit :
External Email - Use CautionI found it hard to read the quoted mails and to follow along, but if I'm not mistaken you are trying to overlay a self-created mgh file with dimension 10242x1x1 onto the pial surface of sub-002 at sub-002/surf/lh.pial.
How many vertices does sub-002/surf/lh.pial have? If the answer is not 10242, this is not gonna work.
In one of the earlier mails you mentioned fsaverage5. Could it it be that you really intend to overlay onto $FREESURFER_HOME/subjects/fsaverage5/surf/lh.pial?
Best,
Tim
On June 26, 2019 at 10:48 AM Loïc Daumail loic.daumail@gmail.com
wrote:
External Email - Use CautionHi Freesurfer, Getting back the former request, I am still trying to load an overlay of my data onto a surface.. but it still doesn't work well. Here is the info of my overlay: " mri_info lh_emb_comp_sub-002.mgz Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Here is what I get when loading on freeview:
" freeview -f
~/Documents/recon_all_success/freesurfer/sub-002/surf/lh.pial:overlay=lh_emb_comp_sub-002.mgz
Number of vertices in overlay data does not match with surface. QClipboard: Unable to receive an event from the clipboard manager in a reasonable time " The data was normalized in MNI space. When I try to load it in FSLeyes, it works, but the overlay is completely absent, it seems that it's empty. On the FSLeyes GUI, it's written 'overlay out of bounds'... The endpoint of this process would be to define ROIs in specific regions, and Freeview is very handy with atlases. Any advice is welcome!
Thanks in advance,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 17:01, Loïc Daumail loic.daumail@gmail.com a écrit :
I also tried saving the last file in 10242 x 1 x 1.. but nothing is
coming
neither.
Thanks,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 16:50, Loïc Daumail loic.daumail@gmail.com a écrit :
Hi Doug,
Thanks for your help!
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a
function
/usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ reading from lh.thickness... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 0, -1) k_ras = (0, 1, 0) writing to template.mgh... " There is progess though, as here, we see that template.mgh seems not empty: " mri_info template.mgh Volume information for template.mgh type: MGH dimensions: 10242 x 1 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 0 xstart: -5121.0, xend: 5121.0 ystart: -0.5, yend: 0.5 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle:
0.00
degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 0.0000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = 0.0000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 " Also, using MRIread and MRIwrite, we can see that it's not empty
neither:
" Volume information for lh_emb_comp_sub-002.mgz type: MGH dimensions: 1 x 10242 x 1 voxel sizes: 1.000000, 1.000000, 1.000000 type: FLOAT (3) fov: 10242.000 dof: 1 xstart: -0.5, xend: 0.5 ystart: -5121.0, yend: 5121.0 zstart: -0.5, zend: 0.5 TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle:
0.00
degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 5120.5000 : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 0.0000 : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -5120.5000
talairach xfm : Orientation : LIA Primary Slice Direction: coronal
voxel to ras transform: -1.0000 0.0000 0.0000 5121.0000 0.0000 0.0000 1.0000 -0.5000 0.0000 -1.0000 0.0000 0.5000 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform: -1.0000 -0.0000 -0.0000 5121.0000 -0.0000 -0.0000 -1.0000 0.5000 -0.0000 1.0000 -0.0000 0.5000 -0.0000 -0.0000 -0.0000 1.0000 "
But then, trying to load the overlay on the lh.pial still isn't
possible,
with endless "FreadFloat: fread failed"
Thanks in advance for your help,
Sincerely,
Loïc
Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < DGREVE@mgh.harvard.edu> a écrit :
It is probably using a tcsh shell to do the compression. Try using MRIwrite instead. You will have to create an mri structure. The easiest way to do that is to mri_convert lh.thickness template.mgh then read the template in to matlab template = MRIread('template.mgh'); template.vol = yourdata MRIwrite(template,'yourdata.mgz')
On 6/24/2019 11:54 AM, Loïc Daumail wrote:
External Email - Use CautionHi Bruce and Doug,
To respond to your questions: I projected the BOLD data on the surface using mri_vol2surf function. Then obtained a .mgz file of size 10242 x 1 x 1 x 200.
Then I performed diffusion embedding (unsupervised dimensionality reduction technique) on this .mgz file, whose output was a .npy file. I then loaded this file into a matrix on python, which size was 1 x 18715 x 5. I then saved this file as a .mat file. Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the matrix, and stored it into a zeros(1, 20484). Then kept only the part from (0:10242) and used save_mgh function to save this data into a .mgz file Looking at the info of my .mgz file created with save_mgh, I see that the file doesn't seem to include the data:
" mri_info lh_emb_sub-002_compassion.mgz Volume information for lh_emb_sub-002_compassion.mgz type: MGH dimensions: 1 x 16 x 1 voxel sizes: -nan, -nan, -nan type: FLOAT (3) fov: -nan dof: 1 xstart: -nan, xend: -nan ystart: -nan, yend: -nan zstart: -nan, zend: -nan TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees nframes: 1 PhEncDir: UNKNOWN FieldStrength: 0.000000 ras xform present xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = -nan : x_a = -nan, y_a = -nan, z_a = -nan, c_a = -nan : x_s = -nan, y_s = -nan, z_s = -nan, c_s = -nan
talairach xfm : Orientation : III Primary Slice Direction: axial
voxel to ras transform: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan 0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -nan
ras to voxel transform: mat = NULL! MatrixFree: NULL mat POINTER! " It seems that save_mgh function requires tclsh package, as when I ran save_mgh for the first time with this command line: save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/emb_'
char(subjectsList(1))
'_' char(statesList(1)) '.MGZ'], M);
I was getting this message in return in the matlab window: " /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file
or
directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a
function
/usr/share/modules/init/bash: line 60: export: module: not a function " Checking into the '/usr/bin/tclsh' directory, the only package called/related to tclsh was 'tclsh8.6'. I thus changed the name from 'tclsh8.6' to 'tclsh'.
Then tried to save the matrix again with save_mgh function. Now I
don't
see the error message anymore. However I still get a .mgz file with nans, as seen in the previous mri_info message above.
Would any of you have an advice on how I could make this work, in
order
to visualize this .mgz file on the left hemisphere pial surface in
Freeview?
Thanks in advance,
Sincerely,
Loïc
Le ven. 21 juin 2019 à 16:24, Bruce Fischl <
fischl@nmr.mgh.harvard.edu>
a écrit :
I don't think it matters but I would use eye instead of nan for M.
But
the critical issue is where you get your data and what dimensions it has cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
> > External Email - Use Caution > > Me again, > > Also, here is how I save the matrix on matlab: > > M = nan(4,4); > save_mgh('freeview_overlay', ['/home/loic/Documents/emb_output/mgh_format/lh_emb_' > char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M); > > Thanks, > > Sincerely, > > Loïc > > Le ven. 21 juin 2019 à 12:25, Loïc Daumail <
loic.daumail@gmail.com>
a écrit : > Hi Bruce, > > Thanks for your tip. Unfortunately, I am still running through an error... > I have a matrix of 18715 elements regarding both hemispheres. > The size of fsaverage5 is 20484 I believe, so I filled the
remaining
elements with zeros, and > also tried with rand(). > > The other issue is that I am not so sure which part of the matrix
is
for lh and the other one > for rh. Thus, I divided 18715/2 and took the 9357 first elements
of
the 18715 matrix. Then > filled it with zeros or random values to reach 10242. > > Then I saved it with save_mgh function and tried to load it with freeview using the following > command line: > freeview
-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh
> _format/lh_emb_sub-002_compassion.mgz > > I am getting the following error: > " > Did not find any volume info > 2 [0]PETSC ERROR:
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation
Violation,
probably memory access > out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see >
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig...
ERROR: > or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption > errors > [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run > [0]PETSC ERROR: to get more information on the crash.
> [0]PETSC ERROR: --------------------- Error Message
> [0]PETSC ERROR: Signal received! > [0]PETSC ERROR:
> [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG > revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble
shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR:
> [0]PETSC ERROR: Unknown Name on a linux-gnu named
loic-HP-ZBook-17 by
loic Fri Jun 21 12:15:53 > 2019 > [0]PETSC ERROR: Libraries linked
from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin
> ux-gnu-c-opt > [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 > [0]PETSC ERROR: Configure options --with-debugging=no
--with-cc=gcc
--with-fc=g77 > --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1
--with-x=0
> --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 > [0]PETSC ERROR:
> [0]PETSC ERROR: User provided function() line 0 in unknown
directory
unknown file > [unset]: aborting job: > application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0" > > Any idea of what could be wrong in my process? > > Thanks > > Sincerely, > > Loïc > > > > Le jeu. 20 juin 2019 à 19:39, Bruce Fischl < fischl@nmr.mgh.harvard.edu> a écrit : > Hi Loïc > > the .mgz file should having dimensions nvertices x 1 x 1 for freeview to > know it is a surface overlay I believe > > cheers > Bruce > > > > On Thu, 20 Jun 2019, Loïc Daumail wrote: > > > > > External Email - Use Caution > > > > Hi Bruce, > > > > I am reaching out to you, as I am trying to load the
surface
scalar values of > diffusion embedding > > for overlay on a pial surface in Freeview. > > > > I used save_mgh to save a scalar matrix containing surface embedding values in > an .mgz format. > > However I can't load it in freeview, be either only half
of
the matrix data (one > hemisphere I > > assume) or the whole matrix saved in the same file. > > > > Is there anything specific I need to do in order to be
able
to visualize a > scalar overlay on a > > surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or > .mgh. I am not even > > sure save_mgh can do all this... > > > > Thanks in advance, > > > > Sincerely, > > > > Loïc > > > > > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail < loic.daumail@gmail.com> a écrit : > > Hi Tim, > > > > Your link works perfectly, it's awesome! > > Thanks a lot, > > > > Best, > > > > Loïc > > > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail < loic.daumail@gmail.com> a écrit : > > Hi Tim, > > > > 'mean_rest' is a diffusion embedding map, which contains scores for every vertex > on > > fsaverage5 surface resolution. > > 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried > forjust > > lh hemisphere, but it gives me the same result... > > > > Thanks for the link! > > > > Best, > > > > Loïc > > > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer ts+ml@rcmd.org
a
écrit : > > External Email - Use Caution > > > > Hi Loïc, > > > > that does not look correct, the data is definitely
off.
I'm not sure where > > the variables `mean_rest` and `surf.b` come from in your code, and I > suspect > > that something is wrong with them. > > > > In the meantime, I got interested in this myself and put together some > code > > that will load the Desikan data for both hemispheres and display it in > > surfstat. Feel free to use it, there also is an
example
screenshot of the > > results: > > > > > > >
https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desik...
> > > > Best, > > > > Tim > > > > -- > > Dr. Tim Schäfer > > Postdoc Computational Neuroimaging > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > Psychotherapy > > University Hospital Frankfurt, Goethe University Frankfurt am Main, > Germany > > > > > On May 27, 2019 at 11:01 AM Loïc Daumail < loic.daumail@gmail.com> wrote: > > > > > > > > > External Email - Use Caution > > > > > > Hi Tim, > > > > > > Thanks a lot for your help, indeed, this is
exactly
what I needed! > > > I wrote this : > > > " > > > subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; > > > subject_id = 'sub-004'; > > > hemi = 'lh'; > > > > > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', > > > sprintf("%s.aparc.annot", hemi)); > > > [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); > > > fprintf("Read aparc parcellation file '%s'
containing
%d regions.\n", > > > aparc_file_this_hemi, length(colortable.struct_names)); > > > for sidx = 1:length(colortable.struct_names) > > > region = colortable.struct_names{sidx}; > > > struct_code = colortable.table(sidx, 5); > > > vertices_of_struct_roi = find(label == struct_code); > > > fprintf("Found region '%s' with %d verts.\n", region, > > > length(vertices_of_struct_roi)); > > > end > > > fig1 = figure(); > > > SurfStatView(mean_rest, surf.b); > > > SurfStatColormap(colortable.table(:,1:3)/255); > > > " > > > However, the image I obtain seems a bit fuzzy...(
see
attached) > > > Is it because of my data? > > > > > > Thanks in advance, > > > > > > Loïc > > > > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer < ts+ml@rcmd.org> a écrit : > > > > > > > External Email - Use Caution > > > > > > > > Afaik SurfStat is not maintained anymore and I think it's been this > way > > > > for quite a while now. Maybe someone else knows better? > > > > > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/ and it > says > > > > 'Updated 26 September 2008'. I'm not sure
whether
that's really true, > > but > > > > at least for the last 14 months (the only time frame I know about), > > there > > > > have not been any changes to that website or any new releases of > > SurfStat. > > > > > > > > Tim > > > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl < fischl@nmr.mgh.harvard.edu> > > > > wrote: > > > > > > > > > > > > > > > Hi Loic > > > > > > > > > > sorry, can you ask whoever maintains
surfstat? Or
maybe someone else > > on > > > > the > > > > > list knows? I don't. You can label surfaces manually with the dev > > > > version > > > > > of freeview if you want. > > > > > > > > > > cheers > > > > > Bruce > > > > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > > Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > I am coming back to this request as I was wondering: > > > > > > would it be possible to load freesurfer
surface
atlases in > surfstat > > in > > > > order to label my surfaces? > > > > > > Is their format compatible? I saw surfstat
only
accepts a limited > > > > array of formats... > > > > > > > > > > > > Thanks, > > > > > > Best, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > > fischl@nmr.mgh.harvard.edu > > > > a écrit : > > > > > > sure. All the fsaverages are in the
same
space (they are > > subsets > > > > of > > > > > > fsaverage) > > > > > > On Mon, 20 May 2019, Loïc Daumail
wrote:
> > > > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > > > Thanks for your response. Is it also fine for fsaverage5 > > > > surface or I need to switch > > > > > > my data to > > > > > > > fsaverage? > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > > Hi Loic > > > > > > > > > > > > > > if you are on the fsaverage surface you can save the > > > > -log10(p) values > > > > > > > using save_mgh.m, then load
them
in freeview and > > > > threshold them or > > > > > > > whatever > > > > > > > > > > > > > > cheers > > > > > > > Bruce > > > > > > > On Mon, 20 May 2019, Loïc
Daumail
wrote: > > > > > > > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > > > loic.daumail@gmail.com> a écrit : > > > > > > > > Dear Freesurfer
community,
> > > > > > > > > > > > > > > > I obtained score matrices of surfaces after > > performing > > > > diffusion embedding map > > > > > > on fMRI > > > > > > > data. > > > > > > > > > > > > > > > > I am now using the SurfStat toolbox(Matlab) in > order > > > > to obtain p-value maps to > > > > > > compare > > > > > > > between > > > > > > > > two groups. > > > > > > > > > > > > > > > > After obtaining the p-value map, I would like to > > label > > > > the surface in order to > > > > > > > identify the > > > > > > > > regions of significant difference between both > > groups. > > > > > > > > > > > > > > > > Would it be possible to use Freview in order to do > > it? > > > > > > > > If so, which format should I use for my SurfStatP > > > > output p-value map? > > > > > > > > How would you do it, (tools
to
convert into a > > specific > > > > format, surfaces and > > > > > > atlas to > > > > > > > load on > > > > > > > > Freeview, which format for those ones)? > > > > > > > > I would be very grateful if
you
could detail a > bit, > > as > > > > I am new to these > > > > > > tools! > > > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > > > 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 > > > > > > > > > > > > > > > > >
> > > > > Freesurfer mailing list > > > > > Freesurfer@nmr.mgh.harvard.edu > > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > > > -- > > > > Dr. Tim Schäfer > > > > Postdoc Computational Neuroimaging > > > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > > > Psychotherapy > > > > University Hospital Frankfurt, Goethe University Frankfurt am Main, > > Germany > > > > > > > > _______________________________________________ > > > > 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 > > > > _______________________________________________ > > 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
> > >_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
glad to hear it worked out Bruce On Thu, 27 Jun 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Tim,
Thanks a lot for the effort! Indeed, I self-created an mgh file from a matrix of 10242x1x1 elements. After a few adjustments, it perfectly works in order to view the data on Freeview. I overlayed the individuals' data on lh.pial of fsaverage5 (created during recon-all), as our diffusion embedding data has the same resolution.
Thanks everyone for all of your help!!
Sincerely,
Loïc
Le mer. 26 juin 2019 à 11:14, Tim Schäfer ts+ml@rcmd.org a écrit : External Email - Use Caution
I found it hard to read the quoted mails and to follow along, but if I'm not mistaken you are trying to overlay a self-created mgh file with dimension 10242x1x1 onto the pial surface of sub-002 at sub-002/surf/lh.pial. How many vertices does sub-002/surf/lh.pial have? If the answer is not 10242, this is not gonna work. In one of the earlier mails you mentioned fsaverage5. Could it it be that you really intend to overlay onto $FREESURFER_HOME/subjects/fsaverage5/surf/lh.pial? Best, Tim > On June 26, 2019 at 10:48 AM Loïc Daumail <loic.daumail@gmail.com> wrote: > > > External Email - Use Caution > > Hi Freesurfer, > Getting back the former request, > I am still trying to load an overlay of my data onto a surface.. but it > still doesn't work well. > Here is the info of my overlay: > " mri_info lh_emb_comp_sub-002.mgz > Volume information for lh_emb_comp_sub-002.mgz > type: MGH > dimensions: 10242 x 1 x 1 > voxel sizes: 1.000000, 1.000000, 1.000000 > type: FLOAT (3) > fov: 10242.000 > dof: 1 > xstart: -5121.0, xend: 5121.0 > ystart: -0.5, yend: 0.5 > zstart: -0.5, zend: 0.5 > TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 > degrees > nframes: 1 > PhEncDir: UNKNOWN > FieldStrength: 0.000000 > ras xform present > xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = > 0.0000 > : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = > 0.0000 > : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = > 0.0000 > > talairach xfm : > Orientation : LIA > Primary Slice Direction: coronal > > voxel to ras transform: > -1.0000 0.0000 0.0000 5121.0000 > 0.0000 0.0000 1.0000 -0.5000 > 0.0000 -1.0000 0.0000 0.5000 > 0.0000 0.0000 0.0000 1.0000 > > voxel-to-ras determinant -1 > > ras to voxel transform: > -1.0000 -0.0000 -0.0000 5121.0000 > -0.0000 -0.0000 -1.0000 0.5000 > -0.0000 1.0000 -0.0000 0.5000 > -0.0000 -0.0000 -0.0000 1.0000 > " > Here is what I get when loading on freeview: > > " > freeview -f > ~/Documents/recon_all_success/freesurfer/sub-002/surf/lh.pial:overlay=lh_emb_comp_sub-002.mgz > Number of vertices in overlay data does not match with surface. > QClipboard: Unable to receive an event from the clipboard manager in a > reasonable time > " > The data was normalized in MNI space. > When I try to load it in FSLeyes, it works, but the overlay is completely > absent, it seems that it's empty. On the FSLeyes GUI, it's written > 'overlay out of bounds'... > The endpoint of this process would be to define ROIs in specific regions, > and Freeview is very handy with atlases. > Any advice is welcome! > > Thanks in advance, > > Sincerely, > > Loïc > > > Le lun. 24 juin 2019 à 17:01, Loïc Daumail <loic.daumail@gmail.com> a > écrit : > > > > > I also tried saving the last file in 10242 x 1 x 1.. but nothing is coming > > neither. > > > > Thanks, > > > > Sincerely, > > > > Loïc > > > > Le lun. 24 juin 2019 à 16:50, Loïc Daumail <loic.daumail@gmail.com> a > > écrit : > > > >> Hi Doug, > >> > >> Thanks for your help! > >> > >> However, using mri_convert, I still get the same message with tclsh. > >> " > >> mri_convert lh.thickness template.mgh > >> /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or > >> directory > >> /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function > >> /usr/share/modules/init/bash: line 60: export: module: not a function > >> mri_convert.bin lh.thickness template.mgh > >> $Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $ > >> reading from lh.thickness... > >> TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 > >> i_ras = (-1, 0, 0) > >> j_ras = (0, 0, -1) > >> k_ras = (0, 1, 0) > >> writing to template.mgh... > >> " > >> There is progess though, as here, we see that template.mgh seems not > >> empty: > >> " > >> mri_info template.mgh > >> Volume information for template.mgh > >> type: MGH > >> dimensions: 10242 x 1 x 1 > >> voxel sizes: 1.000000, 1.000000, 1.000000 > >> type: FLOAT (3) > >> fov: 10242.000 > >> dof: 0 > >> xstart: -5121.0, xend: 5121.0 > >> ystart: -0.5, yend: 0.5 > >> zstart: -0.5, zend: 0.5 > >> TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 > >> degrees > >> nframes: 1 > >> PhEncDir: UNKNOWN > >> FieldStrength: 0.000000 > >> ras xform present > >> xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = > >> 0.0000 > >> : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = > >> 0.0000 > >> : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = > >> 0.0000 > >> > >> talairach xfm : > >> Orientation : LIA > >> Primary Slice Direction: coronal > >> > >> voxel to ras transform: > >> -1.0000 0.0000 0.0000 5121.0000 > >> 0.0000 0.0000 1.0000 -0.5000 > >> 0.0000 -1.0000 0.0000 0.5000 > >> 0.0000 0.0000 0.0000 1.0000 > >> > >> voxel-to-ras determinant -1 > >> > >> ras to voxel transform: > >> -1.0000 -0.0000 -0.0000 5121.0000 > >> -0.0000 -0.0000 -1.0000 0.5000 > >> -0.0000 1.0000 -0.0000 0.5000 > >> -0.0000 -0.0000 -0.0000 1.0000 > >> " > >> Also, using MRIread and MRIwrite, we can see that it's not empty neither: > >> > >> " > >> Volume information for lh_emb_comp_sub-002.mgz > >> type: MGH > >> dimensions: 1 x 10242 x 1 > >> voxel sizes: 1.000000, 1.000000, 1.000000 > >> type: FLOAT (3) > >> fov: 10242.000 > >> dof: 1 > >> xstart: -0.5, xend: 0.5 > >> ystart: -5121.0, yend: 5121.0 > >> zstart: -0.5, zend: 0.5 > >> TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 > >> degrees > >> nframes: 1 > >> PhEncDir: UNKNOWN > >> FieldStrength: 0.000000 > >> ras xform present > >> xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = > >> 5120.5000 > >> : x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = > >> 0.0000 > >> : x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = > >> -5120.5000 > >> > >> talairach xfm : > >> Orientation : LIA > >> Primary Slice Direction: coronal > >> > >> voxel to ras transform: > >> -1.0000 0.0000 0.0000 5121.0000 > >> 0.0000 0.0000 1.0000 -0.5000 > >> 0.0000 -1.0000 0.0000 0.5000 > >> 0.0000 0.0000 0.0000 1.0000 > >> > >> voxel-to-ras determinant -1 > >> > >> ras to voxel transform: > >> -1.0000 -0.0000 -0.0000 5121.0000 > >> -0.0000 -0.0000 -1.0000 0.5000 > >> -0.0000 1.0000 -0.0000 0.5000 > >> -0.0000 -0.0000 -0.0000 1.0000 > >> " > >> > >> But then, trying to load the overlay on the lh.pial still isn't possible, > >> with endless "FreadFloat: fread failed" > >> > >> Thanks in advance for your help, > >> > >> Sincerely, > >> > >> Loïc > >> > >> Le lun. 24 juin 2019 à 14:21, Greve, Douglas N.,Ph.D. < > >> DGREVE@mgh.harvard.edu> a écrit : > >> > >>> It is probably using a tcsh shell to do the compression. > >>> Try using MRIwrite instead. You will have to create an mri structure. > >>> The easiest way to do that is to > >>> mri_convert lh.thickness template.mgh > >>> then read the template in to matlab > >>> template = MRIread('template.mgh'); > >>> template.vol = yourdata > >>> MRIwrite(template,'yourdata.mgz') > >>> > >>> > >>> > >>> On 6/24/2019 11:54 AM, Loïc Daumail wrote: > >>> > >>> External Email - Use Caution > >>> Hi Bruce and Doug, > >>> > >>> To respond to your questions: > >>> I projected the BOLD data on the surface using mri_vol2surf function. > >>> Then obtained a .mgz file of size 10242 x 1 x 1 x 200. > >>> > >>> Then I performed diffusion embedding (unsupervised dimensionality > >>> reduction technique) on this .mgz file, whose output was a .npy file. > >>> I then loaded this file into a matrix on python, which size was 1 x > >>> 18715 x 5. > >>> I then saved this file as a .mat file. > >>> Then loaded it on matlab, and kept only 1 x 18715 x 1 part of the > >>> matrix, and stored it into a zeros(1, 20484). > >>> Then kept only the part from (0:10242) and used save_mgh function to > >>> save this data into a .mgz file > >>> Looking at the info of my .mgz file created with save_mgh, I see that > >>> the file doesn't seem to include the data: > >>> > >>> " > >>> mri_info lh_emb_sub-002_compassion.mgz > >>> Volume information for lh_emb_sub-002_compassion.mgz > >>> type: MGH > >>> dimensions: 1 x 16 x 1 > >>> voxel sizes: -nan, -nan, -nan > >>> type: FLOAT (3) > >>> fov: -nan > >>> dof: 1 > >>> xstart: -nan, xend: -nan > >>> ystart: -nan, yend: -nan > >>> zstart: -nan, zend: -nan > >>> TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: > >>> 0.00 degrees > >>> nframes: 1 > >>> PhEncDir: UNKNOWN > >>> FieldStrength: 0.000000 > >>> ras xform present > >>> xform info: x_r = -nan, y_r = -nan, z_r = -nan, c_r = > >>> -nan > >>> : x_a = -nan, y_a = -nan, z_a = -nan, c_a = > >>> -nan > >>> : x_s = -nan, y_s = -nan, z_s = -nan, c_s = > >>> -nan > >>> > >>> talairach xfm : > >>> Orientation : III > >>> Primary Slice Direction: axial > >>> > >>> voxel to ras transform: > >>> -nan -nan -nan -nan > >>> -nan -nan -nan -nan > >>> -nan -nan -nan -nan > >>> 0.0000 0.0000 0.0000 1.0000 > >>> > >>> voxel-to-ras determinant -nan > >>> > >>> ras to voxel transform: > >>> mat = NULL! > >>> MatrixFree: NULL mat POINTER! > >>> " > >>> It seems that save_mgh function requires tclsh package, as when I ran > >>> save_mgh for the first time with this command line: > >>> save_mgh('freeview_overlay', > >>> ['/home/loic/Documents/emb_output/mgh_format/emb_' char(subjectsList(1)) > >>> '_' char(statesList(1)) '.MGZ'], M); > >>> > >>> I was getting this message in return in the matlab window: > >>> " > >>> /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or > >>> directory > >>> /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function > >>> /usr/share/modules/init/bash: line 60: export: module: not a function > >>> " > >>> Checking into the '/usr/bin/tclsh' directory, the only package > >>> called/related to tclsh was 'tclsh8.6'. > >>> I thus changed the name from 'tclsh8.6' to 'tclsh'. > >>> > >>> Then tried to save the matrix again with save_mgh function. Now I don't > >>> see the error message anymore. > >>> However I still get a .mgz file with nans, as seen in the previous > >>> mri_info message above. > >>> > >>> Would any of you have an advice on how I could make this work, in order > >>> to visualize this .mgz file on the left hemisphere pial surface in Freeview? > >>> > >>> Thanks in advance, > >>> > >>> Sincerely, > >>> > >>> Loïc > >>> > >>> > >>> > >>> Le ven. 21 juin 2019 à 16:24, Bruce Fischl <fischl@nmr.mgh.harvard.edu> > >>> a écrit : > >>> > >>>> I don't think it matters but I would use eye instead of nan for M. But > >>>> the > >>>> critical issue is where you get your data and what dimensions it has > >>>> cheers > >>>> Bruce > >>>> > >>>> On Fri, 21 Jun 2019, Loïc Daumail wrote: > >>>> > >>>> > > >>>> > External Email - Use Caution > >>>> > > >>>> > Me again, > >>>> > > >>>> > Also, here is how I save the matrix on matlab: > >>>> > > >>>> > M = nan(4,4); > >>>> > save_mgh('freeview_overlay', > >>>> ['/home/loic/Documents/emb_output/mgh_format/lh_emb_' > >>>> > char(subjectsList(1)) '_' char(statesList(1)) '.mgz'], M); > >>>> > > >>>> > Thanks, > >>>> > > >>>> > Sincerely, > >>>> > > >>>> > Loïc > >>>> > > >>>> > Le ven. 21 juin 2019 à 12:25, Loïc Daumail <loic.daumail@gmail.com> > >>>> a écrit : > >>>> > Hi Bruce, > >>>> > > >>>> > Thanks for your tip. Unfortunately, I am still running through an > >>>> error... > >>>> > I have a matrix of 18715 elements regarding both hemispheres. > >>>> > The size of fsaverage5 is 20484 I believe, so I filled the remaining > >>>> elements with zeros, and > >>>> > also tried with rand(). > >>>> > > >>>> > The other issue is that I am not so sure which part of the matrix is > >>>> for lh and the other one > >>>> > for rh. Thus, I divided 18715/2 and took the 9357 first elements of > >>>> the 18715 matrix. Then > >>>> > filled it with zeros or random values to reach 10242. > >>>> > > >>>> > Then I saved it with save_mgh function and tried to load it with > >>>> freeview using the following > >>>> > command line: > >>>> > freeview > >>>>-f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/m gh > >>>> > _format/lh_emb_sub-002_compassion.mgz > >>>> > > >>>> > I am getting the following error: > >>>> > " > >>>> > Did not find any volume info > >>>> > 2 [0]PETSC ERROR: > >>>> ------------------------------------------------------------------------ > >>>> > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > >>>> probably memory access > >>>> > out of range > >>>> > [0]PETSC ERROR: Try option -start_in_debugger or > >>>> -on_error_attach_debugger > >>>> > [0]PETSC ERROR: or see > >>>> > > >>>> http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC > >>>> ERROR: > >>>> > or try http://valgrind.org on linux or man libgmalloc on Apple to > >>>> find memory corruption > >>>> > errors > >>>> > [0]PETSC ERROR: configure using --with-debugging=yes, recompile, > >>>> link, and run > >>>> > [0]PETSC ERROR: to get more information on the crash. > >>>> > [0]PETSC ERROR: --------------------- Error Message > >>>> ------------------------------------ > >>>> > [0]PETSC ERROR: Signal received! > >>>> > [0]PETSC ERROR: > >>>> ------------------------------------------------------------------------ > >>>> > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 > >>>> 17:29:26 CDT 2008 HG > >>>> > revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 > >>>> > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > >>>> > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > >>>> > [0]PETSC ERROR: See docs/index.html for manual pages. > >>>> > [0]PETSC ERROR: > >>>> ------------------------------------------------------------------------ > >>>> > [0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by > >>>> loic Fri Jun 21 12:15:53 > >>>> > 2019 > >>>> > [0]PETSC ERROR: Libraries linked > >>>>from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib /lin > >>>> > ux-gnu-c-opt > >>>> > [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 > >>>> > [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc > >>>> --with-fc=g77 > >>>> > --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 > >>>> > --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 > >>>> CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 > >>>> > [0]PETSC ERROR: > >>>> ------------------------------------------------------------------------ > >>>> > [0]PETSC ERROR: User provided function() line 0 in unknown directory > >>>> unknown file > >>>> > [unset]: aborting job: > >>>> > application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0" > >>>> > > >>>> > Any idea of what could be wrong in my process? > >>>> > > >>>> > Thanks > >>>> > > >>>> > Sincerely, > >>>> > > >>>> > Loïc > >>>> > > >>>> > > >>>> > > >>>> > Le jeu. 20 juin 2019 à 19:39, Bruce Fischl < > >>>> fischl@nmr.mgh.harvard.edu> a écrit : > >>>> > Hi Loïc > >>>> > > >>>> > the .mgz file should having dimensions nvertices x 1 x 1 for > >>>> freeview to > >>>> > know it is a surface overlay I believe > >>>> > > >>>> > cheers > >>>> > Bruce > >>>> > > >>>> > > >>>> > > >>>> > On Thu, 20 Jun 2019, Loïc Daumail wrote: > >>>> > > >>>> > > > >>>> > > External Email - Use Caution > >>>> > > > >>>> > > Hi Bruce, > >>>> > > > >>>> > > I am reaching out to you, as I am trying to load the surface > >>>> scalar values of > >>>> > diffusion embedding > >>>> > > for overlay on a pial surface in Freeview. > >>>> > > > >>>> > > I used save_mgh to save a scalar matrix containing surface > >>>> embedding values in > >>>> > an .mgz format. > >>>> > > However I can't load it in freeview, be either only half of > >>>> the matrix data (one > >>>> > hemisphere I > >>>> > > assume) or the whole matrix saved in the same file. > >>>> > > > >>>> > > Is there anything specific I need to do in order to be able > >>>> to visualize a > >>>> > scalar overlay on a > >>>> > > surface? Is .mgz a wrong format for scalar values? I also > >>>> tried with .nii.gz, or > >>>> > .mgh. I am not even > >>>> > > sure save_mgh can do all this... > >>>> > > > >>>> > > Thanks in advance, > >>>> > > > >>>> > > Sincerely, > >>>> > > > >>>> > > Loïc > >>>> > > > >>>> > > > >>>> > > > >>>> > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail < > >>>> loic.daumail@gmail.com> a écrit : > >>>> > > Hi Tim, > >>>> > > > >>>> > > Your link works perfectly, it's awesome! > >>>> > > Thanks a lot, > >>>> > > > >>>> > > Best, > >>>> > > > >>>> > > Loïc > >>>> > > > >>>> > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail < > >>>> loic.daumail@gmail.com> a écrit : > >>>> > > Hi Tim, > >>>> > > > >>>> > > 'mean_rest' is a diffusion embedding map, which contains > >>>> scores for every vertex > >>>> > on > >>>> > > fsaverage5 surface resolution. > >>>> > > 'surf.b' is the pial surface of both hemispheres of > >>>> fsaverage5... I also tried > >>>> > forjust > >>>> > > lh hemisphere, but it gives me the same result... > >>>> > > > >>>> > > Thanks for the link! > >>>> > > > >>>> > > Best, > >>>> > > > >>>> > > Loïc > >>>> > > > >>>> > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> a > >>>> écrit : > >>>> > > External Email - Use Caution > >>>> > > > >>>> > > Hi Loïc, > >>>> > > > >>>> > > that does not look correct, the data is definitely off. > >>>> I'm not sure where > >>>> > > the variables `mean_rest` and `surf.b` come from in > >>>> your code, and I > >>>> > suspect > >>>> > > that something is wrong with them. > >>>> > > > >>>> > > In the meantime, I got interested in this myself and > >>>> put together some > >>>> > code > >>>> > > that will load the Desikan data for both hemispheres > >>>> and display it in > >>>> > > surfstat. Feel free to use it, there also is an example > >>>> screenshot of the > >>>> > > results: > >>>> > > > >>>> > > > >>>> > > > >>>> > > >>>> https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desikan > >>>> > > > >>>> > > Best, > >>>> > > > >>>> > > Tim > >>>> > > > >>>> > > -- > >>>> > > Dr. Tim Schäfer > >>>> > > Postdoc Computational Neuroimaging > >>>> > > Department of Child and Adolescent Psychiatry, > >>>> Psychosomatics and > >>>> > > Psychotherapy > >>>> > > University Hospital Frankfurt, Goethe University > >>>> Frankfurt am Main, > >>>> > Germany > >>>> > > > >>>> > > > On May 27, 2019 at 11:01 AM Loïc Daumail < > >>>> loic.daumail@gmail.com> wrote: > >>>> > > > > >>>> > > > > >>>> > > > External Email - Use Caution > >>>> > > > > >>>> > > > Hi Tim, > >>>> > > > > >>>> > > > Thanks a lot for your help, indeed, this is exactly > >>>> what I needed! > >>>> > > > I wrote this : > >>>> > > > " > >>>> > > > subjects_dir = > >>>> '/home/loic/Documents/recon_all_success/freesurfer/'; > >>>> > > > subject_id = 'sub-004'; > >>>> > > > hemi = 'lh'; > >>>> > > > > >>>> > > > aparc_file_this_hemi = fullfile(subjects_dir, > >>>> subject_id, 'label', > >>>> > > > sprintf("%s.aparc.annot", hemi)); > >>>> > > > [vertices, label, colortable] = > >>>> read_annotation(aparc_file_this_hemi); > >>>> > > > fprintf("Read aparc parcellation file '%s' containing > >>>> %d regions.\n", > >>>> > > > aparc_file_this_hemi, > >>>> length(colortable.struct_names)); > >>>> > > > for sidx = 1:length(colortable.struct_names) > >>>> > > > region = colortable.struct_names{sidx}; > >>>> > > > struct_code = colortable.table(sidx, 5); > >>>> > > > vertices_of_struct_roi = find(label == > >>>> struct_code); > >>>> > > > fprintf("Found region '%s' with %d verts.\n", > >>>> region, > >>>> > > > length(vertices_of_struct_roi)); > >>>> > > > end > >>>> > > > fig1 = figure(); > >>>> > > > SurfStatView(mean_rest, surf.b); > >>>> > > > SurfStatColormap(colortable.table(:,1:3)/255); > >>>> > > > " > >>>> > > > However, the image I obtain seems a bit fuzzy...( see > >>>> attached) > >>>> > > > Is it because of my data? > >>>> > > > > >>>> > > > Thanks in advance, > >>>> > > > > >>>> > > > Loïc > >>>> > > > > >>>> > > > > >>>> > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer < > >>>> ts+ml@rcmd.org> a écrit : > >>>> > > > > >>>> > > > > External Email - Use Caution > >>>> > > > > > >>>> > > > > Afaik SurfStat is not maintained anymore and I > >>>> think it's been this > >>>> > way > >>>> > > > > for quite a while now. Maybe someone else knows > >>>> better? > >>>> > > > > > >>>> > > > > The website is at > >>>> http://www.math.mcgill.ca/keith/surfstat/ and it > >>>> > says > >>>> > > > > 'Updated 26 September 2008'. I'm not sure whether > >>>> that's really true, > >>>> > > but > >>>> > > > > at least for the last 14 months (the only time > >>>> frame I know about), > >>>> > > there > >>>> > > > > have not been any changes to that website or any > >>>> new releases of > >>>> > > SurfStat. > >>>> > > > > > >>>> > > > > Tim > >>>> > > > > > >>>> > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl < > >>>> fischl@nmr.mgh.harvard.edu> > >>>> > > > > wrote: > >>>> > > > > > > >>>> > > > > > > >>>> > > > > > Hi Loic > >>>> > > > > > > >>>> > > > > > sorry, can you ask whoever maintains surfstat? Or > >>>> maybe someone else > >>>> > > on > >>>> > > > > the > >>>> > > > > > list knows? I don't. You can label surfaces > >>>> manually with the dev > >>>> > > > > version > >>>> > > > > > of freeview if you want. > >>>> > > > > > > >>>> > > > > > cheers > >>>> > > > > > Bruce > >>>> > > > > > > >>>> > > > > > > >>>> > > > > > On Thu, 23 May 2019, Loïc > >>>> > > > > > Daumail wrote: > >>>> > > > > > > >>>> > > > > > > > >>>> > > > > > > External Email - Use Caution > >>>> > > > > > > > >>>> > > > > > > Hi Bruce, > >>>> > > > > > > > >>>> > > > > > > I am coming back to this request as I was > >>>> wondering: > >>>> > > > > > > would it be possible to load freesurfer surface > >>>> atlases in > >>>> > surfstat > >>>> > > in > >>>> > > > > order to label my surfaces? > >>>> > > > > > > Is their format compatible? I saw surfstat only > >>>> accepts a limited > >>>> > > > > array of formats... > >>>> > > > > > > > >>>> > > > > > > Thanks, > >>>> > > > > > > Best, > >>>> > > > > > > > >>>> > > > > > > Loïc > >>>> > > > > > > > >>>> > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > >>>> > > <fischl@nmr.mgh.harvard.edu> > >>>> > > > > a écrit : > >>>> > > > > > > sure. All the fsaverages are in the same > >>>> space (they are > >>>> > > subsets > >>>> > > > > of > >>>> > > > > > > fsaverage) > >>>> > > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > >>>> > > > > > > > >>>> > > > > > > > > >>>> > > > > > > > External Email - Use Caution > >>>> > > > > > > > > >>>> > > > > > > > Hi Bruce, > >>>> > > > > > > > > >>>> > > > > > > > Thanks for your response. Is it also > >>>> fine for fsaverage5 > >>>> > > > > surface or I need to switch > >>>> > > > > > > my data to > >>>> > > > > > > > fsaverage? > >>>> > > > > > > > > >>>> > > > > > > > Thanks, > >>>> > > > > > > > > >>>> > > > > > > > Sincerely, > >>>> > > > > > > > > >>>> > > > > > > > Loïc > >>>> > > > > > > > > >>>> > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce > >>>> Fischl < > >>>> > > > > fischl@nmr.mgh.harvard.edu> a écrit : > >>>> > > > > > > > Hi Loic > >>>> > > > > > > > > >>>> > > > > > > > if you are on the fsaverage > >>>> surface you can save the > >>>> > > > > -log10(p) values > >>>> > > > > > > > using save_mgh.m, then load them > >>>> in freeview and > >>>> > > > > threshold them or > >>>> > > > > > > > whatever > >>>> > > > > > > > > >>>> > > > > > > > cheers > >>>> > > > > > > > Bruce > >>>> > > > > > > > On Mon, 20 May 2019, Loïc Daumail > >>>> wrote: > >>>> > > > > > > > > >>>> > > > > > > > > > >>>> > > > > > > > > External Email - Use > >>>> Caution > >>>> > > > > > > > > > >>>> > > > > > > > > Also, one more thing: > >>>> > > > > > > > > > >>>> > > > > > > > > My data is on fsaverage5 > >>>> resolution. > >>>> > > > > > > > > > >>>> > > > > > > > > Thanks in advance, > >>>> > > > > > > > > > >>>> > > > > > > > > Sincerely, > >>>> > > > > > > > > > >>>> > > > > > > > > Loïc > >>>> > > > > > > > > > >>>> > > > > > > > > Le lun. 20 mai 2019 à 09:49, > >>>> Loïc Daumail < > >>>> > > > > loic.daumail@gmail.com> a écrit : > >>>> > > > > > > > > Dear Freesurfer community, > >>>> > > > > > > > > > >>>> > > > > > > > > I obtained score matrices of > >>>> surfaces after > >>>> > > performing > >>>> > > > > diffusion embedding map > >>>> > > > > > > on fMRI > >>>> > > > > > > > data. > >>>> > > > > > > > > > >>>> > > > > > > > > I am now using the SurfStat > >>>> toolbox(Matlab) in > >>>> > order > >>>> > > > > to obtain p-value maps to > >>>> > > > > > > compare > >>>> > > > > > > > between > >>>> > > > > > > > > two groups. > >>>> > > > > > > > > > >>>> > > > > > > > > After obtaining the p-value > >>>> map, I would like to > >>>> > > label > >>>> > > > > the surface in order to > >>>> > > > > > > > identify the > >>>> > > > > > > > > regions of significant > >>>> difference between both > >>>> > > groups. > >>>> > > > > > > > > > >>>> > > > > > > > > Would it be possible to use > >>>> Freview in order to do > >>>> > > it? > >>>> > > > > > > > > If so, which format should I > >>>> use for my SurfStatP > >>>> > > > > output p-value map? > >>>> > > > > > > > > How would you do it, (tools to > >>>> convert into a > >>>> > > specific > >>>> > > > > format, surfaces and > >>>> > > > > > > atlas to > >>>> > > > > > > > load on > >>>> > > > > > > > > Freeview, which format for > >>>> those ones)? > >>>> > > > > > > > > I would be very grateful if you > >>>> could detail a > >>>> > bit, > >>>> > > as > >>>> > > > > I am new to these > >>>> > > > > > > tools! > >>>> > > > > > > > > > >>>> > > > > > > > > Thanks in advance, > >>>> > > > > > > > > > >>>> > > > > > > > > Loïc Daumail > >>>> > > > > > > > > > >>>> > > > > > > > > > >>>> > > > > > > > > >>>> >_______________________________________________ > >>>> > > > > > > > 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 > >>>> > > > > > > > >>>> > > > > > > > >>>> > > > > > >_______________________________________________ > >>>> > > > > > Freesurfer mailing list > >>>> > > > > > Freesurfer@nmr.mgh.harvard.edu > >>>> > > > > > > >>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > >>>> > > > > > >>>> > > > > -- > >>>> > > > > Dr. Tim Schäfer > >>>> > > > > Postdoc Computational Neuroimaging > >>>> > > > > Department of Child and Adolescent Psychiatry, > >>>> Psychosomatics and > >>>> > > > > Psychotherapy > >>>> > > > > University Hospital Frankfurt, Goethe University > >>>> Frankfurt am Main, > >>>> > > Germany > >>>> > > > > > >>>> > > > > _______________________________________________ > >>>> > > > > 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 > >>>> > > > >>>> > > _______________________________________________ > >>>> > > 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 > >>>> > > >>>> > > >>>> >_______________________________________________ > >>>> Freesurfer mailing list > >>>> Freesurfer@nmr.mgh.harvard.edu > >>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > >>> > >>> > >>> _______________________________________________ > >>> Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://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 > >> > >> > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer -- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Just a short note regarding these errors:
Le lun. 24 juin 2019 à 16:50, Loïc Daumail loic.daumail@gmail.com a écrit :
However, using mri_convert, I still get the same message with tclsh. " mri_convert lh.thickness template.mgh /usr/share/modules/init/bash: line 36: /usr/bin/tclsh: No such file or directory /usr/share/modules/init/bash: line 58: export: _moduleraw: not a function /usr/share/modules/init/bash: line 60: export: module: not a function mri_convert.bin lh.thickness template.mgh
[...]
If I had to guess I would say you are trying to run this on some HPC system that is using environment-modules (http://modules.sourceforge.net/) to make different software versions available to its users.
I have no idea whether these are just warnings and whether they affect the FreeSurfer output or not (it seems they don't), but maybe you should still ask the administrators of the cluster about them.
It could be that all you have to do to get rid of them is something like
module load tcsh
to get rid of them, but that's just guessing. Better ask the admins.
Best,
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
why do you have 18715 elements? How did you create it? You can run mri_info on the .mgz volume to see if it has the correct dimensions.
BTW: you might repost your original question early next week if you haven't resolve things. Doug is back and probably has an easy way to do what you want
cheers Bruce
On Fri, 21 Jun 2019, Loïc Daumail wrote:
External Email - Use Caution
Hi Bruce,
Thanks for your tip. Unfortunately, I am still running through an error... I have a matrix of 18715 elements regarding both hemispheres. The size of fsaverage5 is 20484 I believe, so I filled the remaining elements with zeros, and also tried with rand().
The other issue is that I am not so sure which part of the matrix is for lh and the other one for rh. Thus, I divided 18715/2 and took the 9357 first elements of the 18715 matrix. Then filled it with zeros or random values to reach 10242.
Then I saved it with save_mgh function and tried to load it with freeview using the following command line: freeview -f~/Documents/recon_all_success/freesurfer/fsaverage5/surf/lh.pial:overlay=~/Documents/emb_output/mgh _format/lh_emb_sub-002_compassion.mgz
I am getting the following error: " Did not find any volume info 2 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Sig... ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Unknown Name on a linux-gnu named loic-HP-ZBook-17 by loic Fri Jun 21 12:15:53 2019 [0]PETSC ERROR: Libraries linked from/autofs/space/lyon_006/pubsw/Linux2-2.3-x86_64/packages/petsc/2.3.3-p13/src/petsc-2.3.3-p13/lib/lin ux-gnu-c-opt [0]PETSC ERROR: Configure run at Tue Aug 10 15:01:59 2010 [0]PETSC ERROR: Configure options --with-debugging=no --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=0 --download-mpich=1 --with-mpi=1 --with-x=0 --with-gnu-copyright-code=0 --with-shared=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0"
Any idea of what could be wrong in my process?
Thanks
Sincerely,
Loïc
Le jeu. 20 juin 2019 à 19:39, Bruce Fischl fischl@nmr.mgh.harvard.edu a écrit : Hi Loïc
the .mgz file should having dimensions nvertices x 1 x 1 for freeview to know it is a surface overlay I believe cheers Bruce On Thu, 20 Jun 2019, Loïc Daumail wrote: > > External Email - Use Caution > > Hi Bruce, > > I am reaching out to you, as I am trying to load the surface scalar values of diffusion embedding > for overlay on a pial surface in Freeview. > > I used save_mgh to save a scalar matrix containing surface embedding values in an .mgz format. > However I can't load it in freeview, be either only half of the matrix data (one hemisphere I > assume) or the whole matrix saved in the same file. > > Is there anything specific I need to do in order to be able to visualize a scalar overlay on a > surface? Is .mgz a wrong format for scalar values? I also tried with .nii.gz, or .mgh. I am not even > sure save_mgh can do all this... > > Thanks in advance, > > Sincerely, > > Loïc > > > > Le lun. 27 mai 2019 à 11:54, Loïc Daumail <loic.daumail@gmail.com> a écrit : > Hi Tim, > > Your link works perfectly, it's awesome! > Thanks a lot, > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:43, Loïc Daumail <loic.daumail@gmail.com> a écrit : > Hi Tim, > > 'mean_rest' is a diffusion embedding map, which contains scores for every vertex on > fsaverage5 surface resolution. > 'surf.b' is the pial surface of both hemispheres of fsaverage5... I also tried forjust > lh hemisphere, but it gives me the same result... > > Thanks for the link! > > Best, > > Loïc > > Le lun. 27 mai 2019 à 11:20, Tim Schäfer <ts+ml@rcmd.org> a écrit : > External Email - Use Caution > > Hi Loïc, > > that does not look correct, the data is definitely off. I'm not sure where > the variables `mean_rest` and `surf.b` come from in your code, and I suspect > that something is wrong with them. > > In the meantime, I got interested in this myself and put together some code > that will load the Desikan data for both hemispheres and display it in > surfstat. Feel free to use it, there also is an example screenshot of the > results: > > > https://github.com/dfsp-spirit/comp_neuro_science/tree/master/surfstat_desikan > > Best, > > Tim > > -- > Dr. Tim Schäfer > Postdoc Computational Neuroimaging > Department of Child and Adolescent Psychiatry, Psychosomatics and > Psychotherapy > University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > > > On May 27, 2019 at 11:01 AM Loïc Daumail <loic.daumail@gmail.com> wrote: > > > > > > External Email - Use Caution > > > > Hi Tim, > > > > Thanks a lot for your help, indeed, this is exactly what I needed! > > I wrote this : > > " > > subjects_dir = '/home/loic/Documents/recon_all_success/freesurfer/'; > > subject_id = 'sub-004'; > > hemi = 'lh'; > > > > aparc_file_this_hemi = fullfile(subjects_dir, subject_id, 'label', > > sprintf("%s.aparc.annot", hemi)); > > [vertices, label, colortable] = read_annotation(aparc_file_this_hemi); > > fprintf("Read aparc parcellation file '%s' containing %d regions.\n", > > aparc_file_this_hemi, length(colortable.struct_names)); > > for sidx = 1:length(colortable.struct_names) > > region = colortable.struct_names{sidx}; > > struct_code = colortable.table(sidx, 5); > > vertices_of_struct_roi = find(label == struct_code); > > fprintf("Found region '%s' with %d verts.\n", region, > > length(vertices_of_struct_roi)); > > end > > fig1 = figure(); > > SurfStatView(mean_rest, surf.b); > > SurfStatColormap(colortable.table(:,1:3)/255); > > " > > However, the image I obtain seems a bit fuzzy...( see attached) > > Is it because of my data? > > > > Thanks in advance, > > > > Loïc > > > > > > Le jeu. 23 mai 2019 à 17:20, Tim Schäfer <ts+ml@rcmd.org> a écrit : > > > > > External Email - Use Caution > > > > > > Afaik SurfStat is not maintained anymore and I think it's been this way > > > for quite a while now. Maybe someone else knows better? > > > > > > The website is at http://www.math.mcgill.ca/keith/surfstat/ and it says > > > 'Updated 26 September 2008'. I'm not sure whether that's really true, > but > > > at least for the last 14 months (the only time frame I know about), > there > > > have not been any changes to that website or any new releases of > SurfStat. > > > > > > Tim > > > > > > > On May 23, 2019 at 4:36 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu> > > > wrote: > > > > > > > > > > > > Hi Loic > > > > > > > > sorry, can you ask whoever maintains surfstat? Or maybe someone else > on > > > the > > > > list knows? I don't. You can label surfaces manually with the dev > > > version > > > > of freeview if you want. > > > > > > > > cheers > > > > Bruce > > > > > > > > > > > > On Thu, 23 May 2019, Loïc > > > > Daumail wrote: > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > Hi Bruce, > > > > > > > > > > I am coming back to this request as I was wondering: > > > > > would it be possible to load freesurfer surface atlases in surfstat > in > > > order to label my surfaces? > > > > > Is their format compatible? I saw surfstat only accepts a limited > > > array of formats... > > > > > > > > > > Thanks, > > > > > Best, > > > > > > > > > > Loïc > > > > > > > > > > Le lun. 20 mai 2019 à 16:15, Bruce Fischl > <fischl@nmr.mgh.harvard.edu> > > > a écrit : > > > > > sure. All the fsaverages are in the same space (they are > subsets > > > of > > > > > fsaverage) > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > Hi Bruce, > > > > > > > > > > > > Thanks for your response. Is it also fine for fsaverage5 > > > surface or I need to switch > > > > > my data to > > > > > > fsaverage? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Loïc > > > > > > > > > > > > Le lun. 20 mai 2019 à 15:52, Bruce Fischl < > > > fischl@nmr.mgh.harvard.edu> a écrit : > > > > > > Hi Loic > > > > > > > > > > > > if you are on the fsaverage surface you can save the > > > -log10(p) values > > > > > > using save_mgh.m, then load them in freeview and > > > threshold them or > > > > > > whatever > > > > > > > > > > > > cheers > > > > > > Bruce > > > > > > On Mon, 20 May 2019, Loïc Daumail wrote: > > > > > > > > > > > > > > > > > > > > External Email - Use Caution > > > > > > > > > > > > > > Also, one more thing: > > > > > > > > > > > > > > My data is on fsaverage5 resolution. > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > > > Loïc > > > > > > > > > > > > > > Le lun. 20 mai 2019 à 09:49, Loïc Daumail < > > > loic.daumail@gmail.com> a écrit : > > > > > > > Dear Freesurfer community, > > > > > > > > > > > > > > I obtained score matrices of surfaces after > performing > > > diffusion embedding map > > > > > on fMRI > > > > > > data. > > > > > > > > > > > > > > I am now using the SurfStat toolbox(Matlab) in order > > > to obtain p-value maps to > > > > > compare > > > > > > between > > > > > > > two groups. > > > > > > > > > > > > > > After obtaining the p-value map, I would like to > label > > > the surface in order to > > > > > > identify the > > > > > > > regions of significant difference between both > groups. > > > > > > > > > > > > > > Would it be possible to use Freview in order to do > it? > > > > > > > If so, which format should I use for my SurfStatP > > > output p-value map? > > > > > > > How would you do it, (tools to convert into a > specific > > > format, surfaces and > > > > > atlas to > > > > > > load on > > > > > > > Freeview, which format for those ones)? > > > > > > > I would be very grateful if you could detail a bit, > as > > > I am new to these > > > > > tools! > > > > > > > > > > > > > > Thanks in advance, > > > > > > > > > > > > > > Loïc Daumail > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > > 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 > > > > > > > > > > > > > > >_______________________________________________ > > > > Freesurfer mailing list > > > > Freesurfer@nmr.mgh.harvard.edu > > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > -- > > > Dr. Tim Schäfer > > > Postdoc Computational Neuroimaging > > > Department of Child and Adolescent Psychiatry, Psychosomatics and > > > Psychotherapy > > > University Hospital Frankfurt, Goethe University Frankfurt am Main, > Germany > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > 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
freesurfer@nmr.mgh.harvard.edu