Hello,
I had been unsuccessful in running the following command:
V=spm_vol('filename.nii');
X=spm_read_vols(V);
numvox=length(find(X==numlobules))
Initially, the error message states:
Error using spam_vol.subfunc (line 101)
File 'filename.ii' does not exist
Error in spm_vol>subfunc2 (line 69)
V = sunfunc1(P);
Error in spm_vol (line 54)
V = subfunc2(P);
This is odd, as my 'filename.nii' has most certainly been added to my path.
After running this command:
addpath(genpath('path/to/experiment_directory'))
After the addpath worked, I ran the same function and received the following error message:
Undefined function or variable 'numlobules'.
I did research online and found someone else who had the same issue as myself. The website suggested this:
name = importdata('list.txt');
% Pre-allocation
numvox = zeros(length (name), 28);
for i = 1: length (name)
atlas = [atlas_name {i}'_.nii'];
for k = 1: 28
V = spm_vol(altas)
X = spm_read_vols(V);
numvox (i, k)=length(find (x == numlobules));
end
The import data command did not work.
Below is the link, in case that would be helpful: http://translate.google.com/translate?hl=en&sl=fr&u=http://www.developpez.net/forums/d1508594/environnements-developpement/matlab/question-script-matlab/&prev=search
Below is the link to the original website from which I pulled the original command:
http://www.icn.ucl.ac.uk/motorcontrol/imaging/suit_faqs.htm
Any insight or guidance would be much appreciated,
Beatriz
|