Skip to content
afunction.pro 3.71 KiB
Newer Older
Laura Schreiber's avatar
Laura Schreiber committed
function afunction, X, TF
; afunction - Implements the blurring linear operator via FFT
;   This function applies the blurring operator A to the
;   reconstruction x of the unknown object in the Fourier space, by
;   componentwise multiplication of the two FFTs and then by transforming
;   back the result by an IFFT.
;
; SYNOPSIS
;   out = afunction(x, TF)
;
; INPUT
;   x          (double)        - reconstruction
;   TF         (dcomplex)      - Fourier transform of the blurring operator A
;
; OUTPUT
;   out        (double)        - vectorized blurred version of x
;
; ------------------------------------------------------------------------------
;
; This software is developed within the research project
;
;        PRISMA - Optimization methods and software for inverse problems
;                           http://www.unife.it/prisma
;
; funded by the Italian Ministry for University and Research (MIUR), under
; the PRIN2008 initiative, grant n. 2008T5KA4L, 2010-2012. This software is
; part of the package "IRMA - Image Reconstruction in Microscopy and Astronomy"
; currently under development within the PRISMA project.
;
; Version: 1.0
; Date:    July 2011

; Authors:
;   Roberto Cavicchioli, Marco Prato, Luca Zanni
;    Dept. of Pure Appl. Math., Univ. of Modena and Reggio Emilia, Italy
;    roberto.cavicchioli@unimore.it, marco.prato@unimore.it, luca.zanni@unimore.it
;   Mario Bertero, Patrizia Boccacci
;    DISI (Dipartimento di Informatica e Scienze dell'Informazione), University of Genova, Italy
;    bertero@disi.unige.it, boccacci@disi.unige.it
;
; Software homepage: http://www.unife.it/prisma/software
;
; Copyright (C) 2011 by M. Bertero, P. Boccacci, R. Cavicchioli, M. Prato, L. Zanni.
; ------------------------------------------------------------------------------
; COPYRIGHT NOTIFICATION
;
; Permission to copy and modify this software and its documentation for
; internal research use is granted, provided that this notice is retained
; thereon and on all copies or modifications. The authors and their
; respective Universities makes no representations as to the suitability
; and operability of this software for any purpose. It is provided "as is"
; without express or implied warranty. Use of this software for commercial
; purposes is expressly prohibited without contacting the authors.
;
; This program is free software; you can redistribute it and/or modify it
; under the terms of the GNU General Public License as published by the
; Free Software Foundation; either version 3 of the License, or (at your
; option) any later version.
;
; This program is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; See the GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, either visite http://www.gnu.org/licenses/
; or write to
; Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; ==============================================================================

dimTF = size(TF,/dimensions)
if (n_elements(dimTF) eq 2) then dimTF = [dimTF,1]
dimX = size(X,/dimensions)
out = dblarr(dimTF)
if (n_elements(dimX) gt 2) then begin
	 for i = 0, dimTF[2]-1 do begin
		 out[*,*,i] = real_part(fft(reform(TF[*,*,i])*fft(reform(X[*,*,i])),/inverse))
	 endfor
endif else begin
     x_t = fft(X)
	 for i = 0, dimTF[2]-1 do begin
 		 out[*,*,i] = real_part(fft(reform(TF[*,*,i])*x_t,/inverse))
	 endfor
endelse
return, out

END
; ==============================================================================
; End of afunction.pro file - IRMA package
; ==============================================================================