dke-questions > Bruker data Command line
Showing 1-20 of 20 posts
Display:
Results per page:
Sep 8, 2020  12:09 PM | psikorova
Bruker data Command line
Good morning,

I am new to using the DKE software and I have been struggling with running the image processing on my Bruker data. I am trying to upload my data using the command line, since the GUI does not support Bruker data - however, after running the process for circa 30 minutes (the coregistration), it stops due to a significant number of errors. I have been trying to figure out the reason for such early and unexpected stopping, but so far I was not succesful, thus I am kindly asking here for help.

The list of errors I get:
Error using spm_vol>subfunc (line 101)
File "" does not exist.
Error in spm_vol>subfunc1 (line 77)
Error in spm_vol>subfunc2 (line 69)
Error in spm_vol (line 54)
Error in spm_reslice (line 121)
Error in dke_preprocess_bruker>coregister (line 274)
Error in dke_preprocess_bruker>(parfor body) (line 125)
Error in parallel_function (line 470)
Error in dke_preprocess_bruker (line 120)
Error in dke (line 176)

I am pretty positive there must be something wrong in my DKE parameters file, but I just cannot figure out what exactly. Therefore, I attach my parameters file (par.dat). I am working with 5 different b values (300, 600, 900, 1200 and 1500) and 30 gradient directions.

Thank you very much for any help,
Pavlína Sikorová
Attachment: par.dat
Sep 8, 2020  07:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Dear Pavlina, 


The error tells me that DKE is trying to find your images in a folder named "" (blank). This probably stems from the subject_list parameter. If I remember correctly the 20200803_140853_celer_1_1 should be placed in the subject_list. Let me know if that works. Otherwise I would try just putting the 1 there. 

Emilie
Sep 9, 2020  12:09 PM | psikorova
RE: Bruker data Command line
Dear Emilie,

I have tried to run it as you suggested, but it did not help. Not even the coregistration would start. The path 'C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1\' leads directly to my 2dseq file of one study subject. When I tried to follow your advice and first added the "20200803_140853_celer_1_1" to the subject_list, it was not able to get to the 2dseq at all. Then I moved the "1" to the subject_list and it would start the coregistration, but stopped at the same errors that I had mentioned in my first message.

Thank you,

Pavlína Sikorová
Sep 9, 2020  12:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
When you run it can you see if it creates a log file?  Does it create a folder called intermediate processing? 
This is where DKE will try and find your images : dir_subj = fullfile(studydir, subject_list{isubject}); % subject root folder
I also think this is where it is trying to find your reco file. So you might have to put that in the same folder as 2dseq. 

Does that work? Sorry it's been a while since I used Bruker data :) 

Emilie
Sep 9, 2020  02:09 PM | psikorova
RE: Bruker data Command line
Dear Emilie, 

unfortunately, it does not even create the folder intermediate processing, so I am afraid I cannot follow the rest of your message. Would it help if I sent you my data set (20200803_140853_celer_1_1)? However, I am not sure whether the file is not too big for 
And no need to apologize, I am glad for any kind of help or advice, I have been struggling with that for way too long already :)

Pavlína
Sep 9, 2020  03:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Does the log file get created? And did you try moving the rec file?

It wont really help If you send me the data because the issue is your folder structure/path name.

Can you send me the entire output text and your command and your dat file.

