AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 06, 2009 11:49AM
Hello Bob,

thanks for your comments; see below.

bob cox wrote:

> When we have wanted to do "moving spotlight" computations
> across the whole brain volume, we have written special programs
> for these purposes, since the calculations take a long long
> time. Two such programs are 3dLocalstat and 3dLocalSVD -- the
> first computes various statistics in a neighborhood around each
> voxel, and the second computes the first principal component
> vector of the collection of time series vectors from each
> neighborhood. The idea of extracting the neighborhood values
> into many external files and processing them outside AFNI
> programs proper didn't even occur to me, since it would be very
> slow.

I agree, that would be very slow. I was not suggesting to extract neighbourhood values to external files but only to save the masks. And this suggestion was intentionally very naive/'stupid' to illustrate my need for sparse mask representations.

> If you are facile with C, you might consider adapting one of
> these programs to your needs. They have the code needed to
> extract values from neighborhoods, respecting a mask (if
> supplied). The primary difference between 3dLocalstat and
> 3dLocalSVD is that the first program processes each
> neighborhood one volume at a time, while the second processes
> each neighborhood as a collection of time series.

Thanks for pointing me to these programs, but my needs are slightly different. Besides circular masks, I also generate masks based on grey matter selection and some other critera. This implementation is more complicated (and time consuming) but works well in matlab. To be clear, I'm not looking for a replacement for ROI selection, only for an efficient (as in storage space needed) way to save these ROI selections to be used for the classifications, which I would like to make independent of the voxel selection. Hopefully this will allow for speeding up the classification by using a faster language (C), the GPU and/or grid computing *and* without relying on matlab for classifications (we have a limited number of licenses) as information mapping is embarrassingly parallel.

Nevertheless, thanks for your helpful comments. I will then start on some file format representation of sparse masks. An initial idea is the following (probably very naive, so suggestions are welcome):

- all values are stored as 4 byte integers; that should be enough assuming we don't have crazy big files.
- we have a hierarchy of "blocks", "ROI masks", and "voxel indices". Each block contains ROIs, and each ROI contains voxel indices.

Specific data organization:
- the file starts with number of ROIs and the maximum number of voxels over all ROIs. In that way we can easily allocate the necessary memory space.
- this is followed by the number of "blocks" N, followed by N numbers that represent the end position of each "block", followed by N "blocks". This allows for easy parallelizing the classification, as different programs can "jump" in the file to a certain block.
- the i-th "block" starts with the number of ROIs mask P(i), followed by P(i) numbers C(i,j) that represent the number of voxels in each ROI mask, followed by P(i) "ROI masks".
- the j-th "ROI mask" in the i-th block contains C(i,j) linear indices that refer to the voxels in the volume.

For 1e5 masks with 100 voxels each, this would result in files of around 4*100*1e5=40MB.

What do you think?

thanks again,
Nick
Subject Author Posted

Support for multiple sparse volume masks?

Nick October 06, 2009 08:37AM

Re: Support for multiple sparse volume masks?

bob cox October 06, 2009 10:33AM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 06, 2009 11:49AM

Re: Support for multiple sparse volume masks?

Judd October 06, 2009 04:00PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 07, 2009 07:33AM

Re: Support for multiple sparse volume masks?

Judd October 07, 2009 10:26AM

Re: Support for multiple sparse volume masks?

Daniel Glen October 07, 2009 12:04PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 07, 2009 01:25PM

Re: Support for multiple sparse volume masks?

bob cox October 07, 2009 03:12PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 07, 2009 03:49PM

Re: Support for multiple sparse volume masks?

Nick October 07, 2009 10:03PM

Re: Support for multiple sparse volume masks?

Judd October 08, 2009 11:58AM

Re: Support for multiple sparse volume masks?

Judd October 08, 2009 12:06PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 08, 2009 01:07PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 08, 2009 01:06PM

Re: Support for multiple sparse volume masks?

Judd October 08, 2009 01:44PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 08, 2009 03:42PM

Re: Support for multiple sparse volume masks?

Judd October 08, 2009 04:39PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 09, 2009 12:34PM

Re: Support for multiple sparse volume masks?

bob cox October 06, 2009 04:02PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 07, 2009 07:47AM

Re: Support for multiple sparse volume masks?

Judd October 06, 2009 01:25PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 06, 2009 01:49PM

Re: Support for multiple sparse volume masks?

Rasmus Birn October 06, 2009 04:13PM

Re: Support for multiple sparse volume masks?

Nick Oosterhof October 07, 2009 07:37AM