Xmipp  v3.23.11-Nereus
movie_filter_dose.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Roberto Marabini roberto@cnb.csic.es
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 /* This program is strongly based on the umblur code
26  * (http://grigoriefflab.janelia.org/unblur)
27 which has been realeased under the following copyright:
28 
29 The Janelia Farm Research Campus Software Copyright 1.1
30 
31 Copyright (c) 2014, Howard Hughes Medical Institute, All rights reserved.
32 
33 Redistribution and use in source and binary forms, with or without
34 modification, are permitted provided that the following conditions are met:
35 
36 
37 Redistributions of source code must retain the above copyright notice,
38  this list of conditions and the following disclaimer.
39 Redistributions in binary form must reproduce the above copyright notice,
40 this list of conditions and the following disclaimer in the documentation
41 and/or other materials provided with the distribution.
42 Neither the name of the Howard Hughes Medical Institute nor the names of
43 its contributors may be used to endorse or promote products derived from
44 this software without specific prior written permission.
45 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
46 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ANY
47 IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR A
48 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
49 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
50 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
51 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
52 REASONABLE ROYALTIES; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
55 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
56 */
57 #ifndef _PROG_MOVIE_FILTER_DOSE
58 #define _PROG_MOVIE_FILTER_DOSE
59 
60 #include <complex>
61 #include "core/xmipp_program.h"
62 #include "core/xmipp_filename.h"
63 
64 template<typename T>
65 class MultidimArray;
66 
70 
73 {
74 public:
75 
80 
82 
87 
90 
93 
97 
99  double pixel_size;
100 
102  double maxFreq;
103 
104 
107 
108  // Fourier transforms of the input images
109  std::vector< MultidimArray<std::complex<double> > * > frameFourierVec;
110 
111 public:
113  void readParams();
114 
116  void show();
117 
119  void defineParams();
120 
122  void run();
123 
125  ProgMovieFilterDose(double accelerationVoltage);
126  ProgMovieFilterDose(void);
127  void init(void);
128  void initVoltage(double accelerationVoltage);
129 
131  // factor due to radiation damage (as used by summovie)
132  double doseFilter(double dose_at_end_of_frame, double critical_dose);
133 
135  double criticalDose(double spatial_frequency);
136 
137 
139  double optimalDoseGivenCriticalDose(double critical_dose);
140 
143  int Ydim, int Xdim,
144  const MultidimArray< std::complex<double> > &FFT1,
145  const double dose_start, const double dose_finish
146  );
147 
148 };
150 #endif
FileName user_supplied_input_filename
void applyDoseFilterToImage(int Ydim, int Xdim, const MultidimArray< std::complex< double > > &FFT1, const double dose_start, const double dose_finish)
Apply a dose filter to the image Fourier transform.
double criticalDose(double spatial_frequency)
Given a spatial frequency, return the critical dose in electrons per square Angstroms.
double optimalDoseGivenCriticalDose(double critical_dose)
Given the critical dose, return an estimate of the optimal dose (at which the SNR is maximised) ...
void initVoltage(double accelerationVoltage)
std::vector< MultidimArray< std::complex< double > > *> frameFourierVec
FileName user_supplied_output_filename
bool restore_power
Restore noise power after filtering?&#39;, &#39;Renormalise the summed image after filtering.
void defineParams()
Define parameters.
void readParams()
Read argument from command line.
double doseFilter(double dose_at_end_of_frame, double critical_dose)
Compute the dose filter, which is the signal attenuation.