kschan0214 / sepia

Matlab GUI pipeline application for quantitative susceptibility mapping (QSM)
MIT License
46 stars 10 forks source link

Bug report (v0.8.0): Having issues with the Sepia header #11

Closed franciscofritz closed 3 years ago

franciscofritz commented 3 years ago

Dear all,

I have a small question regarding the sepia header. I tried to create the header following the suggestions in the docs as follows: B0 = 3; % magnetic field strength, in Tesla B0_dir = [0;0;1]; % main magnetic field direction, [x,y,z] CF = 342.581e6; % imaging frequency, in Hz (B0*gyromagnetic_ratio) TE = [0.002,0.005,0.008,0.011,0.014,0.017,0.020,0.023,0.026,0.029,0.032,0.035,0.038,0.041,0.044,0.047,0.050,0.053,0.056,0.059]; % echo time for each GRE image, in second delta_TE = 0.003; % echo spacing, in second matrixSize = [198,192,160]; % image matrix size voxelSize = [1,1,1]; % spatial resolution of the data, in mm

where my data is 20 echo times. However, when the SEPIA GUI is running, it reports an error during the load of the file as follows: Error using load Number of columns on line 2 of ASCII file F:\MRIConvert\BF201121\FullBrain_Mag_Phs_Data\sepia_header.m must be the same as previous lines.

Error in SepiaIOWrapper (line 206) load([inputDir filesep headerList(1).name]);

Error in sepiaIO (line 41) SepiaIOWrapper(input,output,maskFullName,algorParam);

Error in sepia_config_8 (line 33) sepiaIO(input,output_basename,mask_filename,algorParam);

Error in run (line 91) evalin('caller', strcat(script, ';'));

Error in sepia>PushbuttonStart_Callback (line 468) run(configFilename);

Error while evaluating UIControl Callback.

It seems that it is an error from Matlab itself but not from SEPIA, but I don't get what would be the error. I tried to use the SEPIA GUI who created this header but also shows an error as follows: Saving header file... Error using sepia_handle_panel_utility_get_header>PushbuttonRun_Utility_getHeader_Callback (line 423) Brace indexing is not supported for variables of this type.

Error while evaluating UIControl Callback.

So for now I don't have any options. If someone got the same error and can help me it would be nice. Thanks a bunch, Frank

kschan0214 commented 3 years ago

Hi Frank,

It seems that you saved these variables in a .m file instead of a .mat file. A correct SEPIA header is in a .mat format. Can you try entering the following lines in the command window? This should then save these variables into a single .mat file called 'sepia_header.mat'.

B0 = 3; % magnetic field strength, in Tesla
B0_dir = [0;0;1]; % main magnetic field direction, [x,y,z]
CF = 3*42.58*1e6; % imaging frequency, in Hz (B0*gyromagnetic_ratio)
TE = [0.002,0.005,0.008,0.011,0.014,0.017,0.020,0.023,0.026,0.029,0.032,0.035,0.038,0.041,0.044,0.047,0.050,0.053,0.056,0.059]; % echo time for each GRE image, in second
delta_TE = 0.003; % echo spacing, in second
matrixSize = [198,192,160]; % image matrix size
voxelSize = [1,1,1]; % spatial resolution of the data, in mm

save('sepia_header','B0','B0_dir','CF','TE','delta_TE','matrixSize','voxelSize')

Would you mind also providing a screenshot of how you specify the input using the 'Get header info' function in the SEPIA's GUI? I could then have a better idea of what might be the issue with the screenshot.

Thanks for posting the issue here!

Kwok

franciscofritz commented 3 years ago

Hey, guess what. It worked! But in this way: 1) when I decide to load the "input directory" which contains all the elements (mag files, phase files and *header.mat file), it does not work. However, when I load them individually, it works (so now it is running quite smoothly and looking for the results). 2) The screenshot: image Maybe it is also my input directory? :(.

You are welcome, I am really looking forward to work with this software. F.

kschan0214 commented 3 years ago

Glad to hear it works!

  1. It may possibly cause by the multiple files sharing the same key string in the filename (e.g. mag, ph or/and header). As a result, SEPIA tried to load the incorrect file(s) in the pipeline and causing the error.

  2. Is your directory containing only the output using either one of dcm2niix, dicm2nii or MRIConvert? By default, only the output files of these DICMO-NIFTI conversion tools can be recognised at the moment. Alternatively, you can first use 'Op3' in which you need to manually select a NIFTI file (can be used without specifying the TE files). It should immediately read the header info of the NIFTI file and display them on the user defined input fields below, where you can make further adjustment/correction for the header.

Kwok

kschan0214 commented 3 years ago

Hi Frank,

Just checking if everything is working fine now? If so, I will close the issue. ;)

Kwok

franciscofritz commented 3 years ago

Hey Kwok,

sorry for not answering. My boss just suggested me to use another method to analyse my phase images. Nevertheless, now it is working (but I haven't tested your approach - about the number (2)) and I hope in the future to use it. Just I realised that I haven't got yet the STI toolbox. But yes, I think you can close this issue. I will come back if something else is happening ;).

Frank.

kschan0214 commented 3 years ago

Sure, just feel free to start a new issue if you encounter any questions when using SEPIA. :)