Making Functional labels from spatial temporal clustering

Dear All,

Recently, I am trying to make functional labels from a group of subjects.
I first refer the 2sample clustering scripts. I get some significant
clusters and derive the source estimates.
if I apply 'stc_to_label' to make functional labels directly, the size of
the functional labels is too large.
I also try to use percentile of 95 to restrict the size, but I can not
explain what the actual meaning
of this threshold.
Can someone give me some tips?
Thanks a lot!

Best wishes,
Qunxi Dong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160811/bb25929c/attachment.html

Dear all,

For you easier understanding my problem, I made a gist and paste the
critical codes in the following link:

Thanks, looking forward to your response.

Best wishes,
Qunxi Dong

2016-08-11 17:52 GMT+02:00 ??? <dongqunxi at gmail.com>:

Dear All,

Recently, I am trying to make functional labels from a group of subjects.
I first refer the 2sample clustering scripts. I get some significant
clusters and derive the source estimates.
if I apply 'stc_to_label' to make functional labels directly, the size of
the functional labels is too large.
I also try to use percentile of 95 to restrict the size, but I can not
explain what the actual meaning
of this threshold.
Can someone give me some tips?
Thanks a lot!

Best wishes,
Qunxi Dong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160811/a83a9503/attachment.html

Dear Qunxi,

the output of `summarize_clusters_stc? is a bit poorly documented (I?ve opened a pull request for it to be fixed in future versions of MNE).

The output is as follows:

    out : instance of SourceEstimate
        A summary of the clusters. The first time point in this SourceEstimate
        object is the summation of all the clusters. Subsequent time points
        contain each individual cluster. The magniture of the activity
        corresponds to the length the cluster spans in time (in samples).

So it is perfectly reasonable to create labels from the clusters. However, you do not need to take the mean across the time points or anything like that. Also, thresholding does not do what you want. Instead, this should work:

stc = summarize_clusters_stc(clu, p_thre, tstep=tstep,
                                                 tmin=tmin, vertices=fsave_vertices,
                                                subject='fsaverage')
lh_labels, rh_labels = mne.stc_to_label(stc, src=src, smooth=True,
                                  subjects_dir=subjects_dir, connected=True)

The labels look bigger than the clusters as visualised with stc.plot(?), because the plotting functions applies its own thesholding. Try to visualise it without any thresholding by doing this:

b = stc.plot(hemi=?both?, subject=subject, subject_dir=subject_dir)
b.scale_data_colormap(0, stc.data.mean(), stc.data.max(), True)

Let me know if you have further questions.

Marijn.

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant to the
stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons corrected is
0.001.
I get two significant clusters only, that is one cluster per hemisphere.
When I ploted as you said, the two clusters nearly cover the whole Brain.
For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

Best wishes,
Qunxi Dong

2016-08-12 8:09 GMT+02:00 ??? <dongqunxi at gmail.com>:

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant to
the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons corrected is
0.001.
I get two significant clusters only, that is one cluster per hemisphere.
When I ploted as you said, the two clusters nearly cover the whole Brain.
For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

2016-08-11 20:05 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Dear Qunxi,

the output of `summarize_clusters_stc? is a bit poorly documented (I?ve
opened a pull request for it to be fixed in future versions of MNE).

The output is as follows:

    out : instance of SourceEstimate
        A summary of the clusters. The first time point in this
SourceEstimate
        object is the summation of all the clusters. Subsequent time
points
        contain each individual cluster. The magniture of the activity
        corresponds to the length the cluster spans in time (in samples).

So it is perfectly reasonable to create labels from the clusters.
However, you do not need to take the mean across the time points or
anything like that. Also, thresholding does not do what you want. Instead,
this should work:

stc = summarize_clusters_stc(clu, p_thre, tstep=tstep,
                                                 tmin=tmin,
vertices=fsave_vertices,
                                                subject='fsaverage')
