help > Error loading functionals using batch but not GUI
Showing 1-2 of 2 posts
Jul 19, 2019 09:07 PM | emdoyle
Error loading functionals using batch but not GUI
Hi,
I'm trying to make a match script for loading fMRI files into Conn toolbox. When I use the GUI to import the files it seems to work, but when I try to import via my script, the script runs without error, but I get the error message below when I try to view the fMRI data in the conn gui (which I have already open while running my script). The structural data loads ok. I've been trying to troubleshoot this error for a while, but I'm a bit stuck and not super familiar with matlab/spm specifically, so I decided to post on here to see if anyone had any ideas. I also included the script below.
Any help with this would be greatly appreciated.
Thank you!
~Em
Script:
len=length(sublist)
clear Batch
%kept giving errors for this part so made project manually
BATCH.Setup.nsubjects=2 %number of subjects
for i=1:len;
sub=sublist(i)
%structural data seems to work
T1path=strcat('path',sub,'/T1_data_office')
%omitted some code for finding name of file
T1file='\<20\d\d...._......T1MPRAGEsagisos........\.nii\.gz'
BATCH.Setup.structurals{i}=fullfile(T1path,T1file)
%for each run of fMRI data (3 per subject)
for r=1:3;
rr=string(r)
fMRIpath=strcat('path',sub,'/fMRI_data_office/task2_run',rr)
%omitted code for finding name of file
fMRIfile='\<20......_......ep2dbold2x2x2task2run.........\.nii\.gz'
BATCH.Setup.functionals{i}{r}=fullfile(fMRIpath,fMRIfile)
BATCH.Setup.voxelresolution=1;
end
end
conn_batch(BATCH)
ERROR DESCRIPTION:
Undefined function 'isnan' for input arguments of type 'string'.
Error in conn_menu (line 676)
title(isnan(title))=0;
Error in conn (line 2007)
conn_menu('updateimage',CONN_h.menus.m_setup_00{5},cfile{3});
Error in conn (line 1458)
[varargout{1:nargout}]=conn('gui_setup',varargin{3:end});
Error in conn_menumanager (line 120)
feval(CONN_MM.MENU{n0}.callback{n1}{1},CONN_MM.MENU{n0}.callback{n1}{2:end});
CONN18.b
SPM12 + DEM FieldMap MEEGtools
Matlab v.2019a
project: CONN18.b
storage: 1957.9Gb available
spm @ /Applications/spm12
conn @ /Users/username/Documents/MATLAB/conn
Please visit http://www.nitrc.org/forum/forum.php?for... if the page is not automatically loaded
I'm trying to make a match script for loading fMRI files into Conn toolbox. When I use the GUI to import the files it seems to work, but when I try to import via my script, the script runs without error, but I get the error message below when I try to view the fMRI data in the conn gui (which I have already open while running my script). The structural data loads ok. I've been trying to troubleshoot this error for a while, but I'm a bit stuck and not super familiar with matlab/spm specifically, so I decided to post on here to see if anyone had any ideas. I also included the script below.
Any help with this would be greatly appreciated.
Thank you!
~Em
Script:
len=length(sublist)
clear Batch
%kept giving errors for this part so made project manually
BATCH.Setup.nsubjects=2 %number of subjects
for i=1:len;
sub=sublist(i)
%structural data seems to work
T1path=strcat('path',sub,'/T1_data_office')
%omitted some code for finding name of file
T1file='\<20\d\d...._......T1MPRAGEsagisos........\.nii\.gz'
BATCH.Setup.structurals{i}=fullfile(T1path,T1file)
%for each run of fMRI data (3 per subject)
for r=1:3;
rr=string(r)
fMRIpath=strcat('path',sub,'/fMRI_data_office/task2_run',rr)
%omitted code for finding name of file
fMRIfile='\<20......_......ep2dbold2x2x2task2run.........\.nii\.gz'
BATCH.Setup.functionals{i}{r}=fullfile(fMRIpath,fMRIfile)
BATCH.Setup.voxelresolution=1;
end
end
conn_batch(BATCH)
ERROR DESCRIPTION:
Undefined function 'isnan' for input arguments of type 'string'.
Error in conn_menu (line 676)
title(isnan(title))=0;
Error in conn (line 2007)
conn_menu('updateimage',CONN_h.menus.m_setup_00{5},cfile{3});
Error in conn (line 1458)
[varargout{1:nargout}]=conn('gui_setup',varargin{3:end});
Error in conn_menumanager (line 120)
feval(CONN_MM.MENU{n0}.callback{n1}{1},CONN_MM.MENU{n0}.callback{n1}{2:end});
CONN18.b
SPM12 + DEM FieldMap MEEGtools
Matlab v.2019a
project: CONN18.b
storage: 1957.9Gb available
spm @ /Applications/spm12
conn @ /Users/username/Documents/MATLAB/conn
Please visit http://www.nitrc.org/forum/forum.php?for... if the page is not automatically loaded
Jul 20, 2019 11:07 AM | Alfonso Nieto-Castanon - Boston University
RE: Error loading functionals using batch but not GUI
Hi Em
Please try changing the lines that read
= fullfile(...)
to
= char(fullfile(...))
As far as I can tell the issue is likely a problem with using Matlab's newer (after 2016) string syntax as part of batch command filenames
Hope this helps
Alfonso
Originally posted by emdoyle:
Please try changing the lines that read
= fullfile(...)
to
= char(fullfile(...))
As far as I can tell the issue is likely a problem with using Matlab's newer (after 2016) string syntax as part of batch command filenames
Hope this helps
Alfonso
Originally posted by emdoyle:
Hi,
I'm trying to make a match script for loading fMRI files into Conn toolbox. When I use the GUI to import the files it seems to work, but when I try to import via my script, the script runs without error, but I get the error message below when I try to view the fMRI data in the conn gui (which I have already open while running my script). The structural data loads ok. I've been trying to troubleshoot this error for a while, but I'm a bit stuck and not super familiar with matlab/spm specifically, so I decided to post on here to see if anyone had any ideas. I also included the script below.
Any help with this would be greatly appreciated.
Thank you!
~Em
Script:
len=length(sublist)
clear Batch
%kept giving errors for this part so made project manually
BATCH.Setup.nsubjects=2 %number of subjects
for i=1:len;
sub=sublist(i)
%structural data seems to work
T1path=strcat('path',sub,'/T1_data_office')
%omitted some code for finding name of file
T1file='\<20\d\d...._......T1MPRAGEsagisos........\.nii\.gz'
BATCH.Setup.structurals{i}=fullfile(T1path,T1file)
%for each run of fMRI data (3 per subject)
for r=1:3;
rr=string(r)
fMRIpath=strcat('path',sub,'/fMRI_data_office/task2_run',rr)
%omitted code for finding name of file
fMRIfile='\<20......_......ep2dbold2x2x2task2run.........\.nii\.gz'
BATCH.Setup.functionals{i}{r}=fullfile(fMRIpath,fMRIfile)
BATCH.Setup.voxelresolution=1;
end
end
conn_batch(BATCH)
ERROR DESCRIPTION:
Undefined function 'isnan' for input arguments of type 'string'.
Error in conn_menu (line 676)
title(isnan(title))=0;
Error in conn (line 2007)
conn_menu('updateimage',CONN_h.menus.m_setup_00{5},cfile{3});
Error in conn (line 1458)
[varargout{1:nargout}]=conn('gui_setup',varargin{3:end});
Error in conn_menumanager (line 120)
feval(CONN_MM.MENU{n0}.callback{n1}{1},CONN_MM.MENU{n0}.callback{n1}{2:end});
CONN18.b
SPM12 + DEM FieldMap MEEGtools
Matlab v.2019a
project: CONN18.b
storage: 1957.9Gb available
spm @ /Applications/spm12
conn @ /Users/username/Documents/MATLAB/conn
Please visit http://www.nitrc.org/forum/forum.php?for... if the page is not automatically loaded
I'm trying to make a match script for loading fMRI files into Conn toolbox. When I use the GUI to import the files it seems to work, but when I try to import via my script, the script runs without error, but I get the error message below when I try to view the fMRI data in the conn gui (which I have already open while running my script). The structural data loads ok. I've been trying to troubleshoot this error for a while, but I'm a bit stuck and not super familiar with matlab/spm specifically, so I decided to post on here to see if anyone had any ideas. I also included the script below.
Any help with this would be greatly appreciated.
Thank you!
~Em
Script:
len=length(sublist)
clear Batch
%kept giving errors for this part so made project manually
BATCH.Setup.nsubjects=2 %number of subjects
for i=1:len;
sub=sublist(i)
%structural data seems to work
T1path=strcat('path',sub,'/T1_data_office')
%omitted some code for finding name of file
T1file='\<20\d\d...._......T1MPRAGEsagisos........\.nii\.gz'
BATCH.Setup.structurals{i}=fullfile(T1path,T1file)
%for each run of fMRI data (3 per subject)
for r=1:3;
rr=string(r)
fMRIpath=strcat('path',sub,'/fMRI_data_office/task2_run',rr)
%omitted code for finding name of file
fMRIfile='\<20......_......ep2dbold2x2x2task2run.........\.nii\.gz'
BATCH.Setup.functionals{i}{r}=fullfile(fMRIpath,fMRIfile)
BATCH.Setup.voxelresolution=1;
end
end
conn_batch(BATCH)
ERROR DESCRIPTION:
Undefined function 'isnan' for input arguments of type 'string'.
Error in conn_menu (line 676)
title(isnan(title))=0;
Error in conn (line 2007)
conn_menu('updateimage',CONN_h.menus.m_setup_00{5},cfile{3});
Error in conn (line 1458)
[varargout{1:nargout}]=conn('gui_setup',varargin{3:end});
Error in conn_menumanager (line 120)
feval(CONN_MM.MENU{n0}.callback{n1}{1},CONN_MM.MENU{n0}.callback{n1}{2:end});
CONN18.b
SPM12 + DEM FieldMap MEEGtools
Matlab v.2019a
project: CONN18.b
storage: 1957.9Gb available
spm @ /Applications/spm12
conn @ /Users/username/Documents/MATLAB/conn
Please visit http://www.nitrc.org/forum/forum.php?for... if the page is not automatically loaded
