Commands are not recognised in LQT Matlab-based

117 views
Skip to first unread message

Triana Karnadipa

unread,
Nov 15, 2024, 12:31:08 AM11/15/24
to DSI Studio

Dear Prof. Frank,

I hope you’re well. I’m reaching out for guidance on using DSI Studio commands in MATLAB’s Lesion Quantification Toolkit to create a disconnection matrix. The command I used is:

eval(['! ' cfg.dsi_path ' --action=ana --source=' fullfile(cfg.source_path, source_fib) ' --tract=' fullfile(cfg.source_path, all_tracts) ' --roi=' cfg.lesion_path...
    ' --output=' out_file ' --connectivity=' cfg.parcel_path ' --connectivity_type=end'...
    ' --connectivity_threshold=0 --export=tdi']);

Here are the specifics:

  • cfg.source_path points to an HCP1065 fiber file.
  • The parcellation file used is Schaefer2018_100Parcels_7Networks_order_plus_subcort.

However, the following error messages appeared when executing the command:

  • WARNING: --connectivity is not used/recognized. Did you mean --dt_metric1?
  • WARNING: --connectivity_type is not used/recognized.
  • WARNING: --connectivity_threshold is not used/recognized.
  • WARNING: --export is not used/recognized. Did you mean --regions?

I have checked the DSI Studio documentation, and the commands appear to match the syntax provided. Would you be able to provide any guidance or feedback on these errors?

Thank you very much for your time and help.

Best regards,
Triana Karnadipa

Frank Yeh

unread,
Nov 15, 2024, 7:21:10 AM11/15/24
to tka...@aucklanduni.ac.nz, DSI Studio
Could you post the complete log output?

--
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/a4e79d8b-0d1f-48a0-a0da-cf793745c26fn%40googlegroups.com.
Message has been deleted
Message has been deleted

Triana Karnadipa

unread,
Nov 17, 2024, 5:58:45 PM11/17/24
to DSI Studio
Dear Prof. Frank,

I have sent the logfile in the drop box link provided at the front page. Thank you for your quick response and help. 

Kind regards,
Triana 

Frank Yeh

unread,
Nov 17, 2024, 6:55:12 PM11/17/24
to tka...@aucklanduni.ac.nz, DSI Studio
Sorry I did not see any file uploaded.
It would be easier if you just post the content here.
Frank

--
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.

Frank Yeh

unread,
Nov 17, 2024, 6:59:45 PM11/17/24
to tka...@aucklanduni.ac.nz, DSI Studio
I checked the log file you sent me by email. It seems that you are using an older version of DSI Studio, and you may need to update it.
Also, please watch the tutorial videos at https://practicum.labsolver.org about the usage of CLI.
There are also working examples at https://dsi-studio.labsolver.org/

This may help troubleshooting the problem.

Best,
Frank

Triana Karnadipa

unread,
Nov 17, 2024, 9:34:38 PM11/17/24
to DSI Studio

Dear Prof. Frank,

I hope this message finds you well. I have updated DSI Studio, but the issue with unrecognised commands persists. I have also double-checked the commands against the documentation:

The commands appear to be correct, but I’m still encountering the problem. I would greatly appreciate your insight on how I might resolve this issue.

Thank you for your time and assistance.

Frank Yeh

unread,
Nov 18, 2024, 12:34:33 AM11/18/24
to tka...@aucklanduni.ac.nz, DSI Studio
I am willing to help, but there is no detailed description about the command used and description about problem.

I won't be able to assist you with limited information.

Also, you may need to complete the tutorial videos in order to use the command correctly. 

Best regards
Frank

Triana Karnadipa

unread,
Nov 18, 2024, 5:07:57 PM11/18/24
to DSI Studio
Dear Prof. Frack,

I attached the log file here. Thank you so much for your quick response and help. 

Kind regards,
Triana 

logfile.txt

Triana Karnadipa

unread,
Nov 18, 2024, 5:08:00 PM11/18/24
to DSI Studio
Dear Prof. Frank,

I attached the logfile here. Thank you for your quick response and help. 

Kind regards,
Triana 

On Saturday, 16 November 2024 at 01:21:10 UTC+13 Frank Yeh wrote:
logfile.txt

Frank Yeh

