Problem with detrending

Dear Experts

I'm trying to detrend a set of rest images using rest toolkit,however, the following error occurs:

Exception occured.    (MATLAB:nonExistentField)
    Reference to non-existent field 'mat'.
    60#line,        rest_Write4DNIfTI,    in "C:\Program Files\MATLAB\REST_V1.8_130615\rest_Write4DNIfTI.m"
    117#line,        rest_detrend,    in "C:\Program Files\MATLAB\REST_V1.8_130615\rest_detrend.m"
    789#line,        Detrend,    in "C:\Program Files\MATLAB\REST_V1.8_130615\rest_gca_gui.m"
    771#line,        btnDetrend_Callback,    in "C:\Program Files\MATLAB\REST_V1.8_130615\rest_gca_gui.m"
    95#line,        gui_mainfcn,    in "C:\Program Files\MATLAB\R2014a\toolbox\matlab\guide\gui_mainfcn.m"
    39#line,        rest_gca_gui,    in "C:\Program Files\MATLAB\REST_V1.8_130615\rest_gca_gui.m"
    0#line,        @(hObject,eventdata)rest_gca_gui('btnDetrend_Callback',hObject,eventdata,guidata(hObject))

Any idea what's wrong?
Many thanks in advance.

Best,
mahsa

 your data format may be wrong. Maybe the nifti image you entered into REST are imported from other software or other formats. It says in the header of your data, there is no "mat" information, which should exist in "normal" nifti data.