lh_labels, rh_labels = mne.stc_to_label(stc, src=src, smooth=True,
                                  subjects_dir=subjects_dir,
connected=True)

The labels look bigger than the clusters as visualised with stc.plot(?),
because the plotting functions applies its own thesholding. Try to
visualise it without any thresholding by doing this:

b = stc.plot(hemi=?both?, subject=subject, subject_dir=subject_dir)
b.scale_data_colormap(0, stc.data.mean(), stc.data.max(), True)

Let me know if you have further questions.

Marijn.

--
Marijn van Vliet
w.m.vanvliet at gmail.com

>
> Dear all,
>
> For you easier understanding my problem, I made a gist and paste the
critical codes in the following link:
> Get functional labels with the help of spatial-temporal clustering. · GitHub
> Thanks, looking forward to your response.
>
> Best wishes,
> Qunxi Dong
>
> 2016-08-11 17:52 GMT+02:00 ??? <dongqunxi at gmail.com>:
> Dear All,
>
> Recently, I am trying to make functional labels from a group of
subjects.
> I first refer the 2sample clustering scripts. I get some significant
clusters and derive the source estimates.
> if I apply 'stc_to_label' to make functional labels directly, the size
of the functional labels is too large.
> I also try to use percentile of 95 to restrict the size, but I can not
explain what the actual meaning
> of this threshold.
> Can someone give me some tips?
> Thanks a lot!
>
> Best wishes,
> Qunxi Dong
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> The information in this e-mail is intended only for the person to whom
it is
> addressed. If you believe this e-mail was sent to you in error and the
e-mail
> contains patient information, please contact the Partners Compliance
HelpLine at
> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
> but does not contain patient information, please contact the sender and
properly
> dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/5f31e769/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cluster_plots.png
Type: image/png
Size: 196075 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/5f31e769/attachment-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: permu8192_pthr0.0010_mv10_sti_LLst,temp_0.001,tmin_0.000-lh.stc
Type: application/vnd.sun.xml.calc.template
Size: 163888 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/5f31e769/attachment-0001.stc

Well, if the cluster permutation test returns clusters that span the entire
brain, then that's the way it is. The signals are different pre- and
post-stimulus all across the brain.

Dear Marijin,

We prefer to get focal clusters attributed to the stimulus, and if we use
95 percentile as the threshold to shrink the clusters, it can show some
meaningful ROIs. But we do not know how to explain the threshold (such as
190).

Best wishes,
Qunxi Dong

2016-08-12 11:54 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Well, if the cluster permutation test returns clusters that span the
entire brain, then that's the way it is. The signals are different pre- and
post-stimulus all across the brain.

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant to
the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons corrected
is 0.001.
I get two significant clusters only, that is one cluster per hemisphere.
When I ploted as you said, the two clusters nearly cover the whole Brain.
For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

Best wishes,
Qunxi Dong

2016-08-12 8:09 GMT+02:00 ??? <dongqunxi at gmail.com>:

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant to
the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons corrected
is 0.001.
I get two significant clusters only, that is one cluster per hemisphere.
When I ploted as you said, the two clusters nearly cover the whole
Brain. For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

2016-08-11 20:05 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Dear Qunxi,

