help > Session-specific structurals in preprocessing
Feb 1, 2017  10:02 AM | Johann Philipp Zöllner - Goethe University Frankfurt
Session-specific structurals in preprocessing
Dear CONN-community,

I know this topic has already been discussed several times, but I could not yet find a solution for my problem in the relevant threads.

I want to use CONN to preprocess a set of structural and functional images. I have several sessions per subject, with the absolute number ranging from 2 to 6 per subject. All structural images are session-specific.

While trying to load the structurals into CONN, I get problems with BATCH.Setup.structurals ("cell contents reference from a non cell-array object").

I added my small script (partly anonymized with **):


base_dir = '/data/projects/***';
dicom_path = fullfile(base_dir,'prepro');
rest_path = fullfile(base_dir,'resting_state_analysis');
results_path = fullfile(rest_path,'calculations');
subj = {'**','**'};
sess = {'1','2','3','4','5','6'};
scripts_path = fullfile(rest_path,'scripts');
rois_path = fullfile(rest_path,'conn_roi_files'); %contains the ROIs of each subject as .tal-Files


%%
BATCH.filename = fullfile(results_path,'***.mat');
BATCH.Setup.isnew = 1; 
BATCH.Setup.done = 1; 
BATCH.Setup.overwrite = 1;
BATCH.Setup.nsubjects = 1;
BATCH.Setup.RT = 2;
BATCH.Setup.acquisitiontype = 1; % continuous acquisition


skipped_sess = [];
 
for i=1%:numel(subj)

subj_name = char(subj(i)); % subject name


for ii=1:numel(sess)


% Find Resting-state-session
f = spm_select('FPList', fullfile(dicom_path,subj_name,sess{ii},'epi/resting_state'), '^f4s_.*\.nii$');
s = spm_select('FPList', fullfile(dicom_path,subj_name,sess{ii},'t1_nifti'), '^s4s_.*\.nii$');


if isempty(f)==1 || isempty(s)==1 % skip empty sessions
skipped_sess{numel(skipped_sess)+1} = strcat(subj_name,'_',sess{ii}); % lists the skipped sessions
continue
end


BATCH.Setup.functionals{i}{ii} = f;
BATCH.Setup.structurals{i}{ii} = s;


end


BATCH.Setup.preprocessing.steps = {'functional_removescans','functional_realign','functional_center',...
'structural_center','functional_coregister','structural_segment&normalize',...
'functional_smooth'}
 
BATCH.Setup.preprocessing.voxelsize = 2;
BATCH.Setup.preprocessing.fwhm = 8;
BATCH.Setup.preprocessing.coregtomean = 1;
BATCH.Setup.preprocessing.removescans = 3;
BATCH.Setup.preprocessing.applytofunctional = 1;


end
conn_batch(BATCH);

I wonder whether my problems stem from using spm_select. I understand that CONN uses a char array to range over all functionals in a session but for structurals, a char array ranges over all sessions?

Thanks a lot in advance,
Johann P. Zöllner

Threaded View

TitleAuthorDate
Session-specific structurals in preprocessing
Johann Philipp Zöllner Feb 1, 2017
Alfonso Nieto-Castanon Feb 7, 2017