2014-09-20 38 views
2

我正在學習如何使用MATLAB腳本SENSE MRI重建,以及部分之一去如下:MATLAB:如何矢量化複共軛的積累?

% 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()),但是迄今爲止還沒有可實現的實現。

+3

'arrayfun'大約爲'for'高效循環,而不是更多 – 2014-09-20 19:29:01

回答

2

如果你乘以複共軛那麼它是一樣的真實。^ 2 +圖^ 2,因此一個簡單的辦法是

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