Thanks for the input! I now have a workable solution. First, I tried to create an output map to convert back to nifti. This fails because the sl_map output only contains nROI values rather than nFeatures, so ds.map2Nifti throws an error. I put together a very ugly hack to get around this:<br>
<br>from numpy import array, nan<br><br>feat_ids = []<br>for roi_x, roi_y, roi_z in ROI_coords: # Transform ROIs to feature IDs<br>    feat_ids.append(tds.mapper.getOutId((roi_z, roi_y, roi_x)))<br><br>sl = Searchlight(cv, radius=slr, center_ids=feat_ids) #Restrict to feature IDs..<br>
sl_map = sl(tds) # RUN<br>sl_new = array([nan])<br>sl_new = sl_new.repeat(tds.nfeatures)<br>sl_new = list(sl_new) # an empty list<br>toindex = dict(zip(feat_ids, sl_map))<br>for id, value in toindex.iteritems():<br>sl_new[id] = value # index in ROI IDs<br>
<br>#<br><br>So basically I create a list of NaNs, and index in the ROI feature IDs. There are probably more elegant ways of doing this, but I&#39;m still figuring out the basics of Python... Anyway, you end up with a nifti image of the ROIs.<br>
<br>This is probably of very limited use, except as a sanity check to ensure that your ROI coordinates get properly mapped to feature IDs and back. Instead, I ended up skipping the nifti, and instead running the SL analysis with a single feature ID at a time. This way I can take the single sl_map output as a measure of performance for that particular ROI:<br>
<br>for roi_l, roi_c in ROIs.iteritems(): # ROI loop<br>    roi_id = []<br>    roi_id.append(tds.mapper.getOutId(roi_c))<br><br>    sl = Searchlight(cv, radius=roi_r, center_ids=roi_id) # Now one coordinate at a time<br>    sl_map = sl(tds) # RUN<br>
<br># Save results<br>    resres = &#39;\t&#39; + str(sl_map[0])<br>    resfile.write(resres)<br><br>#<br><br>I don&#39;t particularly encourage anyone to use this code, but at least it shows loosely what to do, if anyone else is doing spherical ROIs. Suggestions for improvements / optimisations would be welcome.<br>
<br>Thanks again for the help!<br>