Hi Wei,
I got the same error message but maybe because I'm using version 2.1 of Fieldmap toolbox, I don't see the lines of codes Bruno listed below. However, similar to what Bruno found, tracking back from the error, the following line seems to be what's causing the error:
[ii,jj,nn,pp] = pm_create_connectogram(irima,opm);
After calling pm_create_connectogram(irima,opm), none of the parameters ii,jj,nn and pp had a value. This subroutine calls a compiled c program (pm_create_connectogram_dtj.c), which made it impossible for me to further debug without the appropriate c compiler. I've tried on both a 64-bit and a 32-bit windows PC, neither of the mex files worked.
Any other idea?
-Wei
------------------------------------------------------------------------------------------
Re: Field Map Toolbox with Philips images
From:
"Bruno L. Giordano" <[log in to unmask]>
Well,
I actually might have found the problem. Comments welcome.
The call that leads to the error:
upm = pm_merge_regions(opm,irima,ii,jj,nn,pp,rs);
gives in input some empty variables (all of them exception done for opm
and irima).
The empty variables are created by the call to:
[ii,jj,nn,pp] = pm_create_connectogram(irima,opm);
So something might be wrong with what is fed in input to
pm_create_connectogram (irima,opm).
One finds just before the call to this last function a bug fix:
% Added this little bug fix which prevents pm_merge_regions crashing
% because it has too many regions to merge.
while cn>1800 & nstep > 2
nstep=nstep-1;
[irima,cn] = pm_initial_regions(opm,mask,nstep);
end
Commenting out the bug fix actually appears to solve the problem :-)
Bruno
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bruno L. Giordano, PhD
Erasmus Mundus - ACN postdoc @
Voice Neurocognition Laboratory (CCNi, Glasgow Univ) &
Affiliate member of Music Research Dept. (McGill Univ, Montréal)
URL: http://www.brunolgiordano.net
On 01/12/2011 6:27 PM, Bruno L. Giordano wrote:
> Might actually be a good idea to include the original message ;-)
>
> Again: I am getting exactly this error. Did you find the cause? Does
> some kind soul have a suggestion?
>
> Following John's suggestion
> (https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;d777bd89.0802), I
> commented these lines of code to handle another problem.
>
> elseif any(any(diff(ip_mat,1,1),1))
> errordlg({'Images don''t all have same orientation & voxel size'});
> drawnow;
> varargout{1}=[];
>
> Might that be the cause?
>
> Cheers,
>
> Bruno
>
> On 04/11/2011 4:50 PM, Vayssiere Nathalie wrote:
>> Hi,
>> I try to use the field map toolbox with B0MAp acquired on a philips
>> scanner. I load my images of phase and amplitude and
>> I obtain the following error message when I do calculate:
>>
>> ?? Error using ==> pm_merge_regions
>> pm_merge_regions: i must be a column matrix
>>
>> Error in ==> pm_unwrap at 223
>> upm = pm_merge_regions(opm,irima,ii,jj,nn,pp,rs);
>>
>> Error in ==> pm_make_fieldmap at 166
>> [fm.upm,angvar,fm.mask,fm.opm] = pm_unwrap(cmap,pxs,flags.method);
>>
>> Error in ==> FieldMap at 1623
>> IP.fm = pm_make_fieldmap([IP.P{1} IP.P{2} IP.P{3}
>> IP.P{4}],IP.uflags);
>>
>> Error in ==> FieldMap at 699
>> status=FieldMap('CreateFieldMap',IP);
>>
>> ??? Error while evaluating uicontrol Callback
>>
>> Has someone an idea of what is wrong with my images???
>>
>> Thank you very much for your help
>>
>> Nathalie