help > issues with overwriting and art_thresholds
Nov 8, 2017  12:11 PM
Lorenzo Pasquini
Klinikum rechts der Isar Technische Universitaet Muenchen
issues with overwriting and art_thresholds
Dear Conn users 

I have three questions regarding the batch.prepocessing codes and I am seeking for help:

1. I would like to set the default options for batch.New.art_thresholds;
I found both
batch.New.art_thresholds=[3,1];
and
batch.New.art_thresholds=[5,0.6];
as options from previous posts. Which one is the right one?

2. I am running the script on matlab -nodisplay
I set
batch.Setup.overwrite='Yes';
batch.Denoising.overwrite='Yes';

However, I dialog box appears asking me whether I want to overwrite the data, and prevents me of using the script in the nodisplay modus.

3. I get following warning:
"This option may become obsolete in future releases. Please transition your BATCH.New scripts to use BATCH.Setup.preprocessing instead"
How important is to replace it? For some reason, my script is not working after I replace those lines. Is something wrong with the script (see below)?

Any help on those matters would be greatly appreciated

Kind regards

Lorenzo

%%%%%%%%%%%%%%%
clear all; clc;

%% FIND functional/structural files
cwd=pwd;
FUNCTIONAL_FILE=cellstr(conn_dir('/data/mridata/lpasquini/4Soichi/S2/rsfmri/4D_raw_rsfmri_S2.nii')); %UI
STRUCTURAL_FILE=cellstr(conn_dir('/data/mridata/lpasquini/4Soichi/S2/struct/raw_sMRI_S2.nii')); %UI
nsubjects=1;
if rem(length(FUNCTIONAL_FILE),nsubjects),error('mismatch number of functionalfiles');
end
if rem(length(STRUCTURAL_FILE),nsubjects),error('mismatch number of anatomical files');
end
nsessions=length(FUNCTIONAL_FILE)/nsubjects;
FUNCTIONAL_FILE=reshape(FUNCTIONAL_FILE,[nsubjects,nsessions]);
STRUCTURAL_FILE={STRUCTURAL_FILE{1:nsubjects}};
disp([num2str(size(FUNCTIONAL_FILE,1)),' subjects']);
disp([num2str(size(FUNCTIONAL_FILE,2)),' sessions']);
TR=2; % Repetition time = 2 seconds
%% PREPARES connectivity analyses (using default values for all parameters, see help conn_batch to define non-default values)
clear batch;
set(0,'DefaultFigureVisible','off');
% This option may become obsolete in future releases. Please transition your BATCH.New scripts to use BATCH.Setup.preprocessing instead
%% CONN New experiment
%(realignment/coregistration/segmentation/normalization/smoothing)
batch.filename=fullfile(cwd,'S2conn_NYU.mat'); % UI, New conn_*.mat experiment name, saved in current directory
batch.New.FWHM=8; % UI, 8mm FWHM smoothing
batch.New.VOX=2; % UI, 2mm voxel size for analyses
batch.New.sliceorder=[2:2:36,1:2:35]; % UI
batch.New.steps='default_mni'; %UI, Specify spatial preprocessing steps to be performed
batch.New.art_thresholds=[3,1];
batch.New.functionals=repmat({{}},[nsubjects,1]); % Point to functional volumes for each subject/session
for nsub=1:nsubjects
for nses=1:nsessions
batch.New.functionals{nsub}{nses}{1}=FUNCTIONAL_FILE{nsub,nses};
end
end %note: each subject's data is defined by three sessions and one single(4d) file per session
batch.New.structurals=STRUCTURAL_FILE; % Point to anatomical volumes for each subject
%% CONN Setup % Default options (uses all ROIs in conn/rois/ directory); see conn_batch for additional options
batch.Setup.RT=TR; % TR (seconds)
nconditions=nsessions; % treats each session as a different condition (comment the following three lines and lines 84-86 below if you do not wish to analyze between-session differences)
batch.Setup.conditions.names=cellstr([repmat('Session',[nconditions,1]),num2str((1:nconditions)')]);
for ncond=1:nconditions
for nsub=1:nsubjects
for nses=1:nsessions
batch.Setup.conditions.onsets{ncond}{nsub}{nses}=[];
batch.Setup.conditions.durations{ncond}{nsub}{nses}=[];
end
end
end
for ncond=1:nconditions
for nsub=1:nsubjects
for nses=ncond
batch.Setup.conditions.onsets{ncond}{nsub}{nses}=0;
batch.Setup.conditions.durations{ncond}{nsub}{nses}=inf;
end
end
end
batch.Setup.outputfiles=[0,1,0];
batch.Setup.overwrite='Yes';
batch.Setup.done=1;
%% CONN Preprocessing
% Default options (uses White Matter+CSF+realignment+conditions as confound regressors); see conn_batch for additional options
batch.Denoising.filter=[0.01, 0.1]; % UI, frequency filter (bandpassvalues, in Hz)
batch.Denoising.done=1;
batch.Denoising.overwrite='Yes';
%% RUNS analyses
conn_batch(batch);
reply reply with quote
Threaded View
TitleAuthorDate
issues with overwriting and art_thresholdsLorenzo PasquiniNov 8, 2017