unread,
Nov 18, 2024, 5:17:48 PM11/18/24
to tka...@aucklanduni.ac.nz, DSI Studio
The error is related to the matlab code in LQT, which is not maintained by DSI Studio.


You may contact LQT team and see if they have a solution.

Best regards
Frank

Triana Karnadipa

unread,
Dec 29, 2024, 11:13:14 PM12/29/24
to DSI Studio

Dear Prof. Yeh,

Thank you for your previous feedback—it was very helpful. I identified the issue and successfully installed my custom atlas in DSI Studio, fixed the syntax, and ran the tract analysis in Windows PowerShell. The process completed successfully, but the output values are all zeros. I tried this with 20 different lesion masks, and the results remained the same.

I’m wondering if you might have any insight into why this is happening. I’ve attached the script, output files, and CSV results for your reference.

Thank you for your time and guidance.

Best regards,

Triana Karnadipa

Output.txt
Subject1_percent_discon_tracts.csv
get_tract_discon_fixed.txt

Frank Yeh

unread,
Dec 30, 2024, 7:40:29 AM12/30/24
to tka...@aucklanduni.ac.nz, DSI Studio
I took a quick look at the code, but the command passed to DSI Studio
does not make sense to me.

It could be that I am not familiar with the lesion-symptom mapping.
Perhaps you may explain more about your goal and the idea behind your
study, and I will see what I can do to assist you.

Best regards,
Frank
> To view this discussion visit https://groups.google.com/d/msgid/dsi-studio/98ddb169-ae9f-4f08-91f3-b95353e301can%40googlegroups.com.

Esin Avcı

unread,
Feb 20, 2025, 7:58:06 AMFeb 20
to DSI Studio
Hi Triana,

Hope that you are fine. I recently saw this conversation, and I am experiencing the exact same error including both the fib mni mismatch, and "no track for further processing". Do you mind sharing how you solved the issue? Thanks!

Best, Esin

Frank Yeh

unread,
Feb 20, 2025, 8:06:50 AMFeb 20
to esin....@gmail.com, DSI Studio
The command line parameters may have changed in the new Hou version.
Could you let me know what you would like to achieve? It is possible
that the DSI Studio command line can work out the task directly.

Best,
Frank
> To view this discussion visit https://groups.google.com/d/msgid/dsi-studio/ee742df1-4d05-4dca-a362-8db8a8a76228n%40googlegroups.com.

Esin Avcı

unread,
Feb 20, 2025, 9:28:16 AMFeb 20
to Frank Yeh, DSI Studio
Hi Frank,

Thanks for the quick reply. I am using the Hou 17 Feb 2025 version and using MacOS 15 Sequoia. The code creating the issue and where DSI crashes is the eval command part (bold below), I also attach the full log file and DSI output in the matlab command window. I think these issues are similar to the others that get the segmentation fault 11, especially working with lesion quantification toolkit: 1- fib dimension does not match with MNI (182 218 182) and 2- somewhere after the tracts are loaded, DSI says "no-tract for post-track analysis, --output is not used and --export is not used, did you mean --regions?". About the general aim: I am using a MINI-registered lesion and HCP842_1mm.fib.gz to compute tract-based disconnection measures. After the eval command below, next step is to get tract stats for each tract and compute disconnections using atlas-based tract_counts.mat files. Tried to find helpful conversations, with no luck on my side. Please let me know if you have any further solutions from others who had a similar issue and fixed somehow! Thanks a lot!



f = filesep;

 % navigate to All_Tracts folder

cd(fullfile(cfg.source_path, 'All_Tracts'));

my_tracts = dir('*.trk.gz');

%% 

 % Path to output tracts

cd(cfg.out_path);

if isfolder(cfg.pat_id) == 0

    mkdir(cfg.pat_id);

end

cd(['.' f cfg.pat_id]);

if isfolder('Tract_Disconnection') == 0

    mkdir('Tract_Disconnection');

end

cd(['.' f 'Tract_Disconnection']);

 

%%   

% loop over tracts  DSI CRASH OCCURS HERE