the output of `summarize_clusters_stc? is a bit poorly documented (I?ve
opened a pull request for it to be fixed in future versions of MNE).

The output is as follows:

    out : instance of SourceEstimate
        A summary of the clusters. The first time point in this
SourceEstimate
        object is the summation of all the clusters. Subsequent time
points
        contain each individual cluster. The magniture of the activity
        corresponds to the length the cluster spans in time (in
samples).

So it is perfectly reasonable to create labels from the clusters.
However, you do not need to take the mean across the time points or
anything like that. Also, thresholding does not do what you want. Instead,
this should work:

stc = summarize_clusters_stc(clu, p_thre, tstep=tstep,
                                                 tmin=tmin,
vertices=fsave_vertices,
                                                subject='fsaverage')
lh_labels, rh_labels = mne.stc_to_label(stc, src=src, smooth=True,
                                  subjects_dir=subjects_dir,
connected=True)

The labels look bigger than the clusters as visualised with
stc.plot(?), because the plotting functions applies its own thesholding.
Try to visualise it without any thresholding by doing this:

b = stc.plot(hemi=?both?, subject=subject, subject_dir=subject_dir)
b.scale_data_colormap(0, stc.data.mean(), stc.data.max(), True)

Let me know if you have further questions.

Marijn.

--
Marijn van Vliet
w.m.vanvliet at gmail.com

>
> Dear all,
>
> For you easier understanding my problem, I made a gist and paste the
critical codes in the following link:
> Get functional labels with the help of spatial-temporal clustering. · GitHub
> Thanks, looking forward to your response.
>
> Best wishes,
> Qunxi Dong
>
> 2016-08-11 17:52 GMT+02:00 ??? <dongqunxi at gmail.com>:
> Dear All,
>
> Recently, I am trying to make functional labels from a group of
subjects.
> I first refer the 2sample clustering scripts. I get some significant
clusters and derive the source estimates.
> if I apply 'stc_to_label' to make functional labels directly, the
size of the functional labels is too large.
> I also try to use percentile of 95 to restrict the size, but I can
not explain what the actual meaning
> of this threshold.
> Can someone give me some tips?
> Thanks a lot!
>
> Best wishes,
> Qunxi Dong
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> The information in this e-mail is intended only for the person to
whom it is
> addressed. If you believe this e-mail was sent to you in error and
the e-mail
> contains patient information, please contact the Partners Compliance
HelpLine at
> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to
you in error
> but does not contain patient information, please contact the sender
and properly
> dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/95456b9e/attachment-0001.html

if you threshold the data in the STC, it means you are thresholding based
on the length of the cluster in time. So if you threshold by a value of
190, any vertices that survive are significantly different for at least 190
consecutive samples.

I'm sorry, but I'm unable to follow your logic. What do you mean by
*meaningful* ROIs?

Right now, it sounds to me like: if we manipulate the data so and so we get
the picture we want. Now we want a justification for our manipulation. But
that is probably not what you meant.

Maybe I can be of more help if you explain a bit more about your data and
what effect you are trying to visualize.

Dear Marijin,

OK. We have the MEG data related with visual task. By comparing data of
prestimulus and poststimulus, we want to find focal functional labels
related with visual cognitive process.
And then we want to make network analysis between the identified regions of
interest.

Best wishes,
Qunxi Dong

2016-08-12 13:17 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

if you threshold the data in the STC, it means you are thresholding based
on the length of the cluster in time. So if you threshold by a value of
190, any vertices that survive are significantly different for at least 190
consecutive samples.

I'm sorry, but I'm unable to follow your logic. What do you mean by
*meaningful* ROIs?

Right now, it sounds to me like: if we manipulate the data so and so we
get the picture we want. Now we want a justification for our manipulation.
But that is probably not what you meant.

Maybe I can be of more help if you explain a bit more about your data and
what effect you are trying to visualize.

Dear Marijin,

We prefer to get focal clusters attributed to the stimulus, and if we use
95 percentile as the threshold to shrink the clusters, it can show some
meaningful ROIs. But we do not know how to explain the threshold (such as
190).

Best wishes,
Qunxi Dong

2016-08-12 11:54 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Well, if the cluster permutation test returns clusters that span the
entire brain, then that's the way it is. The signals are different pre- and
post-stimulus all across the brain.

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant to
the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons corrected
is 0.001.
I get two significant clusters only, that is one cluster per hemisphere.
When I ploted as you said, the two clusters nearly cover the whole
Brain. For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

Best wishes,
Qunxi Dong

2016-08-12 8:09 GMT+02:00 ??? <dongqunxi at gmail.com>:

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant
to the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons
corrected is 0.001.
I get two significant clusters only, that is one cluster per
hemisphere.
When I ploted as you said, the two clusters nearly cover the whole
Brain. For your convenience,
I provide one STC file for your testing, and the plot of the clusters.

Best wishes,
Qunxi Dong

2016-08-11 20:05 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Dear Qunxi,

the output of `summarize_clusters_stc? is a bit poorly documented
(I?ve opened a pull request for it to be fixed in future versions of MNE).

