dki-questions > dke_parameters cannot Access Image Files
Showing 1-10 of 10 posts
Display:
Results per page:
Sep 26, 2019  10:09 AM | Rees Ridout
dke_parameters cannot Access Image Files
When I run dke.sh from the command line on my Mac to access dke_parameters.dat, I get the following error:

sifnos:Mac64 rpr14$ sh run_dke.sh /Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat
------------------------------------------
Setting up environment variables
---
DYLD_LIBRARY_PATH is .:/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/runtime/maci64:/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/bin/maci64:/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/sys/os/maci64
dyld: Library not loaded: @rpath/libmwlaunchermain.dylib
Referenced from: /Applications/Mac64/./dke.app/Contents/MacOS/dke
Reason: no suitable image found. Did find:
/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/runtime/maci64/libmwlaunchermain.dylib: stat() failed with errno=20
/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/bin/maci64/libmwlaunchermain.dylib: stat() failed with errno=20
/Volumes/CivmUsers/rpr14/Desktop/dke_parameters.dat/sys/os/maci64/libmwlaunchermain.dylib: stat() failed with errno=20
run_dke.sh: line 29: 55506 Abort trap: 6 "./dke.app/Contents/MacOS/dke"


I suspect the problem may come from the following lines in my parameters file:

% paths

% studydir = 'D:\DKI Example'; % root folder for data from all study subjects
studydir = '/Applications/Mac64/'; % root folder for data from all study subjects
subject_list = {'Applications/Mac64/dki_example_data_nifti'}; % cell array of subject sub-folders within the root folder studydir

I am attempting to access my 4d-nifti image: '4d.nii'


Any ideas of why I cannot access the image or ways to fix this would be great!

Best,
Rees
Sep 26, 2019  10:09 AM | Emilie McKinnon - MUSC
RE: dke_parameters cannot Access Image Files
Hi Rees, 

1) Where is your 4d.nii located? Is it in your applications folder? 
2) When you run dke.sh you also need to give it the path to your matlab compiler runtime. If I remember correctly, it should be run as run_dke.sh "path to runtime" "path to dke_parameters"

Best, 
Emilie
Sep 26, 2019  11:09 AM | Emilie McKinnon - MUSC
RE: dke_parameters cannot Access Image Files
Rees, 

Here is an example of how to run the code on mac: ~/Desktop/DKE/run_dke.sh /Applications/MATLAB/MATLAB_Compiler_Runtime/v82 ./DKEParameters.dat 

Please have a look at some other forum posts (mostly on the other forum dke-questions) some of them might be helpful to you! 

Good luck, 
Emilie
Sep 26, 2019  11:09 AM | Rees Ridout
RE: dke_parameters cannot Access Image Files
Hi Emilie,
We're starting using DKE software for our data analysis in Mac version.
We try to run the example "4Drdki_0.nii" data through the software, and then run our acquired data.
1) The 4dnii data is here:
Volumes/sifnosspace/ReesWork/dki_example_data_nifti/4Drdki_0.nii
2) The dke_parameter.dat file is in Matlab compiler runtime:
/Applications/MATLAB/MATLAB_Runtime/v90/dke_parameter.dat

I think we need to modify the "studydir" and "subject_list" in the dke_parameter.dat file.
Could you Kindly show us the command line to run dke with the example 4dnii data?

Thanks,
Rees
Sep 26, 2019  12:09 PM | Andrew Taylor - MUSC
RE: dke_parameters cannot Access Image Files
Hello,

In this case, two combinations of inputs that would work are 

studydir = '/Applications/Mac64/'; % root folder for data from all study subjects
subject_list = {'dki_example_data_nifti'}; % cell array of subject sub-folders within the root folder studydir
preprocess_options_fn_nii='4d.nii';

OR

studydir = '/Applications/Mac64/dki_example_data_nifti''; % root folder for data from all study subjects
subject_list = {''}; % cell array of subject sub-folders within the root folder studydir
preprocess_options_fn_nii='4d.nii';

This is because DKE will concatenate these three variables to create a full path to your nii images. This was intended for convenience. 

If you wanted to run DKE on multiple datasets, you put the following in your parameters file:

studydir = '/Applications/Mac64/'; % root folder for data from all study subjects
subject_list = {'dki_example_data_nifti','dki_example_data_subject2'}; % cell array of subject sub-folders within the root folder studydir
preprocess_options_fn_nii='4d.nii';

This would require the files '/Applications/Mac64/dki_example_data_nifti/4d.nii' and '/Applications/Mac64/dki_example_data_subject2/4d.nii' both to exist.

-Andrew

