Connectivity Matrix Export

19 views
Skip to first unread message

yy z

unread,
May 13, 2026, 9:03:32 AM (12 days ago) May 13
to DSI Studio
优化后文本:
Subject: Issue with ROI-to-ROI Connectivity Matrix Export and MAT File Readability (Version 2026.5.9)

We encountered an issue during the generation and export of the ROI-to-ROI connectivity matrix in version 2026.5.9. Specifically, after selecting “Connectivity Matrix”, the following parameters were configured:  
- Parcellation Atlas: ROIs  
- Passing Region: enabled  
- Value Metric: number of tracts  

Upon clicking “Recalculate” and exporting the resulting file (whole_brain_ROIs.mat), the exported MAT file failed to load in MATLAB. The error message received was:  

File path: path/whole_brain_ROIs.mat  
File size: 5.808 MB  
Last modified: 13-May-2026 16:40:24  

===== Step 2. Attempt to load the file =====  
Load failed: Unable to read MAT file /Volumes/dwj/tracts/preAC/C5/whole_brain_ROIs.mat.  
The file may be corrupted or incompatible with MATLAB’s MAT-file format.  
This file may not conform to the expected ROI-to-ROI connectivity matrix structure (e.g., missing required variables, incorrect data types, or unsupported serialization version).  

Notably, identical parameter settings and workflow previously produced fully readable and functional connectivity matrices in earlier versions. We would appreciate your guidance on the likely cause—e.g., changes in serialization protocol, variable naming conventions, or compatibility requirements introduced in v2026.5.9—and any recommended remediation steps.

Thank you for your support.

Frank Yeh

unread,
May 13, 2026, 9:20:38 AM (12 days ago) May 13
to daiwen...@gmail.com, DSI Studio
I tested the steps using built-in HCP-MMP atlas and can use python to read the mat file:

image.png

--
You received this message because you are subscribed to the Google Groups "DSI Studio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dsi-studio/b4e36818-9d36-4922-9068-4e7ab3897cfdn%40googlegroups.com.

柯酥卤

unread,
May 14, 2026, 12:02:52 PM (11 days ago) May 14
to DSI Studio
怎么还把“优化后文本”也复制了呢XD,我看完这个PYTHON图扔给AI发现主要原因是【变量名包含空格以及^】, MATLAB 中,变量名严禁包含空格 ,但是 Python 的 scipy.io.loadmat 是将其读入为字典(Dictionary),键值(Key)可以是任何字符串,所以它能成功。   
so...
Maybe you could try this code, by gemini: 
function data_struct = read_dsi_mat(file_path)
    fid = fopen(file_path, 'rb');
    data_struct = struct();
    while ~feof(fid)
        header = fread(fid, 5, 'int32');
        if isempty(header) || length(header) < 5, break; end
        type = header(1);
        mrows = header(2);
        ncols = header(3);
        imagf = header(4);
        namelen = header(5);
        raw_name = fread(fid, namelen, 'uint8=>char')';
        var_name = strtrim(raw_name);
        var_name = var_name(var_name ~= 0);
        precision_code = mod(floor(type/10), 10);
        if precision_code == 1 || type == 10
            precision = 'single';
        else
            precision = 'double';
        end
        total_elements = mrows * ncols;
        if total_elements > 0
            data = fread(fid, [mrows, ncols], precision);
            safe_name = regexprep(var_name, '[^a-zA-Z0-9]', '_');
            safe_name = regexprep(safe_name, '_+', '_');
            safe_name = strtrim(regexprep(safe_name, '^_+|_+$', ''));
            if isstrprop(safe_name(1), 'digit')
                safe_name = ['v' safe_name];
            end
            data_struct.(safe_name) = data;
        end
        if imagf == 1
            if strcmp(precision, 'single')
                fseek(fid, total_elements * 4, 'cof');
            else
                fseek(fid, total_elements * 8, 'cof');
            end
        end
    end
    fclose(fid);
end
我的是读取成功了,希望能帮到你!

柯酥卤

unread,
May 14, 2026, 12:02:59 PM (11 days ago) May 14
to DSI Studio
Sorry
上一条信息本来是想发给提问者,不小心发给了你。
但我这条信息确实有个问题想要请教,是关于R2R批量化处理的问题。
我所有操作都和提问者一致的话应该采用什么指令能够生成这个 whole_brain_ROIs.mat  呢?
是直接采用 '%DSI%' --action=ana --source='%FZ%' --tract='%TT%' --connectivity=‘%ATLAS_NAME%’吗?

On Wednesday, May 13, 2026 at 9:20:38 PM UTC+8 Frank Yeh wrote:

Frank Yeh

unread,
May 14, 2026, 12:13:53 PM (11 days ago) May 14
to kesul...@gmail.com, DSI Studio
Thanks for pointing out the space issue and posting the solution. Much appreciated!

Frank Yeh

unread,
May 14, 2026, 12:14:52 PM (11 days ago) May 14
to kesul...@gmail.com, DSI Studio
On Thu, May 14, 2026 at 12:02 PM 柯酥卤 <kesul...@gmail.com> wrote:
我所有操作都和提问者一致的话应该采用什么指令能够生成这个 whole_brain_ROIs.mat  呢?
是直接采用 '%DSI%' --action=ana --source='%FZ%' --tract='%TT%' --connectivity=‘%ATLAS_NAME%’吗?


Yes, it should work on the most recent version of DSI Studio.


 
Reply all
Reply to author
Forward
0 new messages