for i = 1:length(my_tracts)

   

    % output file name

    out_file = fullfile(pwd, [my_tracts(i).name(1:end-7) '.trk.gz']);

    

    % compute tract disconnection

    eval(['! ' cfg.dsi_path ' --action=ana --source=' [cfg.source_path f 'HCP842_1mm.fib.gz'] ' --tract=' [cfg.source_path f 'All_Tracts' f my_tracts(i).name] ' --roi=' cfg.lesion_path...

        ' --output=' out_file ' --export=stat']);

  

    

    % Create empty text file if it does not exist (necessary because some versions of DSI_Studio don't output anything for null results)

    if ~exist([my_tracts(i).name(1:end-7) '.trk.gz.stat.txt'])

        fileID = fopen([my_tracts(i).name(1:end-7) '.trk.gz.stat.txt'], 'w');

        fprintf(fileID, '%s %s %s %f32 %s %s', []);

        fclose(fileID);

    end

end



Have a good day, Esin
dsi_crashreport_20.02.25.txt
dsi_output_200225.txt

Frank Yeh

unread,
Feb 20, 2025, 10:33:37 AMFeb 20
to Esin Avcı, DSI Studio
I checked the report and output in detail. Thanks a lot for providing
the files for troubleshooting!

I can see that DSI Studio was called many times. Some generated
results successfully and saved outputs, and some did not generate an
output because there were no tracts passing the lesion region (as
shown in log as "remaining tract count: 0").

One case (CS_L.trk.gz and G2001_ses01_Lesion2MNI6_fixed.nii) only has
one tract passing the lesion, and it caused the segmentation error
crash.
This is definitely a bug, but I am not able to reproduce it on my
side. If you can send me G2001_ses01_Lesion2MNI6_fixed.nii file, I can
use it to trace down the cause and fix it.

Overall, the toolbox works pretty well.

As per your question:

1- fib dimension does not match with MNI (182 218 182)

The dimension does not need to match with MNI because there is a
transformation matrix (i.e. NIFTI's srow) that maps voxel coordinate
ijk to MNI space xyz. As long as the transformation maps to the same
xyz, the images are in the same MNI xyz space. If ijk coordinates and
xyz space sounds confusing here, I would recommend my video at
https://www.youtube.com/watch?v=IVZIQRUBepw to see if it helps
clarify.

Whether a NIFTI file or FIB file aligns with a specific MNI space
cannot be determined by dimension alone. It has to be visually
inspected by overlapping them with the MNI template at the MNI xyz
space.

BTW, the FIB file used here 'HCP842_1mm.fib.gz' is the old MNI152
space. The new one HCP1065.1mm.fib.gz (at
https://brain.labsolver.org/hcp_template.html) is recommended because
it aligns with the new ICBM152 2009a space.

The tracts used also need to align with HCP1065 fib, and they are
available at https://brain.labsolver.org/hcp_trk_atlas.html It seems
to me that the toolbox used the HCP842 tractography atlas. If you use
the HCP1065 fib, then the tract files also needs to be updated.


2- somewhere after the tracts are loaded, DSI says "no-tract for
post-track analysis, --output is not used and --export is not used,
did you mean --regions?".

This is because the tracts are not passing the lesion region, and thus
there is no tract for outputting the results.

If there is anything unclear, please feel free to let me know.
Frank

Frank Yeh

unread,
Feb 20, 2025, 12:22:50 PMFeb 20
to Esin Avcı, DSI Studio
Hi Esin,

Thanks a lot for sending the files and the assistance. I located
the bug and fixed it.

The bug is due to (1) CS_L.trk.gz has a one-point tract fragment
that happens to be just inside the lesion (the lesion is on the right,
so there is supposed to be no result), (2) The tract analysis routine
did not expect an one-point tract and thus the calculation accessed
invalid memory location.

The bug is fixed by (1) eliminating one-point tracts when loading
any tract file, (2) the tract analysis routine is now immune to
one-point tract.

The new build is under going at
https://github.com/frankyeh/DSI-Studio/actions/runs/13440864928. The
Mac 14 and 15 versions may take much longer time around one hour or
two. You may opt to use the Mac 13 version, which should complete
earlier.

Again, thank you very much for reporting the issue. If there is
any question, please let me know.

Best,
Frank

Esin Avcı

unread,
Feb 20, 2025, 12:27:23 PMFeb 20
to Frank Yeh, DSI Studio
Thanks Frank, this is great news! I will try as soon as the build is complete. This was extremely helpful! 

Best, Esin
Reply all
Reply to author
Forward
0 new messages