<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Dennis,&nbsp;
<div class=""><br class="">
</div>
<div class="">I get the same error for the spatio_temporal_cluster_test:&nbsp;</div>
<div class="">ValueError: could not broadcast input array from shape (1000) into shape (614520)</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><br class="webkit-block-placeholder">
</div>
<div class=""><br class="webkit-block-placeholder">
</div>
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
On 13 Jun 2017, at 07:45, Denis-Alexander Engemann &lt;<a href="mailto:denis.engemann@gmail.com" class="">denis.engemann@gmail.com</a>&gt; wrote:</div>
</div>
</div>
</div>
</div>
<div><br class="Apple-interchange-newline">
<div class="">That does not look obviously wrong. Does it work?<br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Tue, 13 Jun 2017 at 00:43, Talitha Ford &lt;<a href="mailto:tcford@swin.edu.au" class="">tcford@swin.edu.au</a>&gt; wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Thanks Dennis, I had included a ttest as the stat_fun in the previous command, though.
<div class=""><br class="">
<div class="">From what I understand, for a ttest, my code should look more like this:</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">#~ X1= np.abs(X1)</div>
<div class="">#~ X2 np.abs(X2)</div>
<div class=""><br class="">
</div>
<div class="">print('Computing connectivity.')</div>
<div class="">connectivity = spatial_tris_connectivity(grade_to_tris(5))</div>
<div class=""><br class="">
</div>
<div class=""># &nbsp; &nbsp;Note that X needs to be a list of multi-dimensional array of shape</div>
<div class=""># &nbsp; &nbsp;samples (subjects_k) x time x space, so we permute dimensions</div>
<div class="">X1 = np.transpose(X1, [2,1,0])</div>
<div class="">X2 = np.transpose(X2, [2,1,0])</div>
<div class="">all_data = [X2, X1]</div>
<div class=""><br class="">
</div>
<div class="">p_threshold = 0.0001</div>
<div class=""><br class="">
</div>
<div class="">#~ f_threshold = stats.distributions.f.ppf(1. - p_threshold / 2.,</div>
<div class="">&nbsp; &nbsp; #~ len(X2) - 1, len(X1) - 1)</div>
<div class=""><br class="">
</div>
<div class="">t_threshold = stats.distributions.t.ppf(p_threshold / 2.,</div>
<div class="">&nbsp; &nbsp; len(X2) - 1, len(X1) - 1)</div>
<div class=""><br class="">
</div>
<div class="">print('Clustering.')</div>
</div>
</div>
</div>
<div style="word-wrap:break-word" class="">
<div class="">
<div class="">
<div class="">T_obs, clusters, cluster_p_values, H0 = clu =\</div>
</div>
</div>
</div>
<div style="word-wrap:break-word" class="">
<div class="">
<div class="">
<div class=""><span class="m_3583841562347940982Apple-tab-span" style="white-space:pre-wrap"></span>spatio_temporal_cluster_test(all_data, connectivity=connectivity, n_jobs=2, threshod= t_threshold, stat_fun= scipy.stats.ttest_ind)</div>
<div class=""><br class="">
</div>
</div>
<div class="">Commenting out the conversation of the data to absolute values, calculating a t_threshold, and including ttest_ind as the stat_fun? Sorry if I have misunderstood something.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,<br class="">
<div class="">
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
<div class="">
<div style="word-wrap:break-word" class="">Talitha&nbsp;</div>
</div>
</div>
</div>
<br class="m_3583841562347940982Apple-interchange-newline">
<br class="m_3583841562347940982Apple-interchange-newline">
</div>
</div>
</div>
</div>
</div>
<div style="word-wrap:break-word" class="">
<div class="">
<div class="">
<div class=""><br class="">
<div class="">
<div class="">On 12 Jun 2017, at 17:27, Denis-Alexander Engemann &lt;<a href="mailto:denis.engemann@gmail.com" target="_blank" class="">denis.engemann@gmail.com</a>&gt; wrote:</div>
<br class="m_3583841562347940982Apple-interchange-newline">
<div class="">Ahh. For two conditions F should be the abs(T**2). You can just use a t-test for indpendent samples here instead as statfun.<br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Mon, 12 Jun 2017 at 10:13, Talitha Ford &lt;<a href="mailto:tcford@swin.edu.au" target="_blank" class="">tcford@swin.edu.au</a>&gt; wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Hi Dennis,<span class=""><br class="">
Thank you, this is the script I’ve been working from. The problem I am having though, is that as f-stats are &gt;0, they do not indicate which group is larger than the other, which is what I would like to know. I have tried to use scipy.stats.ttest_ind&nbsp;but I get
 this error:<br class="">
