MATLAB:如何对复杂共轭的积累进行矢量化?

时间:2014-09-20 18:51:00

标签: matlab vectorization

我正在学习如何使用MATLAB脚本进行SENSE MRI重建,其中一节如下:

% Form high-res brain image by combining the image data from all coil
% channels.  This is done by multiplying each channel image elementwise by
% its complex conjugate, accumulating into the high-res image, and taking
% the square root of the result (since multplying by a complex conjugate
% results in obtaining the square of the real part)

for k = 1:nchannels
    Image_E = Image_E + Img(:, :, k).*conj(Img(:, :, k));
end
Image_E = sqrt(Image_E);

Img是256x256x8数组,其中第三维由"堆栈组成"八个复值脑图像。 Image_E的每个像素是Img堆栈中8个图像中每个图像的相应像素的绝对值的l-2范数。

我怀疑有一种更有效的矢量化方式来实现上面执行的例程(可能使用arrayfun())但到目前为止还没有可靠的实现。

1 个答案:

答案 0 :(得分:2)

如果你乘以复共轭,则它与Real相同。^ 2 + Img。^ 2,因此更简单的方法是

Image_E=sqrt(sum(real(Img).^2+imag(Img).^2,3))