It's because each time you run imcalc, it expects to output a single
volume of data. This is not the case here.
The use of the data matrix is to enable linear combinations of the
images (or some simple function of the images) to be computed, either
by using eg 'sum(X)' or '[w1 w2 w3 w4 ..]*X'. To obtain a contrast
image, the weights would be generated by w = c/A, where c is the
contrast vector and A is the design matrix.
Best regards,
-John
On 18 October 2011 18:33, Uenal <[log in to unmask]> wrote:
> Hi,
>
> I am wondering whether anyone had similar issues below with imcalc in datamatrix mode and I'd appreciate any help and suggestions...
>
> I am trying to use imcalc (SPM8) in order to read my 3D .img volumes in the data matrix (X) and then operate on X; however it is giving errors even if I want to make simple operations such as 2*X. All 948 images have the same dimension and orientations since they are normalized. I also played with different masking options but no luck.
> Here is the error, I get:
>
>>SPM8: spm_imcalc_ui (v3691) 12:08:33 - 18/10/2011
>>========================================================================
>>Failed 'Image Calculator'
>>Error using ==> spm_imcalc at 103
>>"2*X" produced incompatible image.
>>In file "C:\spm8\spm8\spm_imcalc.m" (v1143), function "spm_imcalc" at line 103.
>>In file "C:\spm8\spm8\spm_imcalc_ui.m" (v3691), function "spm_imcalc_ui" at line 159.
>>In file "C:\spm8\spm8\config\spm_cfg_imcalc.m" (v3736), function "my_spm_imcalc_ui" at line 174.
>>
>>The following modules did not run:
>>Failed: Image Calculator
>
> And here is the line 103 of spm_imcalc:
>
> if prod(Vo.dim(1:2)) ~= numel(Yp),
> error(['"',f,'" produced incompatible image.']);
> end
> When I check this, Vo.dim(1)=53 and Vo.dim(2)=63. However, numel(Yp)=3165372 (=53*63*46*948). So it is complaining that they are not matching.
>
> I understand that this is because imalc seems to try calculations plane by plane and trying to write one single img file; is that right? Is it not possible to use imcalc to operate on images and write out a big 4D file or prefixed 3D img volumes instead of one single 3D img volume?
>
> Thanks,
>
> ..
> Unal
>
|