help
help > RE: batch & multiple between conditions contrasts
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.
Threaded View
| Title | Author | Date |
|---|---|---|
| h i | Dec 2, 2014 | |
| h i | Dec 15, 2014 | |
| Alfonso Nieto-Castanon | Dec 16, 2014 | |
| h i | Dec 16, 2014 | |
| Alfonso Nieto-Castanon | Dec 17, 2014 | |
| h i | Jan 5, 2015 | |
| Alfonso Nieto-Castanon | Dec 3, 2014 | |
| h i | Dec 3, 2014 | |
| Alfonso Nieto-Castanon | Dec 5, 2014 | |
| h i | Dec 5, 2014 | |
| Alfonso Nieto-Castanon | Dec 10, 2014 | |
