Print

Print


>  In the help of spm_slice_vol , it says "spm_slice_vol returns a section
> through a memory mapped image volume on disk."
>  Can someone tell me what " a memory mapped image volume " exactly means ?

Basically, memory mapping allows data in a file to be treated as if it is an 
array in the computer's memory.  See (e.g.) the following for more 
information:
http://www.opengroup.org/onlinepubs/009695399/functions/mmap.html
http://www.die.net/doc/linux/man/man2/mmap.2.html

A long time ago (in SPM96 and earlier if I remember correctly), the spm_vol 
routine used to memory map the images and return a non-human-readable handle 
to the data.  The routines spm_slice_vol and spm_sample_vol used to then be 
able to read the values straight from memory.

This had problems for large analyses because memory mapping an image added it 
to the memory used by Matlab. Because of the 2 or 4Gbyte limit on older 
computers (32-bit machines), this meant that all the data could not be memory 
mapped by spm_vol.  A new strategy was used, whereby spm_vol created a 
description of the image (made possible because data-structures were 
introduced into Matlab), which could then be used by the routines that 
sampled the data.  The memory mapping is now done within spm_slice_vol and 
spm_sample_vol, and then the images are un-mapped (in the same routines) once 
the data has been sampled.  The documentation has just not been changed since 
the early days.

Best regards,
-John