The output is as follows:

    out : instance of SourceEstimate
        A summary of the clusters. The first time point in this
SourceEstimate
        object is the summation of all the clusters. Subsequent time
points
        contain each individual cluster. The magniture of the activity
        corresponds to the length the cluster spans in time (in
samples).

So it is perfectly reasonable to create labels from the clusters.
However, you do not need to take the mean across the time points or
anything like that. Also, thresholding does not do what you want. Instead,
this should work:

stc = summarize_clusters_stc(clu, p_thre, tstep=tstep,
                                                 tmin=tmin,
vertices=fsave_vertices,
                                                subject='fsaverage')
lh_labels, rh_labels = mne.stc_to_label(stc, src=src, smooth=True,
                                  subjects_dir=subjects_dir,
connected=True)

The labels look bigger than the clusters as visualised with
stc.plot(?), because the plotting functions applies its own thesholding.
Try to visualise it without any thresholding by doing this:

b = stc.plot(hemi=?both?, subject=subject, subject_dir=subject_dir)
b.scale_data_colormap(0, stc.data.mean(), stc.data.max(), True)

Let me know if you have further questions.

Marijn.

--
Marijn van Vliet
w.m.vanvliet at gmail.com

>
> Dear all,
>
> For you easier understanding my problem, I made a gist and paste
the critical codes in the following link:
> Get functional labels with the help of spatial-temporal clustering. · GitHub
> Thanks, looking forward to your response.
>
> Best wishes,
> Qunxi Dong
>
> 2016-08-11 17:52 GMT+02:00 ??? <dongqunxi at gmail.com>:
> Dear All,
>
> Recently, I am trying to make functional labels from a group of
subjects.
> I first refer the 2sample clustering scripts. I get some
significant clusters and derive the source estimates.
> if I apply 'stc_to_label' to make functional labels directly, the
size of the functional labels is too large.
> I also try to use percentile of 95 to restrict the size, but I can
not explain what the actual meaning
> of this threshold.
> Can someone give me some tips?
> Thanks a lot!
>
> Best wishes,
> Qunxi Dong
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> The information in this e-mail is intended only for the person to
whom it is
> addressed. If you believe this e-mail was sent to you in error and
the e-mail
> contains patient information, please contact the Partners
Compliance HelpLine at
> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to
you in error
> but does not contain patient information, please contact the sender
and properly
> dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/bee3ca5c/attachment-0001.html

Dear Qunxi,

if I understand correctly, then the permutation cluster tests in MNE may
not be suitable for what you want to do.

Consider this figure:
http://imgur.com/a/E8ais

This is the time course for a single dipole on the brain (simulated data).
If I understand your goal correctly, you would like to include this vertex
as part of a ROI, because it has increased activity after the stimulus has
been shown.

A cluster test as implemented in MNE would determine whether any
post-stimulus samples are higher than pre-stimulus samples *in a pairwise
fashion*. Thus, whether pre-stimulus sample 1 is higher than post-stimulus
sample 1, pre-stimulus sample 2 is higher than post-stimulus sample 2, etc.

What you most likely want instead is estimate some confidence interval for
the pre-stimulus values in general (red dashed line in the figure) and then
determine, given the post-interval data, whether to include the vertex yes
or no.

It is not surprising that the cluster test marked the entire brain as ROI,
because it is very likely for the time course of a vertex to be higher than
the pre-stimulus at some point, even if the stimulus didn't activate the
vertex at all (and the pre-stimulus and post-stimulus data were drawn from
the same distribution).

