Environment incompatibilities for system command
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear community,
I'm using a Matlab-based toolkit, the lesion quantification toolkit: lesion quantification toolkit
I'm a bit confused by one thing. This toolkit executes an application externally called DSI studio by launching the terminal from Matlab using the "system" command. Actually, I had to modify this and use system instead of the original combination of eval and ! as the toolkit was developed using a Linux platform.
My confusion comes from the fact that without starting the toolkit I can actually use the system command to run some operations in DSI studio from Matlab. But (!!) if I run the function from the toolkit where the system command is used to execute DSI studio externally, I get the following error message:
/bin/bash: /Applications/dsi_studio.app/Contents/MacOS/dsi_studio/: Not a directory
"Not a directory" is false, as I can run the same command without errors before starting the toolkit. My deduction is that the toolkit is setting the wrong environment for the system command?
This is the original code snippet that works without starting the toolkit and using a cfg file with the paths and filenames:
cmd= sprintf('%s --action=ana --source=%s --tract=%s --output=%s --connectivity=%s --connectivity_type=%s --connectivity_threshold=0 --export=tdi',...
cfg.dsi_path,fullfile(cfg.source_path, source_fib),fullfile(cfg.source_path, all_tracts),out_file,cfg.parcel_path,cfg.con_type);
system(cmd)
I would appreciate if a more advanced Matlab user could confirm my suspicion and help me to find a workaround for this?
Thank you in advance for your time!!
Best,
Noelia
댓글 수: 2
Walter Roberson
2024년 3월 5일
cmd= sprintf('"%s" --action=ana --source="%s" --tract="%s" --output="%s" --connectivity="%s" --connectivity_type="%s" --connectivity_threshold=0 --export=tdi',...
cfg.dsi_path,fullfile(cfg.source_path, source_fib),fullfile(cfg.source_path, all_tracts),out_file,cfg.parcel_path,cfg.con_type);
system(cmd)
답변 (1개)
Chandrika
2024년 7월 3일
Hello Noelia,
You may use the "getenv" function to display the environment variables before and after running the Lesion Quantification Toolkit in MATLAB to check if the Toolkit is altering the environment.
You may find detailed information on the "getenv" function in the following documentation:
Hope it helps!
Regards,
Chandrika
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!