</span><span class="">ValueError: could not broadcast input array from shape (1000) into shape (614520)<br class="">
</span><span class=""><br class="">
</span>
<div class="">The command is:</div>
<div class="">&nbsp;T_obs, clusters, cluster_p_values, H0 = clu =\</div>
<div class=""><span class="m_3583841562347940982m_1290456277243168132Apple-tab-span" style="white-space:pre-wrap"></span>spatio_temporal_cluster_test(all_data, connectivity=connectivity, n_jobs=2, stat_fun= scipy.stats.ttest_ind)</div>
<div class=""><br class="">
</div>
<div class="">all_data is 2 lists (2 groups) of 16 and 19 participants, with 30 time points of 20484 vertices for each participant.</div>
<div class=""><br class="">
</div>
<div class="">I hope that makes sense (and there is a possible work around!). Thanks again for you help,</div>
<div class=""><br class="">
<div class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class="">
<div class="">
<div style="word-wrap:break-word" class="">Talitha&nbsp;</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="word-wrap:break-word" class="">
<div class="">
<div class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class="">
<div class="">
<div style="word-wrap:break-word" class=""><br class="">
</div>
<div style="word-wrap:break-word" class=""><br class="">
On 12 Jun 2017, at 05:33, Denis-Alexander Engemann &lt;<a href="mailto:denis.engemann@gmail.com" target="_blank" class="">denis.engemann@gmail.com</a>&gt; wrote:</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="word-wrap:break-word" class="">
<div class="">
<div class=""><br class="m_3583841562347940982m_1290456277243168132Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi Talitha,
<div class=""><br class="">
</div>
<div class="">you can run the permutation clustering with a wide array of contrasts. This might be what you are looking for:</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://martinos.org/mne/dev/auto_tutorials/plot_stats_cluster_spatio_temporal_2samp.html" target="_blank" class="">http://martinos.org/mne/dev/auto_tutorials/plot_stats_cluster_spatio_temporal_2samp.html</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I hope this helps,</div>
<div class="">Denis</div>
<div class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Sun, Jun 11, 2017 at 12:00 PM Talitha Ford &lt;<a href="mailto:tcford@swin.edu.au" target="_blank" class="">tcford@swin.edu.au</a>&gt; wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br class="">
<br class="">
Similar to conducing a pair samples t-test on source data using spatio-temporal clustering, allowing the visualisation of clusters where condition A &gt; condition B and vice versa, is it possible to run an independent samples t-test to visualise differences between
 two groups? The 2 samples permutation tests currently available are limited in that they plot F statistics that don’t give a direction of the difference between the groups. Basically, is it possible to identify clusters that differ significantly between the
 groups, as well as identify/visualise the direction in which they differ?<br class="">
<br class="">
I am currently attempting to extract the cluster values for each participant to get an overall mean for each vertex within the cluster to compare between groups, but this seems very inefficient.<br class="">
<br class="">
Cheers,<br class="">
Talitha<br class="">
<br class="">
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank" class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank" class="">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</blockquote>
</div>
</div>
</div>
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank" class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" target="_blank" class="">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</div>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank" class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank" class="">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</blockquote>
</div>
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank" class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" target="_blank" class="">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</div>
</div>
<br class="">
</div>
</div>
</div>
</div>
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank" class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank" class="">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</blockquote>
</div>
_______________________________________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis<br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
http://www.partners.org/complianceline . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
</div>
</div>
<br class="">
</div>
</body>
</html>