At this point, a thresholding operation that only passes vertices for which
the activation surpasses the pre-stimulus activity for a minimum amount of
time makes sense. However, you would need to be careful to set it to a
sensible value.

I think you'll need to implement the procedure to mark the vertices to
include yourself. Then, you can use the stc_to_label function to cut it up
in spatially connected ROIs.

At any rate, I think the result of "showing a stimulus activates the entire
brain" actually makes sense. Showing a stimulus would do that, although not
all parts in the equal amounts.

That's all the help I can give you. Good luck with your study. May your
p-values be significant! :slight_smile:

Kind regards,
Marijn.

Thanks for your patience, nice explanation!

Best wishes,
Qunxi Dong

2016-08-12 16:10 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Dear Qunxi,

if I understand correctly, then the permutation cluster tests in MNE may
not be suitable for what you want to do.

Consider this figure:
Simulated signal for a vertex on the visual cortex - Album on Imgur

This is the time course for a single dipole on the brain (simulated data).
If I understand your goal correctly, you would like to include this vertex
as part of a ROI, because it has increased activity after the stimulus has
been shown.

A cluster test as implemented in MNE would determine whether any
post-stimulus samples are higher than pre-stimulus samples *in a pairwise
fashion*. Thus, whether pre-stimulus sample 1 is higher than
post-stimulus sample 1, pre-stimulus sample 2 is higher than post-stimulus
sample 2, etc.

What you most likely want instead is estimate some confidence interval for
the pre-stimulus values in general (red dashed line in the figure) and then
determine, given the post-interval data, whether to include the vertex yes
or no.

It is not surprising that the cluster test marked the entire brain as ROI,
because it is very likely for the time course of a vertex to be higher than
the pre-stimulus at some point, even if the stimulus didn't activate the
vertex at all (and the pre-stimulus and post-stimulus data were drawn from
the same distribution).

At this point, a thresholding operation that only passes vertices for
which the activation surpasses the pre-stimulus activity for a minimum
amount of time makes sense. However, you would need to be careful to set it
to a sensible value.

I think you'll need to implement the procedure to mark the vertices to
include yourself. Then, you can use the stc_to_label function to cut it up
in spatially connected ROIs.

At any rate, I think the result of "showing a stimulus activates the
entire brain" actually makes sense. Showing a stimulus would do that,
although not all parts in the equal amounts.

That's all the help I can give you. Good luck with your study. May your
p-values be significant! :slight_smile:

Kind regards,
Marijn.

Dear Marijin,

OK. We have the MEG data related with visual task. By comparing data of
prestimulus and poststimulus, we want to find focal functional labels
related with visual cognitive process.
And then we want to make network analysis between the identified regions
of interest.

Best wishes,
Qunxi Dong

2016-08-12 13:17 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

if you threshold the data in the STC, it means you are thresholding
based on the length of the cluster in time. So if you threshold by a value
of 190, any vertices that survive are significantly different for at least
190 consecutive samples.

I'm sorry, but I'm unable to follow your logic. What do you mean by
*meaningful* ROIs?

Right now, it sounds to me like: if we manipulate the data so and so we
get the picture we want. Now we want a justification for our manipulation.
But that is probably not what you meant.

Maybe I can be of more help if you explain a bit more about your data
and what effect you are trying to visualize.

Dear Marijin,

We prefer to get focal clusters attributed to the stimulus, and if we
use 95 percentile as the threshold to shrink the clusters, it can show some
meaningful ROIs. But we do not know how to explain the threshold (such
as 190).

Best wishes,
Qunxi Dong

2016-08-12 11:54 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>:

Well, if the cluster permutation test returns clusters that span the
entire brain, then that's the way it is. The signals are different pre- and
post-stimulus all across the brain.

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then the
comparisons are made
between the two groups data. I want to identify clusters significant
to the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons
corrected is 0.001.
I get two significant clusters only, that is one cluster per
hemisphere.
When I ploted as you said, the two clusters nearly cover the whole
Brain. For your convenience,
I provide one STC file for your testing, and the plot of the
clusters.

