open-discussion
open-discussion > RE: how to read .img data?
Dec 23, 2014 10:12 AM | Matthew Brett
RE: how to read .img data?
It depends what you want to do with the image.
If you want to read it into memory and play with it, then you might
consider SPM (MATLAB) (http://www.fil.ion.ucl.ac.uk/spm/):
>> V = spm_vol('my_image.img');
>> data = spm_read_vols(V);
I used to use SPM in MATLAB, but now I use Python (http://nipy.org/nibabel/):
>>> import nibabel as nib
>>> img = nib.load('my_image.img');
>>> data = img.get_data()
If you want to read it into memory and play with it, then you might
consider SPM (MATLAB) (http://www.fil.ion.ucl.ac.uk/spm/):
>> V = spm_vol('my_image.img');
>> data = spm_read_vols(V);
I used to use SPM in MATLAB, but now I use Python (http://nipy.org/nibabel/):
>>> import nibabel as nib
>>> img = nib.load('my_image.img');
>>> data = img.get_data()
Threaded View
| Title | Author | Date |
|---|---|---|
| ima diah | Dec 19, 2014 | |
| vijay kumar | Mar 10, 2015 | |
| Pravesh Parekh | Mar 10, 2015 | |
| bobey pham | Mar 9, 2015 | |
| R Bakker | Dec 19, 2014 | |
| ima diah | Dec 19, 2014 | |
| Jerome Maller | Mar 9, 2015 | |
| zeinab nazerian | Dec 23, 2014 | |
| Matthew Brett | Dec 23, 2014 | |
