1
$\begingroup$

I am trying to apply windowing to do MRI reconstruction. I have a 256 point one dimensional k-space samples which look as follows:

enter image description here

Here, the real part(green) is flat around 0 and the blue curve is the imaginary part. Now, what I would like to do is perform some apodization. For this, I construct a hanning window as follows:

from scipy import signal

win = signal.hann(256)
# sig is the 
sig = signal.convolve(sig, win, mode='same') / sum(win)

The hanning window is the same size as the k-space vector (256). Next, I convolved the k-space signal with the hanning window, which looks like:

enter image description here

Next, I performed the inverse fft to reconstruct the image (which should have near uniform intensity everywhere) using:

from scipy import fftpack

rec = np.abs(fftpack.ifftshift(fftpack.ifftn(sig)))

This results in the recon image as:

enter image description here

I feel I have done something wrong as I was expecting to have a fairly uniform image rather than a spike. Do I need to do something post reconstruction to account for the fact that I have performed some windowing before the reconstruction?

$\endgroup$
2
  • 1
    $\begingroup$ You say real part(green) is flat around 0 and the blue curve is the imaginary part. but the legend on the graph says the opposite: the blue is the real part and the green is the imaginary part. Which is it? $\endgroup$
    – Peter K.
    Jun 20, 2016 at 19:34
  • $\begingroup$ Ah damn. Sorry, I messed up the legends! $\endgroup$
    – Luca
    Jun 20, 2016 at 19:53

1 Answer 1

2
$\begingroup$

You say:

  • I have a 128 point one dimensional k-space samples...
  • The hanning window is the same size as the k-space vector (256)...

Make sure that you have the appropriate sizes in your algorithm.

  • Next, I convolved the k-space signal with the hanning window...

Windowing is applied in $k$-space by multiplication - you simply have to multiply your window and the original $k$-space line. In image space, this is a convolution, hence you could take the Fourier Transform of the window function and convolve the image with it.

Another view: Apodization is applied to suppresses certain frequencies. For example, the highest frequencies are simply skipped by setting them to 0 due to the multiplication of the window function and the $k$-space data. If you were to convolve the two, you would "spill" the information of the higher frequencies all over $k$-space - which certainly is not what you want to achieve by apodization.

$\endgroup$
6
  • $\begingroup$ Agreed! Instead of doing sig = signal.convolve(sig, win, mode='same') / sum(win) the OP should be doing sig = numpy.multiply(sig, win) -- with or without normalization by the sum. $\endgroup$
    – Peter K.
    Jun 20, 2016 at 19:38
  • $\begingroup$ Thanks for the reply and the catch on the 256-128 confusion. I had changed it at some point and forgot to amend the post everywhere. My question is should the fourier transform of the window function not be used for the multiplication then with the k-space signal? Considering that the convolution in image space should be multiplication in k-space and vice versa? $\endgroup$
    – Luca
    Jun 20, 2016 at 19:55
  • $\begingroup$ Ok, my last comment makes no sense on retrospection. However, after I do this apodization, do I not need to divide the reconstructed time domain image with the FT of the window? $\endgroup$
    – Luca
    Jun 20, 2016 at 20:27
  • 1
    $\begingroup$ No, you do not need this division. You do the multiplication in $k$-space, inverse-FT the modified $k$-space back to the image domain and you are done. $\endgroup$
    – M529
    Jun 20, 2016 at 21:05
  • 1
    $\begingroup$ @Luca The effect of the windowing is something that you want - why would you "correct" for it in image space afterwards? You want to smooth out some higher frequencies. You can do this in $k$-space by multiplying the window function or convolving the Fourier Transform of the window function and the image in image space. For further insight, look up an example on blurring an image with a Gaussian Kernel by convolution and the relationship to the FFT. The theory behind that and your application is the same. $\endgroup$
    – M529
    Jun 21, 2016 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.