[Nipy-devel] ROI analysis and others

Jonathan Taylor jonathan.taylor at stanford.edu
Mon Jun 26 22:15:12 CDT 2006


I should also mention that you can effectively have an ROI (or more than 
one ROI) using the Image class
with a "parcel" iterator where the labels indicate the ROI.

See test_labels1 in the neuroimaging/fmri/tests/test_fmri.py (copied below):


---------------------------------------------
def test_labels1(self):
        parcelmap = (self.rho.readall() * 100).astype(N.int32)

        self.img.grid.itertype = 'parcel'
        self.img.grid.parcelmap = parcelmap
        parcelmap.shape = N.product(parcelmap.shape)
        self.img.grid.parcelseq = N.unique(parcelmap)

        v = 0
        for t in self.img:
            v += t.shape[1]
        self.assertEquals(v, N.product(parcelmap.shape))

--------------------------------------------

By changing the "grid.parcelseq" value, you can loop over different 
subsets of the ROIs. The values returned by the iterator
(t in this case) are fMRI time series, but this works for 3d images too 
(or it should!).

-- Jonathan

Satrajit Ghosh wrote:

>Hello,
>
>I met up with Matthew at HBM and mentioned that over the next three months
>or so, I would be converting our ROI toolbox to the nipy. He and Jarrod
>mentioned that I should post something to that effect on this list.
>
>For those who are not familiar with it, the details are available in the
>foll. paper:
>
>http://dx.doi.org/10.1016/S1053-8119(03)00188-5
>
>Matthew also mentioned the Jonathon has already started doing some ROI
>coding. So pointers to those classes, etc., would probably be helpful too.
>
>Now, I have very little experience with Python, and any advice would be much
>helpful. For my part, I would probably setup the enthought edition on my
>laptop (running windows) to get the initial coding done. 
>
>Cheers,
>
>Satra
>
>--
>Satrajit Ghosh, PhD
>Speech Communication Group
>Research Laboratory of Electronics, MIT
>http://spouch.mit.edu/~satra
> 
>
>_______________________________________________
>Nipy-devel mailing list
>Nipy-devel at neuroimaging.scipy.org
>http://neuroimaging.scipy.org/mailman/listinfo/nipy-devel
>  
>

-- 
------------------------------------------------------------------------
I'm part of the Team in Training: please support our efforts for the
Leukemia and Lymphoma Society!

http://www.active.com/donate/tntsvmb/tntsvmbJTaylor

GO TEAM !!!

------------------------------------------------------------------------
Jonathan Taylor                           Tel:   650.723.9230
Dept. of Statistics                       Fax:   650.725.8977
Sequoia Hall, 137                         www-stat.stanford.edu/~jtaylo
390 Serra Mall
Stanford, CA 94305




More information about the Nipy-devel mailing list