help > batch & multiple between conditions contrasts
Showing 1-11 of 11 posts
Dec 2, 2014 06:12 PM | h i
batch & multiple between conditions contrasts
Hello,
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
Dec 3, 2014 05:12 AM | Alfonso Nieto-Castanon - Boston University
RE: batch & multiple between conditions contrasts
Hi h
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
Hope this helps
Alfonso
Originally posted by h i:
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
clear BATCH;
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
...
conn_batch(BATCH);
conn_batch(BATCH);
Hope this helps
Alfonso
Originally posted by h i:
Hello,
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
Dec 3, 2014 06:12 PM | h i
RE: batch & multiple between conditions contrasts
Alfonso,
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
Hope this helps
Alfonso
Originally posted by h i:
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
clear BATCH;
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
...
conn_batch(BATCH);
conn_batch(BATCH);
Hope this helps
Alfonso
Originally posted by h i:
Hello,
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
Dec 5, 2014 02:12 AM | Alfonso Nieto-Castanon - Boston University
RE: batch & multiple between conditions contrasts
Hi h.
Sorry about this, my example was incorrect and you should instead use curly brackets { } instead of parenthesis (since the latter replicates all of the field-names of the batch structure and creates some unnecessary complications; conn_batch accepts both forms of multiple batch structures but in this example -since you are including a lot of additional functionality and not just the second-level analyses in your first batch structure- it makes more sense to use curly brackets instead so that the second batch structure is created from scratch instead of keeping the same field-names as the first batch structure), so something like:
clear BATCH;
...
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{1}.Results.between_subjects.contrast=[1];
BATCH{1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH{2}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{2}.Results.between_subjects.contrast=[1];
BATCH{2}.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{2}.Results.between_conditions.contrast=[1 -1 0];
...
Should work just fine (please let me know otherwise)
Best
Alfonso
Originally posted by h i:
Sorry about this, my example was incorrect and you should instead use curly brackets { } instead of parenthesis (since the latter replicates all of the field-names of the batch structure and creates some unnecessary complications; conn_batch accepts both forms of multiple batch structures but in this example -since you are including a lot of additional functionality and not just the second-level analyses in your first batch structure- it makes more sense to use curly brackets instead so that the second batch structure is created from scratch instead of keeping the same field-names as the first batch structure), so something like:
clear BATCH;
...
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{1}.Results.between_subjects.contrast=[1];
BATCH{1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH{2}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{2}.Results.between_subjects.contrast=[1];
BATCH{2}.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{2}.Results.between_conditions.contrast=[1 -1 0];
...
Should work just fine (please let me know otherwise)
Best
Alfonso
Originally posted by h i:
Alfonso,
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
Hope this helps
Alfonso
Originally posted by h i:
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
clear BATCH;
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
...
conn_batch(BATCH);
conn_batch(BATCH);
Hope this helps
Alfonso
Originally posted by h i:
Hello,
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
Dec 5, 2014 01:12 PM | h i
RE: batch & multiple between conditions contrasts
Alfonso.
Thanks you for reply. I have some more follow-up questions.
I successfully ran a batch script for the entire process, setup, preprocess, analysis, results. In my the script, I called conn_batch twice. I assigned everything to a BATCH (all caps) variable from setup through analysis. Then, I ran the command conn_batch(BATCH). I set up another batch (lower case) variable and then ran the 2nd level analysis with the steps you outlined in your first replay as such for the 3 contrasts with parenthesis and not the curly brackets. In the second batch variable, in included batch(ncondition).Results.filename line specifying the Batch.filename created in the setup. So, that was my work around before I read you latest reply. The output provided the 3 different contrasts, CondA vs CondB, CondA vs CondC, CondB vs CondC.
I tried running the entire script with the curly brackets you suggested in your most recent reply. I received an error message.
Cell contents assignment to a non-cell array object.
Error in batch_conn (line 255)
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
but then I realized you had a clear BATCH line before setting the BATCH{} variables. Is this the step needed to run multiple contrasts? It appears similar to my workaround where I just created a 2nd variable to assign values for my 3 contrasts and calling conn_batch a second time in my script. If so, I would also need to provide the *.mat filename (BATCH{1}.Results.filename ='name_file.mat') containing all of the preproc/setup/analysis/ information, no?
...
A separate question about the batch process is when I don't specify a contrast at all. The manual states it will run a 2nd-level analysis for each condition. However, my output only gives one 2nd-level result for one condition. It runs the analysis 3 times, but overwrites the results file. Should I just exclude the overwrite command below? Would that provide a results output folder for each condition if I excluded that line?
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.done=1;
BATCH.Results.overwrite='Yes'; %Excluded This line????
BATCH.Results.foldername =conn_results_folder;
Thanks again for all of your help.
h.
Originally posted by Alfonso Nieto-Castanon:
Thanks you for reply. I have some more follow-up questions.
I successfully ran a batch script for the entire process, setup, preprocess, analysis, results. In my the script, I called conn_batch twice. I assigned everything to a BATCH (all caps) variable from setup through analysis. Then, I ran the command conn_batch(BATCH). I set up another batch (lower case) variable and then ran the 2nd level analysis with the steps you outlined in your first replay as such for the 3 contrasts with parenthesis and not the curly brackets. In the second batch variable, in included batch(ncondition).Results.filename line specifying the Batch.filename created in the setup. So, that was my work around before I read you latest reply. The output provided the 3 different contrasts, CondA vs CondB, CondA vs CondC, CondB vs CondC.
I tried running the entire script with the curly brackets you suggested in your most recent reply. I received an error message.
Cell contents assignment to a non-cell array object.
Error in batch_conn (line 255)
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
but then I realized you had a clear BATCH line before setting the BATCH{} variables. Is this the step needed to run multiple contrasts? It appears similar to my workaround where I just created a 2nd variable to assign values for my 3 contrasts and calling conn_batch a second time in my script. If so, I would also need to provide the *.mat filename (BATCH{1}.Results.filename ='name_file.mat') containing all of the preproc/setup/analysis/ information, no?
...
A separate question about the batch process is when I don't specify a contrast at all. The manual states it will run a 2nd-level analysis for each condition. However, my output only gives one 2nd-level result for one condition. It runs the analysis 3 times, but overwrites the results file. Should I just exclude the overwrite command below? Would that provide a results output folder for each condition if I excluded that line?
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.done=1;
BATCH.Results.overwrite='Yes'; %Excluded This line????
BATCH.Results.foldername =conn_results_folder;
Thanks again for all of your help.
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h.
Sorry about this, my example was incorrect and you should instead use curly brackets { } instead of parenthesis (since the latter replicates all of the field-names of the batch structure and creates some unnecessary complications; conn_batch accepts both forms of multiple batch structures but in this example -since you are including a lot of additional functionality and not just the second-level analyses in your first batch structure- it makes more sense to use curly brackets instead so that the second batch structure is created from scratch instead of keeping the same field-names as the first batch structure), so something like:
clear BATCH;
...
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{1}.Results.between_subjects.contrast=[1];
BATCH{1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH{2}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{2}.Results.between_subjects.contrast=[1];
BATCH{2}.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{2}.Results.between_conditions.contrast=[1 -1 0];
...
Should work just fine (please let me know otherwise)
Best
Alfonso
Originally posted by h i:
Sorry about this, my example was incorrect and you should instead use curly brackets { } instead of parenthesis (since the latter replicates all of the field-names of the batch structure and creates some unnecessary complications; conn_batch accepts both forms of multiple batch structures but in this example -since you are including a lot of additional functionality and not just the second-level analyses in your first batch structure- it makes more sense to use curly brackets instead so that the second batch structure is created from scratch instead of keeping the same field-names as the first batch structure), so something like:
clear BATCH;
...
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{1}.Results.between_subjects.contrast=[1];
BATCH{1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH{2}.Results.between_subjects.effect_names={'AllSubjects'};
BATCH{2}.Results.between_subjects.contrast=[1];
BATCH{2}.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH{2}.Results.between_conditions.contrast=[1 -1 0];
...
Should work just fine (please let me know otherwise)
Best
Alfonso
Originally posted by h i:
Alfonso,
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Thanks for your suggestions.
If I'm running an entire batch procedure in one script, (setup, preprocess, analysis, results), would I have to designate the BATCH file in 3 parts as below?
I ran everything as such:
BATCH.Setup=
.
.
BATCH.Preprocess
.
.
.
But then I created the 3 part setup for the Results
BATCH(1).Results...
.
.
.
BATCH(2).Results...
.
.
.
BATCH(3).Results.
I ran the batch procedure and it successfully excuted my first contrast Cond_A vs Cond_B, but when it tried to execute the 2nd contrast, Cond_A vs Cond_C:
I received an error message stating:
Error using dir
Function is not defined for 'double' inputs.
I think the problem is the 2nd and 3rd elements of the BATCH structure array. It contains the Results field information for the remaining 2 elements, but no *.mat filename, Setup, Preprocss, or Analysis information in the respective fields. Should I just include two additional lines in the batch script:
BATCH(2).Results.filename="name_of_conn_mat_file.mat";
BATCH(3).Results.filename="name_of_conn_mat_file.mat";
Would this solve the problem? Or do I need to include additional code?
Thanks again,
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
Hope this helps
Alfonso
Originally posted by h i:
Yes, you can enter an array of BATCH processes simply by having the variable 'BATCH' defined as a structure array. For example:
clear BATCH;
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
BATCH(1).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(1).Results.between_subjects.contrast=[1];
BATCH(1).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(1).Results.between_conditions.contrast=[1 0 -1];
...
BATCH(2).Results.between_subjects.effect_names={'AllSubjects'};
BATCH(2).Results.between_subjects.contrast=[1];
BATCH(2).Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
BATCH(2).Results.between_conditions.contrast=[1 -1 0];
...
conn_batch(BATCH);
conn_batch(BATCH);
Hope this helps
Alfonso
Originally posted by h i:
Hello,
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
I have question regarding multiple between conditions contrasts using a batch script, is this possible?
We have 3 conditions, A, B, and C.
Here is an example setup:
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.between_conditions.effect_names={'Cond_A','Cond_B','Cond_C'};
For the contrast, Cond_A > Cond_C, I choose the following:
BATCH.Results.between_conditions.contrast=[1,0,-1];
This is correct, no?
If so, is there a way to set up the BATCH.Results.between_conditions.contrast file where 3 contrasts are provided as input:
Cond_A vs Cond_C [1 0 -1]
Cond_A vs Cond_B [1 -1 0]
Cond_B vs Cond_C [0 1 -1]
And the output folder contains 3 subfolders, one for subfolder for each contrast?
Essentially, can we setup the batch to run similar to SPM's contrast manager where you can enter several contrasts as opposed to just one described in the conn toolbox manual?
Thank you,
h.
Dec 10, 2014 03:12 AM | Alfonso Nieto-Castanon - Boston University
RE: batch & multiple between conditions contrasts
Hi h.
Some thoughts on your questions below
Best
Alfonso
Originally posted by h i:
Creating a cell-array of batch commands is exactly equivalent to just creating different batch variables and running sequentially conn_batch on each of them. The "clear BATCH" line simply makes sure that there is not "carry-over" information from previously created BATCH variables. If your batch script is a script instead of a function, then all of the variables created there are available in Matlab workspace, as opposed to a function-specific workspace, and they will still exist there when you re-run your batch script. For example, the "Cell contents assignment to a non-cell array object" error that you describe arises exactly from this situation, where you had previously defined BATCH as a structure-array (in your previous script), and then you tried to address that same BATCH variable as a cell-array instead. Hope this helps clarify
...
A separate question about the batch process is when I don't specify a contrast at all. The manual states it will run a 2nd-level analysis for each condition. However, my output only gives one 2nd-level result for one condition. It runs the analysis 3 times, but overwrites the results file. Should I just exclude the overwrite command below? Would that provide a results output folder for each condition if I excluded that line?
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.done=1;
BATCH.Results.overwrite='Yes'; %Excluded This line????
BATCH.Results.foldername =conn_results_folder;
Thanks again for all of your help.
I would simply exclude the line:
BATCH.Results.foldername = ...
so CONN will automatically create a different folder for each contrast. Alternatively you may define explicitly your output folders there (but you need to make sure you are defining a different folder for each of your three contrasts/analyses)
Hope this helps
Alfonso
Some thoughts on your questions below
Best
Alfonso
Originally posted by h i:
Alfonso.
Thanks you for reply. I have some more follow-up questions.
I successfully ran a batch script for the entire process, setup, preprocess, analysis, results. In my the script, I called conn_batch twice. I assigned everything to a BATCH (all caps) variable from setup through analysis. Then, I ran the command conn_batch(BATCH). I set up another batch (lower case) variable and then ran the 2nd level analysis with the steps you outlined in your first replay as such for the 3 contrasts with parenthesis and not the curly brackets. In the second batch variable, in included batch(ncondition).Results.filename line specifying the Batch.filename created in the setup. So, that was my work around before I read you latest reply. The output provided the 3 different contrasts, CondA vs CondB, CondA vs CondC, CondB vs CondC.
I tried running the entire script with the curly brackets you suggested in your most recent reply. I received an error message.
Cell contents assignment to a non-cell array object.
Error in batch_conn (line 255)
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
but then I realized you had a clear BATCH line before setting the BATCH{} variables. Is this the step needed to run multiple contrasts? It appears similar to my workaround where I just created a 2nd variable to assign values for my 3 contrasts and calling conn_batch a second time in my script.If so, I would also need to provide the *.mat filename (BATCH{1}.Results.filename ='name_file.mat') containing all of the preproc/setup/analysis/ information, no?
Thanks you for reply. I have some more follow-up questions.
I successfully ran a batch script for the entire process, setup, preprocess, analysis, results. In my the script, I called conn_batch twice. I assigned everything to a BATCH (all caps) variable from setup through analysis. Then, I ran the command conn_batch(BATCH). I set up another batch (lower case) variable and then ran the 2nd level analysis with the steps you outlined in your first replay as such for the 3 contrasts with parenthesis and not the curly brackets. In the second batch variable, in included batch(ncondition).Results.filename line specifying the Batch.filename created in the setup. So, that was my work around before I read you latest reply. The output provided the 3 different contrasts, CondA vs CondB, CondA vs CondC, CondB vs CondC.
I tried running the entire script with the curly brackets you suggested in your most recent reply. I received an error message.
Cell contents assignment to a non-cell array object.
Error in batch_conn (line 255)
BATCH{1}.Results.between_subjects.effect_names={'AllSubjects'};
but then I realized you had a clear BATCH line before setting the BATCH{} variables. Is this the step needed to run multiple contrasts? It appears similar to my workaround where I just created a 2nd variable to assign values for my 3 contrasts and calling conn_batch a second time in my script.If so, I would also need to provide the *.mat filename (BATCH{1}.Results.filename ='name_file.mat') containing all of the preproc/setup/analysis/ information, no?
Creating a cell-array of batch commands is exactly equivalent to just creating different batch variables and running sequentially conn_batch on each of them. The "clear BATCH" line simply makes sure that there is not "carry-over" information from previously created BATCH variables. If your batch script is a script instead of a function, then all of the variables created there are available in Matlab workspace, as opposed to a function-specific workspace, and they will still exist there when you re-run your batch script. For example, the "Cell contents assignment to a non-cell array object" error that you describe arises exactly from this situation, where you had previously defined BATCH as a structure-array (in your previous script), and then you tried to address that same BATCH variable as a cell-array instead. Hope this helps clarify
...
A separate question about the batch process is when I don't specify a contrast at all. The manual states it will run a 2nd-level analysis for each condition. However, my output only gives one 2nd-level result for one condition. It runs the analysis 3 times, but overwrites the results file. Should I just exclude the overwrite command below? Would that provide a results output folder for each condition if I excluded that line?
BATCH.Results.between_subjects.effect_names={'AllSubjects'};
BATCH.Results.between_subjects.contrast=[1];
BATCH.Results.done=1;
BATCH.Results.overwrite='Yes'; %Excluded This line????
BATCH.Results.foldername =conn_results_folder;
Thanks again for all of your help.
I would simply exclude the line:
BATCH.Results.foldername = ...
so CONN will automatically create a different folder for each contrast. Alternatively you may define explicitly your output folders there (but you need to make sure you are defining a different folder for each of your three contrasts/analyses)
Hope this helps
Alfonso
Dec 15, 2014 02:12 PM | h i
RE: batch & multiple between conditions contrasts
Alfonso,
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Dec 16, 2014 03:12 AM | Alfonso Nieto-Castanon - Boston University
RE: batch & multiple between conditions contrasts
Hi h.
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
Alfonso,
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Dec 16, 2014 09:12 PM | h i
RE: batch & multiple between conditions contrasts
Alfonso:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h.
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
Alfonso,
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Dec 17, 2014 12:12 AM | Alfonso Nieto-Castanon - Boston University
RE: batch & multiple between conditions contrasts
Hi h.
Yes, that is exactly correct (and I will see if we can change this behavior in the next release so that this step does not overwrite any already-existing mask files and only fills-in the missing ones instead)
Best
Alfonso
Originally posted by h i:
Yes, that is exactly correct (and I will see if we can change this behavior in the next release so that this step does not overwrite any already-existing mask files and only fills-in the missing ones instead)
Best
Alfonso
Originally posted by h i:
Alfonso:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h.
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
Alfonso,
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Jan 5, 2015 03:01 PM | h i
RE: batch & multiple between conditions contrasts
Alfonso,
Thanks again for all of your help!
Best wishes!
h.
Originally posted by Alfonso Nieto-Castanon:
Thanks again for all of your help!
Best wishes!
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h.
Yes, that is exactly correct (and I will see if we can change this behavior in the next release so that this step does not overwrite any already-existing mask files and only fills-in the missing ones instead)
Best
Alfonso
Originally posted by h i:
Yes, that is exactly correct (and I will see if we can change this behavior in the next release so that this step does not overwrite any already-existing mask files and only fills-in the missing ones instead)
Best
Alfonso
Originally posted by h i:
Alfonso:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
It is working now.
I did not assign a value to Batch.Setup.masks.Grey.files{nsub}. I just left that empty and only assigned values to the White and CSF file variables. Reading the manual again, it states "If any of these fields are left unset the conn toolbox will perform segmentation on the anatomical volumes (for each subject) in order to define the missing masks." By assigning values to all 3, Grey, White, and CSF files, it now correctly reads in my alternative CSF and White matter masks. If I don't assign ALL 3 fields, then it seems conn_batch assigns the c1, c2, and c3 files created from segmentation as the grey matter, white matter, and csf masks. Is this correct?
h.
Originally posted by Alfonso Nieto-Castanon:
Hi h.
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
The former approach (using Batch.Setup.masks.Grey.files, Batch.Setup.masks.White.files, and Batch.Setup.masks.CSF.files) should have worked just fine, could you please send me the batch file that you used and/or any error message that you got when trying to run it to see if I can figure out what might have happened?
Best
Alfonso
Originally posted by h i:
Alfonso,
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.
Thank you for your response.
That helps a great deal.
I have another question regarding ROI masks.
I've had some trouble running the batch script and using different white matter and csf masks as ROI's.
I can successfully use different white matter and csf masks for each subject. However, it does not work when I included them in a batch script.
Initially, I tried using the Batch.Setup.masks.White.files{nsub} and Batch.Setu.maksCSF.files{nsub} for assigning the alternative white matter and csf masks. However, they were ignored, and the resulting roi's used for denoising were the segmented grey matter and white matter files for each subject (c1 and c2 files, respectively).
I then tried the BATCH.Setup.rois.names{nrois} and BATCH.Setup.rois.names{nrois}{nsub} options for the csf and white matter masks.
But I get the following error messages for my batch script:
Step 5/6: Importing ROI data
100.0% (Subject 15 Session 2)
Bad cell reference operation.
Error in conn_process (line 841)
if length(dims)>=n1&&~isempty(dims{n1}),
CONN_x.Preproc.confounds.dimensions{end+1}=[min(dims{n1}(1),CONN_x.Preproc.variables.dimensions{idx}(1)),CONN_x.Preproc.variables.dimensions{idx}(1)];
else
Error in conn_process (line 12)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn_batch (line 432)
conn_process Setup;
Error in batch_new_conn (line 314)
conn_batch(BATCH)
What exactly am I doing wrong here?
Your input would greatly be appreciated.
Thanks.
h.