Hi Jane,
>
> I have been trying to generate fieldmap data from two sets of non-
> EPI phase
> and magnitude images, at a short and a long TE. However, after
> loading the
> images via the FieldMap GUI, setting the correct TEs, and pressing
> the
> Calculate button, I get the following error message:
>
> ??? Error using ==> sparse
> Index exceeds matrix dimensions.
>
> Error in ==> c:\spm\spm2\toolbox\FieldMap\pm_angvar.m
> On line 32 ==> MH = sparse(round((hs-1)*((imag(cmap(:))-
> mini)/(maxi-mini))
> +1),...
>
> Error in ==> c:\spm\spm2\toolbox\FieldMap\pm_unwrap.m
> On line 162 ==> angvar = pm_angvar(ci);
>
> Error in ==> c:\spm\spm2\toolbox\FieldMap\pm_make_fieldmap.m
> On line 156 ==> [fm.upm,angvar,fm.mask,fm.opm] = pm_unwrap
> (cmap,pxs,flags.method);
>
> Error in ==> c:\spm\spm2\toolbox\FieldMap\FieldMap.m
> On line 1257 ==> IP.fm = pm_make_fieldmap([IP.P{1}
> IP.P{2} IP.P
> {3} IP.P{4}],IP.uflags);
>
> Error in ==> c:\spm\spm2\toolbox\FieldMap\FieldMap.m
> On line 557 ==> status=FieldMap('CreateFieldMap',IP);
>
I have not come across this before. Maybe Chloe has, and in that case maybe she can help you.
If not, how are you with Matlab? Maybe you could help me by starting matlab, starting SPM then typing
dbstop at 32 in pm_angvar
at the Matlab prompt. Then launch Fieldmap and do what you did before til you come to the point where it used to crash. You will know, for the Matlab prompt will change from its usual >> to
K>>
There at the K>> prompt type
max(round((hs-1)*((imag(cmap(:))-mini)/(maxi-mini))+1))
Note the number it returns. It will be something like ~250
Then also type, one after the other
min(round((hs-1)*((imag(cmap(:))-mini)/(maxi-mini))+1))
max( round((hs-1)*((real(cmap(:))-minr)/(maxr-minr))+1))
min( round((hs-1)*((real(cmap(:))-minr)/(maxr-minr))+1))
If any of these gives a value < 1 or > 255, then type, one after the other
max(imag(cmap(:)))
min(imag(cmap(:)))
mini
maxi
max(real(cmap(:)))
min(real(cmap(:)))
minr
maxr
note the results and send them to me.
I'm sorry I'm putting the burden of debugging on you. Just see it as doing a little community service.
Good luck Jesper
|