Global measures: individual subject

Home Forums General Help Global measures: individual subject

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #26014 Reply
    Thomas HINAULT
    Guest

    Hi everyone,
    Is there a way to display every individual average for a given condition at once? Right know unchecking the “group average” box in the global measure tab only displays the average of a single subject, which makes it extremely cumbersome to extract the data or just visualize the variability in a given condition.
    Thanks
    Thomas

    #26329 Reply
    Mite Mijalkov
    Keymaster

    Hi Thomas,

    You are right, currently in Braph you could either view the results for an individual subject (a given measure at all densities) or get the corresponding average between the group members. In order to get different averages, this needs to be done from the command line.

    I could prepare a short file for you that can extract different kinds of data and display it in the command line. In order to do so, could you let me know more specifically what you would like to do, and I can prepare the file accordingly?

    Hope this helps. Looking forward to hearing from you.

    Best,
    Mite

    #26639 Reply
    Thomas HINAULT
    Guest

    Hi Mite,
    I am looking at modularity values for multiple conditions, and I would like to extract all the modularity values at once for a given subjects. This would be a global measure (not nodal).
    Thanks!

    Thomas

    #26655 Reply
    Mite Mijalkov
    Keymaster

    Hi Thomas,

    When you say that you calculate modularity at different conditions, does this mean by changing the parameters in the algorithms?

    If that is the case, then currently you could not do that from the GUIs and you would need to perform that from the command line. In order to help you with the preparation of this code, could you give me more details on which parameters you would need to change and extract from your calculations?

    Best,
    Mite

    #26928 Reply
    Thomas HINAULT
    Guest

    Hi Mite,
    I entered connectivity matrices for different experimental conditions that I would like to compare. The parameters in the algorithms are the same.

    Best,
    Thomas

    #26941 Reply
    Mite Mijalkov
    Keymaster

    Hi Thomas,

    I understand. I prepared a sample code that given the measure (modularity in this case) can extract the values for all subjects in a specified groups across the density range that you can specify. Please check the following:

    clear all; close all; clc;
    % this code will extract the results for all subjects in a given group at
    % all densities specfied as a range. The code currently extracts modularity
    % measure.
    % the values are extracted in the array meas_extracted
    % each row is a subject in the group, while each column represents
    % different density

    %% load the fga file with already calculated measures
    load(‘trial.fga’,’-mat’)

    %% specify groups for which measures can be extracted
    % the groups can be checked by typing ga.cohort on the command line
    group = 1;

    %% specify density range
    densities = 5:1:15;

    %% specify the measure number
    % the measure number is found by typing Graph.NAME on the command line
    % 34 – modularity
    measure_numbers = 34;

    %% calculate the number of subjects in this group
    sub_num = numel(find(ga.cohort.getGroup(group).getProp(Group.DATA)));

    %% initialize the array that holds the measure
    meas_extracted = zeros(sub_num,length(densities));

    %% extract the measures
    for d = 1:1:length(densities)

    %% get all measures from the particular group
    [ms_gr1,mi_gr1] = ga.getMeasures(measure_numbers,group);
    % get only the values of the measure at the given density
    value_gr1 = ms_gr1{densities(d)}.getProp(fMRIMeasureBUD.VALUES1);
    
    %% put the measures at the corresponding place in the array
    meas_extracted(:,d) = value_gr1;
    

    end

    Please let me know if this is the code you needed. If further generalizations are needed, I could try to help with that.

    Best,
    Mite

    #31412 Reply
    Thomas Hinault
    Guest

    Hi Mite,
    Sorry for the delayed answer I had to work on another dataset for a while.
    I tried the script you wrote but I am getting an “Index exceeds matrix dimensions” error, when trying to run the last line of the script:
    value_gr1 = ms_gr1{densities(d)}.getProp(EEGMeasureWU.VALUES1);

    Note that my matrix is in .ega and not .fga format. Could this change anything?
    The error occurs regardless of the group or measure number I enter. Could this come from the density range? How were these numbers determined?

    Thanks again for your help

    Thomas

    #32117 Reply
    Mite Mijalkov
    Keymaster

    Hi Thomas,

    I had a look at the code that I suggested and the line you entered and I think that I know the reason that problem occurs. The ega format instead of fga should not be a problem since at the end, the matrices are extracted in analogous way. However, the code that I wrote was intended to work with binary matrices at different densities.

    From the code you wrote in your response, I think that you work with weighted matrices, for which you do not have different densities. In my opinion, this is the reason that you get the problem. If this is correct, could you provide me with a sample data file, so that I could write up a code that can do the job you would like for that specific file and then you can reapply to other calculations.

    Best wishes,
    Mite

    #32898 Reply
    Thomas Hinault
    Guest

    Hi Mite,
    I send a data file to your gmail address. Let me know if this works or if there is anything I can do.
    Thank you for your help!

    Thomas

    #32920 Reply
    Mite Mijalkov
    Keymaster

    Hi Thomas,

    The error indeed was with the densities. I have revised my code and will send you the file to your e-mail address in a short while.

    Best,
    Mite

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Global measures: individual subject
Your information: