kschan0214 / sepia

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

issue with start #30

Closed johnththomas closed 2 years ago

johnththomas commented 2 years ago

after loading the files and making the sepia_header file as per suggestions, while starting following error appears:Phase data is loaded. <<<<<<<<<"Magnitude data is loaded. No weighting map is loaded. Default QSM weighting method will be used for QSM. Header data is loaded. Validating SEPIA header... Input SEPIA header is valid. Validating input NIfTI files... There was an error! Please check the command window/error message file for more information. Error using SepiaIOWrapper>check_input_dimension (line 481) Input NIfTI data and SEPIA header do not have the same number of echoes. Please check these files. Error in SepiaIOWrapper (line 186) check_input_dimension(magn,fieldMap,matrixSize,TE); Error in sepiaIO (line 78) SepiaIOWrapper(input,output,maskFullName,algorParam); Error in sepia_config_3 (line 34) sepiaIO(input,output_basename,mask_filename,algorParam); Error in run (line 91) evalin('caller', strcat(script, ';')); Error in sepia>PushbuttonStart_Callback (line 471) run(configFilename); Error while evaluating UIControl Callback.>>>>>>>>>>>>>>>>>>>>>>

How do one change number of echoes in header, if needed?

kschan0214 commented 2 years ago

The error message is caused by the mismatch between the time (4th) dimension of the NIfTI data and the size of the 'TE' variable in the header file.

Screenshot 2021-09-30 at 17 01 57

You can correct the header file by loading the file to matlab, then update the variable and save all the variables, for example, using the following lines in the Matlab's command window

load('sepia_header.mat');
TE = [TE1,TE2,TE3,TE4]; % depends on your data, e.g. 5 echoes -> 5 values
save('sepia_header.mat','voxelSize','matrixSize','CF','delta_TE','TE','B0_dir','B0');

Let me know if this can solve your issue.

Kwok

johnththomas commented 2 years ago

Cool, That makes sense! Thank you!