[pymvpa] Using searchlight for quick spherical ROIs?
Yaroslav Halchenko
debian at onerussian.com
Sun Mar 15 16:07:45 UTC 2009
sorry for just a brief reply...
> the dataset with a new mask for each ROI. However, I wonder if there is
> a quicker option, using the Searchlight and the "center id" parameter?
iirc... not
> The idea would be to start with a list of peak voxel coordinates for
> each ROI from the nifti image, map these to feature IDs somehow, and
> pass the list of ROI IDs to the Searchlight. The result would then be a
> (fast!) searchlight analysis, that runs a spherical classifier centered
> on each ROI in turn. The resulting classification map should only
> contain one voxel per ROI.
since I don't know how you set things up, if you assume that
ds is full bold NiftiDataset you want to extract roi's from
roi_map -- just silly dataset where you loaded your rois with the same
mask as you had in ds
then just use smth like
for roi_coord in [(0,1,2), (0,3,1)]:
# to do voxel -> feature_id mapping
roi_featureid = ds.mapper.getOutId(roi_coord)
# just remember that NiftiImage has reverted coordinates
# so you need to use (z,y,x) here
# figure out the 'color' of ROI
roi_id = roi_map.samples[roi_featureid]
# extract all the features from that ROI
ds_roi = ds.selectFeatures(N.where(roi_map == roi_id)[0])
# assess what you like to assess on that ds_roi
it might not work... just coding right in the email... but it might give
you hints...
for mapping back and forth of coordinates between voxels/features use
ds.mapper.getOutId / getInId
hope this helps
> Has anyone attempted something similar? I can't quite figure out how to
> map the ROI coordinates in the original nifti to the feature ID that
> the classifier runs on.
> Any help would be greatly appreciated.
> Johan
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
--
Yaroslav Halchenko
Research Assistant, Psychology Department, Rutgers-Newark
Student Ph.D. @ CS Dept. NJIT
Office: (973) 353-1412 | FWD: 82823 | Fax: (973) 353-1171
101 Warren Str, Smith Hall, Rm 4-105, Newark NJ 07102
WWW: http://www.linkedin.com/in/yarik
More information about the Pkg-ExpPsy-PyMVPA
mailing list