<div dir="ltr">Hi All,<div><br></div><div>Thanks in advance for the help. </div><div><br></div><div>I am trying to create a monte carlo permutation distribution to test my group searchlight against, but am worried that I set it up wrong and am also not sure where to go from here. </div><div><br></div><div>Currently, I have 40 subjects with 15 permuted searchlights per subject as well as the actual searchlights which I want to test against the permuted distribution all saved as nifti files. I just created different permuted attribute files and did each permuted searchlight one by one across 3 computers in the lab to try to speed up the process, but now I'm not sure how to recombine everything and do the actual monte carlo distribution. </div><div><br></div><div>What I've found online in the PyMVPA manual has the permutator and estimator within the cross validation script so I'm worried I may need to redo everything which will take another month or longer to do on one computer in my lab.  </div><div><br></div><div>Long story short, is there a way to create a monte carlo distribution with searchlights that have already been created and what's the best way to do this?</div><div><br></div><div>Here is the code I used for one permuted searchlight, I'm also worried I didn't save all the information I needed, can someone let me know if that is the case?</div><div><br></div><div>Thank you,</div><div>Jessica </div><div><br></div><div><div>#source /opt/rh/python27/enable</div><div>from mvpa2.suite import *</div><div>import numpy as np</div><div>import scipy.stats as sp</div><div>import <a href="http://scipy.io">scipy.io</a></div><div>import nibabel</div><div>import random</div><div><br></div><div>subjects = [.....'20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','36','37','38','39','40','41','42','43']</div><div>path = '/Users/Desktop/SearchlightPermutation/'</div><div><br></div><div>for sub in subjects:<br></div><div><span style="white-space:pre">        </span>verbose(1,'processing subject: %s'%sub)</div><div><span style="white-space:pre">       </span>#load dataset</div><div><span style="white-space:pre"> </span>attr = SampleAttributes(os.path.join(path, 'Attributes11thIt.txt'))</div><div><span style="white-space:pre">   </span>fds = fmri_dataset(samples=os.path.join(path, 'Beta_allStim_sub%s.nii'%sub), targets = attr.targets, chunks=attr.chunks, mask = os.path.join(path, 'mask_anat.sub%s.nii'%sub))</div><div>    #zscore detrended data</div><div><span style="white-space:pre">     </span>zscore(fds, chunks_attr=None)</div><div>    #set up classifier</div><div><span style="white-space:pre">  </span>clf = LinearCSVMC()</div><div><span style="white-space:pre">   </span>cvte = CrossValidation(clf, NFoldPartitioner(), errorfx=lambda p, t: np.mean(p == t), enable_ca=['stats'])</div><div><span style="white-space:pre">    </span>sl = sphere_searchlight(cvte, radius=3, space='voxel_indices', postproc=mean_sample(), nproc=8)</div><div><span style="white-space:pre">       </span>res = sl(fds)</div><div>    #save searchlight</div><div><span style="white-space:pre">   </span>niftiresults = map2nifti(fds, res.samples).to_filename('searchlight_allcond_sub%s_it11.nii'%sub)</div></div></div>