0

I have a low-resolution image (sLR) which is generated by selecting the central part of the reference high-resolution image (sHR) in the frequency (k-space) domain in row-direction. When I zero-pad this low-resolution image in frequency-domain, I get ringing artifact in the spatial domain as it is expected. I try to remove this artifact by filtering the image using Hamming window. Please see my code below. I have doubts about applying fft and ifft to the image and also filtering process, and I would be thankful if someone could please review my code and confirm it is correct.

% sHR: HR reference image
n = size(sHR,1);
kspHR = fftshift(fft(sHR,n,1),1)/n; % HR image in k-space

% Generating LR image (LR in row-direction)
kspLR = kspHR((n/2)-(n/4)+1:(n/2)+(n/4),:); 
sLR = real(ifft(ifftshift(kspLR,1),n,1)))*n; 

% Zero-padding
a = floor(size(kspLR,1)/2);
kspZP = padarray(kspLR, a ,'both');
sZP = real(ifft(ifftshift(kspZP,1),n,1)))*n;% image with Ringing artifact

% Apply Hamming filter to Zero-padded kspace image (kspZP)
[r,c]=size(abs(kspZP));
w = hamming(r);
W = repmat(w,[1,c]);
kspHM = W.*kspZP
sHM = real(ifft(ifftshift(kspHM,1),n,1)))*n; % Filtered image in spatial domain

My second question is when I use iffft, the output image usually has negative intensities. For further processing in the Spatial domain, is that okay if I normalize the image intensity in a way that the minimum intensity of the image is 0? or should I use the absolute of the image?

SaraG
  • 179
  • 2
  • 11

1 Answers1

2
  1. This is not a standard use of a Hamming window, but being a sort of Gaussian shape it might help. Try applying the window (or some other frequency response) instead of clipping out the central part of the spectrum, or fit it into the central part. Othewrwise, the sharp cutoff will remain, and so will the ringing.

  2. I'd suggest clipping those negative values to zero using max(0,..., since they represent ringing that you don't want. Maybe also clip unexpectedly large values to 1.

NickJH
  • 561
  • 3
  • 7
  • Thank you for your respose @NickJH. Do you mean I should use a window like this: [r,c]=size(abs(kspZP)); w = hamming(r/2); w = padarray(w, a ,'both'); W = repmat(w,[1,c]); and apply this W to my kspZP? – SaraG Nov 07 '17 at 17:18
  • 1
    Yes, or multiply kspLR by the widow function before padding (which is equivalent, I think). That will be more blurry but should have less ringing. Different shapes and sizes of frequency-domain mask will have different filtering effects. – NickJH Nov 07 '17 at 18:36
  • 1
    By the way, I'm guessing you need sLR for some other purpose and that it really does need a sharp cutoff in frequency; otherwise there are simpler ways to blur an image in one axis. – NickJH Nov 07 '17 at 19:03