I want to perform a task on each 2D of a 3D array but I am having difficulties in concatenating the 2Ds into a 3D array again. What I am getting is the result of only the last 2D array in the 3D array. I have a 1024x600x10, I want to perform a task on (:,:,1),….(:,:,10) and get them back into 3D array. Thanks in advance.
This is the code I wrote:
noisy_C_scan= noisy_C_scan(:,:,:);% This is the 3D array
for n=1:10 [no_a_scan_pixels,no_a_scans] = size(noisy_C_scan(:,:,n)); N=no_a_scan_pixels; % % %% High Pass Filter window % %
LPFwin_s=gausswin(no_a_scan_pixels,2); LPFwin=fftshift(LPFwin_s); HPFwin_s=1./LPFwin_s; HPFwin=fftshift(HPFwin_s); %
% %% Space-domain OCT image (Low pass filtered d2f data)
% k2F = noisy_C_scan(:,:,n).*repmat(HPFwin,1,no_a_scans); % LPFwin
%% end j=sqrt(-1); n=0 : 1 :N-1; k=calib_interpolation( 100000 ); kmin=min(k); kmax=max(k);% kmin=min(k);
delta_k=kmax-kmin; k= (k-kmin)./ (delta_k); k=k.*N; nk=k'*n; DFTmtx=exp (-j*2*pi*nk/N); % %% DFT
non_uniform_FFT= DFTmtx* k2F;% This is a 2D array after each iteration.
non_uniform_FFt= cat(3,non_uniform_FFT,non_uniform_FFT); % I intend to get (:,:,:) array
end
Best Answer