Best wishes,
Qunxi Dong

Best wishes,
Qunxi Dong

2016-08-12 8:09 GMT+02:00 ??? <dongqunxi at gmail.com>:

Dear Marijin,

Thanks for your response.
I need to introduce how I use 2sample spatial clustering on our data:
I make groups of prestimulus data and poststimulus data, and then
the comparisons are made
between the two groups data. I want to identify clusters significant
to the stimulus.
The p_value for f_threshold is 0.001, p_value for comparisons
corrected is 0.001.
I get two significant clusters only, that is one cluster per
hemisphere.
When I ploted as you said, the two clusters nearly cover the whole
Brain. For your convenience,
I provide one STC file for your testing, and the plot of the
clusters.

Best wishes,
Qunxi Dong

2016-08-11 20:05 GMT+02:00 Marijn van Vliet <w.m.vanvliet at gmail.com>
:

Dear Qunxi,

the output of `summarize_clusters_stc? is a bit poorly documented
(I?ve opened a pull request for it to be fixed in future versions of MNE).

The output is as follows:

    out : instance of SourceEstimate
        A summary of the clusters. The first time point in this
SourceEstimate
        object is the summation of all the clusters. Subsequent
time points
        contain each individual cluster. The magniture of the
activity
        corresponds to the length the cluster spans in time (in
samples).

So it is perfectly reasonable to create labels from the clusters.
However, you do not need to take the mean across the time points or
anything like that. Also, thresholding does not do what you want. Instead,
this should work:

stc = summarize_clusters_stc(clu, p_thre, tstep=tstep,
                                                 tmin=tmin,
vertices=fsave_vertices,
                                                subject='fsaverage')
lh_labels, rh_labels = mne.stc_to_label(stc, src=src, smooth=True,
                                  subjects_dir=subjects_dir,
connected=True)

The labels look bigger than the clusters as visualised with
stc.plot(?), because the plotting functions applies its own thesholding.
Try to visualise it without any thresholding by doing this:

b = stc.plot(hemi=?both?, subject=subject, subject_dir=subject_dir)
b.scale_data_colormap(0, stc.data.mean(), stc.data.max(), True)

Let me know if you have further questions.

Marijn.

--
Marijn van Vliet
w.m.vanvliet at gmail.com

>
> Dear all,
>
> For you easier understanding my problem, I made a gist and paste
the critical codes in the following link:
> https://gist.github.com/dongqunxi/daca753366c592927ff789c03aa6ed
0b
> Thanks, looking forward to your response.
>
> Best wishes,
> Qunxi Dong
>
> 2016-08-11 17:52 GMT+02:00 ??? <dongqunxi at gmail.com>:
> Dear All,
>
> Recently, I am trying to make functional labels from a group of
subjects.
> I first refer the 2sample clustering scripts. I get some
significant clusters and derive the source estimates.
> if I apply 'stc_to_label' to make functional labels directly, the
size of the functional labels is too large.
> I also try to use percentile of 95 to restrict the size, but I
can not explain what the actual meaning
> of this threshold.
> Can someone give me some tips?
> Thanks a lot!
>
> Best wishes,
> Qunxi Dong
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> The information in this e-mail is intended only for the person to
whom it is
> addressed. If you believe this e-mail was sent to you in error
and the e-mail
> contains patient information, please contact the Partners
Compliance HelpLine at
> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent
to you in error
> but does not contain patient information, please contact the
sender and properly
> dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to
whom it is
addressed. If you believe this e-mail was sent to you in error and
the e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to
you in error
but does not contain patient information, please contact the sender
and properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to
you in error
but does not contain patient information, please contact the sender
and properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

--
--
Marijn van Vliet

w.m.vanvliet at gmail.com
marijn.vanvliet at aalto.fi

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160812/435975a3/attachment-0001.html