P.S. You DON'T have to worry about getting the slashes right where path segments from multiple variables are joined e.g. /Applications/Mac64/ and /Applications/Mac64 would both work for "study_dir". All other slashes, however, matter.
Sep 26, 2019  12:09 PM | Andrew Taylor - MUSC
RE: dke_parameters cannot Access Image Files
Sorry, I didn't see the most recent posts. The command you would use is:

dke.sh /Applications/MATLAB/MATLAB_Runtime/v90/ /Applications/MATLAB/MATLAB_Runtime/v90/dke_parameter.dat

And the first parts of your dke_parameters.dat file would be the following:

studydir = 'Volumes/sifnosspace/ReesWork/dki_example_data_nifti'; % root folder for data from all study subjects
subject_list = {''}; % cell array of subject sub-folders within the root folder studydir
...
preprocess_options_fn_nii='4Drdki_0.nii';


NOTE that I added an ellipsis for the other parameters which must still be included, they just were not relevant here.
Sep 26, 2019  01:09 PM | Rees Ridout
RE: dke_parameters cannot Access Image Files
Thanks for the reply.
1) Our data is: "/Volumes/sifnosspace/ReesWork/dki_example_data_nifti/4Drdki_0.nii"
2) DKE is installed in: "/Applications/Mac64/". There are two files in this folder:  dke and run_dke.sh
3) MCR is installed in: "/Applications/MATLAB/MATLAB_Runtime/v90"
4) dke_parameter.data file is in: "/Volumes/sifnosspace/ReesWork/dke_parameters.dat"

Here is what we got after run the command line:
sifnos:sifnosspace rpr14$ /Applications/Mac64/run_dke.sh /Applications/MATLAB/MATLAB_Runtime/v90 /Volumes/sifnosspace/ReesWork/dke_parameters.dat
------------------------------------------
Setting up environment variables
---
DYLD_LIBRARY_PATH is .:/Applications/MATLAB/MATLAB_Runtime/v90/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v90/bin/maci64:/Applications/MATLAB/MATLAB_Runtime/v90/sys/os/maci64
dyld: Library not loaded: @rpath/libmwmclmcrrt.8.2.dylib
Referenced from: /Applications/Mac64/dke.app/Contents/MacOS/dke
Reason: image not found
/Applications/Mac64/run_dke.sh: line 29: 59115 Abort trap: 6 "/Applications/Mac64/dke.app/Contents/MacOS/dke" "/Volumes/sifnosspace/ReesWork/dke_parameters.dat"

4) We use the default dke_parameters.dat file and changed the path as suggested:

% paths

studydir = '/Volumes/sifnosspace/ReesWork/dki_example_data_nifti'; % root folder for data from all study subjects
subject_list = {''}; % cell array of subject sub-folders within the root folder studydir
% preprocessing parameters
preprocess_options_fn_nii='4Drdki_0.nii'; % input image format ('dicom', 'nifti' or 'bruker') (default: 'dicom')
preprocess_options.navg = 2; % number of DKI series (default: 2); each DKI series must contain a b = 0 image followed by diffusion-weighted images; all series must use identical acquisition protocols (i.e., same diffusion weightings and gradient directions)
preprocess_options.extra_b0 = 1; % whether (1) or not (0) there is an additional b = 0 series (default: 1); used when preprocess_options.format = 'dicom'
preprocess_options.coreg_flag = 1; % whether (1) or not (0) to perform 6-parameter rigid-body coregistration between diffusion-weighted images (default: 1); used when preprocess_options.format = 'dicom' or 'bruker'
preprocess_options.series_description = {'DKI1' 'DKI2' 'DKI_B0'}; % list of dicom series descriptions; used when preprocess_options.format = 'dicom'
preprocess_options.fn_nii = '4d.nii'; % four-dimensional nifti image file name; no coregistration is performed between the diffusion-weighted images; used when preprocess_options.format = 'nifti'; the first image must be the b = 0 image
% imaging diffusion weightings and directions
....................

Any suggestions?




Thanks,
Nian
Sep 26, 2019  01:09 PM | Andrew Taylor - MUSC
RE: dke_parameters cannot Access Image Files
I believe in this instance, the "image" not found is one of the dynamic libraries used in DKE. 

When I look at your example and Emilie's example, it seems you have different MCR versions -- v90 and v82. Make sure you have the right MCR version. I believe the target Matlab version is Matlab 2012a.
Sep 26, 2019  02:09 PM | Nian Wang - Duke
RE: dke_parameters cannot Access Image Files
Thanks for the reply.
We only have Matlab 2015b in our lab, so we installed MCR version V90. 
https://www.mathworks.com/products/compi...
Do we have to use Matlab 2012a for DKE?

Thanks,
Nian
Oct 24, 2019  11:10 AM | Emilie McKinnon - MUSC
RE: dke_parameters cannot Access Image Files
Yes. The MCR compilers are free and you can just download the one for Matlab 2012a