Home Forums General Help Scripting

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #31415 Reply
    Thomas Hinault

    Hi Mite,
    I have another question regarding Braph analyses. Could you please provide a quick example on how to script the analyses? I would like to compute braph metrics on many conditions (with the same parameters in the algorithms) and it would be faster to run these analyses within a FOR loop.



    #32116 Reply
    Mite Mijalkov

    Hi Thomas,

    In the following, I will try to provide an explanation for the process of how to script a sample analysis. I will assume that you have your cohort ready and saved. A sample procedure for the analysis would be the following:

    % this loads the fc cohort file
    % in here if you type cohort on the command line, you can see all the cohort properties and subject division into groups

    % the data of a specific group can be extracted as:
    data = cohort.getSubjectData(group1);
    % this is a cell array containing the data for all subjects

    % specify the density range at which measures will be calculated
    densities = density_min:density_step:density_max;

    % specity the measures that should be calculated
    measures = [1 2 3 4 5];
    % the measures should be put by their corresponding numbers (the numbers represent the order of the measure in the list, it can be found by typing Graph.NAME)

    % now the measures should be calculated for each density for each subject (in that particular group)
    % a sample for loop would look like
    for subi % for each subject in the corresponding group
    for d% for each density specified
    graph = GraphBU(data{subi,d},’Density’,d); % create the graph (BU)
    for meas % for each measure specified
    r = graph.measure(meas);
    r = 0;

    I really hope that this helps. However, if you need something more, or something more specific, please let me know what you need and I will try to help you with scripting those codes.


Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Scripting
Your information: