Error using ==> eq Matrix dimensions must agree.

Submitted by dominic on
Dear REST developers,

I'm trialling the REST program using a single subject and specifying a voxel wise ROI. Each time I try to view the ROI as outlined in the manual or run the analysis it produces this error: 

Exception occured.    (MATLAB:dimagree)
    Error using ==> eq
Matrix dimensions must agree.
    81#line,        rest_writefile,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_writefile.m"
    112#line,        rest_SphereROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SphereROI.m"
    264#line,        ViewROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_misc.m"
    187#line,        rest_misc,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_misc.m"
    166#line,        rest_SetROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SetROI.m"
    62#line,        uiwait,    in "/usr/local/matlab/toolbox/matlab/uitools/uiwait.m"
    48#line,        rest_SetROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SetROI.m"
    1222#line,        btnROIVoxelWise_Callback,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/fc_gui.m"
    95#line,        gui_mainfcn,    in "/usr/local/matlab/toolbox/matlab/guide/gui_mainfcn.m"
    35#line,        fc_gui,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/fc_gui.m"

Our data is pre-processed using SPM5 with the following characteristics: TR=1.4, 510 volumes, 3mm iso, 8mm FWHM. I have converted these images from nifti format (with header included) to analyze 4D format as outlined in some of the posts.

To exclude the possibility that the error is occurring due to a default mask specification problem as raised in a previous post by "yuki" I have tried inputing the single subjects EPI as the mask option as well as the brain map option. This returns the same error.

Any help or advice would be greatly appreciated.

Thank you,

Dominic


 

YAN Chao-Gan

Thu, 10/15/2009 - 13:06

Hi!
Please revise
if (dtype=='single')
to
if strcmp(dtype,'single')
in rest_writefile.m

By the way, the manual is for REST v1.1, so some steps are changed in REST v1.2 or later release. For example, you do not need to convert the NIfTI images to ANALYZE images with REST v1.2 or later release.
We are trying to update the manual. Currently you can refer to a multimedia course (http://www.restfmri.net/forum/Course) to get more information.

Dear REST developers,

Thank you for your reply. I have updated the .m file as specified. There is now another error message.


When viewing the voxel based ROI the following error occurs when using nifti (3D/4D) and analyze images as the brain map. Other posts have indicated that this problem is associated with Matlab 2009. I am using Matlab 2007 so I don't know why it is still occurring.

Many thanks for your help.

Dominic

Seed ROI Definition: ROI Center(mm)=(0, -50, 30); Radius=5.00 mm.
            Brain Size: (53  63  46),        Voxel Size: (3  3  3),        Origin: (27  38  18)
            Contained Voxel count: 19


Exception occured.    ()
    Error using ==> rest_WriteNiftiImage at 92
Meet error while writing the data
    92#line,        rest_WriteNiftiImage,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_WriteNiftiImage.m"
    79#line,        rest_writefile,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_writefile.m"
    112#line,        rest_SphereROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SphereROI.m"
    264#line,        ViewROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_misc.m"
    187#line,        rest_misc,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_misc.m"
    166#line,        rest_SetROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SetROI.m"
    62#line,        uiwait,    in "/usr/local/matlab/toolbox/matlab/uitools/uiwait.m"
    48#line,        rest_SetROI,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/rest_SetROI.m"
    1222#line,        btnROIVoxelWise_Callback,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/fc_gui.m"
    95#line,        gui_mainfcn,    in "/usr/local/matlab/toolbox/matlab/guide/gui_mainfcn.m"
    35#line,        fc_gui,    in "/usr/local/matlab/toolbox/spm5/toolbox/REST2007V1.3_090525/fc_gui.m"

 

 

sophiaatkinss

Mon, 03/22/2010 - 07:04

Hello, Sophia here, I am a student of ccda and obtained a simple board search to find your site. I feel really nice to read especially in this article. It is very informative. All articles on your website are very informative and increase knowledge of many. However, this site plays a very important role in improving our new generation for the good work ....
Forums