Emilie
Sep 9, 2020  03:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Did you have a look at the older forum posts. I think I helped solve similar issues to this one a couple of years ago ( that's why I cant remember :) ). The method file also needs to be in the same folder as the 2dseq. I know an update is due to the software! 

Emilie
Sep 10, 2020  07:09 AM | psikorova
RE: Bruker data Command line
Dear Emilie,

I have been working on my issue and managed to get the file intermediate_processing being created! It is saved directly on the path studydir, so the file is created in the same place as 2dseq is (that means C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1) - this folder contains also the id, method, procs, reco, roi and visu_pars files from bruker.

The file intermediate_processing contains these sub folders: dki_avg1_coreg, dki_avg1_nii, dki_b0_coreg, dki_b0_nii, but it did not come to the successful ending, because there was an error which stopped the process:

Error using nifti/create>create_each (line 29)
Unable to write header for
"C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1\intermediate_processing\dki_avg2_nii\adki_300.nii".

Error in nifti/create (line 15)
Error in spm_create_vol>create_vol (line 162)
Error in spm_create_vol (line 16)
Error in spm_write_vol (line 82)
Error in dke_preprocess_bruker>image_avg (line 294)
Error in dke_preprocess_bruker (line 109)
Error in dke (line 176)

So apparently it is supposed to create more subfolders, but something caused the early stopping - I do not understand why the first four folders with files could have been created without any problem, but then the DKE was unable write header and so on...

Best regards,
Pavlína
Attachment: dke.log
Sep 10, 2020  05:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Good to hear! 

Does it write any .nii files in any of the folders? 
Are you sure you acquire 2 sets of averages? Maybe, preprocess_options.navg = 2; needs to be equal to 1. 

Emilie
Sep 11, 2020  12:09 PM | psikorova
RE: Bruker data Command line
Yes, all of the folders contain files - currently (after changing preprocess_options.navg to 1 as you suggested) there are 5 of the folders: dki_avg1_coreg, dki_avg1_nii, dki_b0_coreg, dki_b0_nii and combined. And the files inside are all *.nii files.

So in this moment, the co-registration, averaging images and reading input files are complete!
Now I have a problem with this:

Undefined function 'plus' for input arguments of type 'cell'.
Error in dke_estimate (line 183)
Error in dke (line 182)
MATLAB:UndefinedFunction
 
I thought it has something to do with the variables dti_method.b_value and dti_method.directions. I tried to write [1:30] instead of {1:30} and some other options, but nothing seems to be the right way... Currently it is like this:

dti_method.b_value = [300 600 900 1200 1500];
dti_method.directions{1} = {1:30};
dti_method.directions{2} = {1:30};
dti_method.directions{3} = {1:30};
dti_method.directions{4} = {1:30};
dti_method.directions{5} = {1:30};

Do you by any chance have an idea what to do with that?

Thank you!
Attachment: par.dat
Sep 11, 2020  12:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Are you using the same gradient directions for each b value?
how many gradient directions are in fn_gradient.dat

The structure you need is the following:
fn_gradients = 'gradient_vectors_siemens30.dat'; = path where DKE can find your gradient table
bval = [ 0 300 600 900 1200 1500]; = your b values , you should have acquired 0 too
ndir = 30;
idx_gradients = {1:ndir 1:ndir 1:ndir 1:ndir 1:ndir}; = for your non zero b-values write down which lines in your gradient table correspond to the correct gradient directions. If in fn_gradient.dat there are only 30 gradients this is the right set up.
If you have a different gradient table for each bvalue the set up is different.
I noticed below you copied something about dti_method ? Unless you are interested in pure DTI calculations you can just keep that part turned off. The DKI output will include FA, MD etc.
You should be able to follow the manual more closely now that your bruker data is coverted to nifti. From this point on any error will not be related to the bruker data but to the way you set up your .dat file.
Hope this helped.
Emilie
Sep 16, 2020  06:09 AM | psikorova
RE: Bruker data Command line
Dear Emilie,

I would like to ask about the maps. I still have just the five subfiles in the intermediate_processing file and I assume those are not the final maps of FA, MD etc? If so, what should I do to really get them?

Thanks in advance,
Pavlína
Sep 16, 2020  12:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Make sure the program runs without errors until the end :) are you still getting the same error?
Sep 16, 2020  01:09 PM | psikorova
RE: Bruker data Command line
I still have some errors - currently I am trying to figure out this:

Co-registration complete.
Averaging images... complete.
Reading input images... complete
Filtering input images... complete.

Processing voxels... Error using matlabpool (line 144)
Failed to open matlabpool. (For information in addition to the causing error,
validate the profile 'local' in the Cluster Profile Manager.)

Error in dke_estimate (line 403)
Error in dke (line 182)

Caused by:
Error using
distcomp.interactiveclient/pGetSockets>iThrowIfBadParallelJobStatus (line
114)
The interactive parallel job finished without any messages.
parallel:cluster:MatlabpoolRunValidation

I do not know what in the par.dat file is connected to the matlabpool and causing this error.

Best regards,
Pavlína
Attachment: par.dat
Sep 16, 2020  01:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Are you still using the command line ? What matlab compiler runtime are you using?
Sep 16, 2020  02:09 PM | psikorova
RE: Bruker data Command line
yes, still the command line. I am using the MCR R2012a
Sep 16, 2020  02:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
Hmm I am not sure what is going on. It's weird to have a matlabpool error in the compiled version. 
Can you type in the word path in your command window and check if the correct MCR folder is highest in your path? 
A problem might be that you already had a newer version of MCR installed on your computer and the command window is not choosing MCR R2012a to run DKE.
Sep 16, 2020  02:09 PM | psikorova
RE: Bruker data Command line
Well, I have a big folder called Program Files - DKE and MCR R2012a are subfolders. Not sure if this is what you meant? Othervise the MCR R2012a is definitely the only version I have on my laptop.
Sep 16, 2020  03:09 PM | Emilie McKinnon - MUSC
RE: Bruker data Command line
  
I am sorry but I am not sure what is going on at this point. It might not be related to DKE (see https://www.mathworks.com/matlabcentral/answers/57833-error-using-matlabpool-line-144 ) and I dont know how to further help you.  

There are two things you can do, 1. try and run DKE from the source code which will allow you more flexibility and you should be able to circumvent this matlabpool issue (https://github.com/m-ama/DKE), or 2. the lab is working on incorporating Bruker options in some of our newer processing softwares, however I have no idea how long before this will be finished. 

Sorry I could not figure this one out! 
Good luck!
Sep 16, 2020  03:09 PM | psikorova
RE: Bruker data Command line
Okay, thank you very much for everything, you helped me a lot anyway! You were very helpful and responsive and I truly appreciate the time you dedicated to me :)