EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
EMAN::nn4_ctfwsReconstructor Class Reference

nn4_ctfws Direct Fourier Weighted Inversion Reconstructor for sorting More...

#include <reconstructor.h>

Inheritance diagram for EMAN::nn4_ctfwsReconstructor:
Inheritance graph
[legend]
Collaboration diagram for EMAN::nn4_ctfwsReconstructor:
Collaboration graph
[legend]

Public Member Functions

 nn4_ctfwsReconstructor ()
 
 nn4_ctfwsReconstructor (const string &symmetry, int size, int npad, float snr, int sign, int do_ctf)
 
virtual ~nn4_ctfwsReconstructor ()
 
virtual void setup ()
 Initialize the reconstructor. More...
 
virtual int insert_slice (const EMData *const slice, const Transform &euler, const float weight)
 Insert a slice into a 3D volume, in a given orientation. More...
 
virtual EMDatafinish (bool compensate=true)
 Finish reconstruction and return the complete model. More...
 
virtual string get_name () const
 Get the unique name of this class (especially for factory based instantiation access) More...
 
virtual string get_desc () const
 Get a clear, concise description of this class. More...
 
TypeDict get_param_types () const
 
void setup (const string &symmetry, int size, int npad, float snr, int sign, int do_ctf)
 
int insert_padfft_slice_weighted (EMData *padfft, EMData *ctf2d2, vector< float > bckgnoise, const Transform &trans, const float weight)
 
- Public Member Functions inherited from EMAN::Reconstructor
 Reconstructor ()
 
virtual ~Reconstructor ()
 
virtual void setup_seed (EMData *seed, float seed_weight)
 Initialize the reconstructor with a seed volume. More...
 
virtual void setup_seedandweights (EMData *seed, EMData *weight)
 Initialize the reconstructor with a seed volume, as above. More...
 
virtual EMDatapreprocess_slice (const EMData *const slice, const Transform &t=Transform())
 While you can just insert unprocessed slices, if you call preprocess_slice yourself, and insert the returned slice instead, repeatedly, it can save a fair bit of computation. More...
 
int insert_slice (const EMData *const slice, const Transform &euler)
 
virtual int determine_slice_agreement (EMData *slice, const Transform &euler, const float weight=1.0, bool sub=true)
 Compares a slice to the current reconstruction volume and computes a normalization factor and quality. More...
 
virtual EMDataprojection (const Transform &euler, int ret_fourier=1)
 This will create a projection from the current reconstruction. More...
 
virtual void clear ()
 set the volume and tmp_volume data to zero, for use in Monte Carlo reconstructors More...
 
void print_params () const
 Print the current parameters to std::out. More...
 
EMObjectoperator[] (const string &key)
 
- Public Member Functions inherited from EMAN::FactoryBase
 FactoryBase ()
 
virtual ~FactoryBase ()
 
Dict get_params () const
 get a copy of the parameters of this class More...
 
void set_params (const Dict &new_params)
 Set new parameters. More...
 
void set_param (const string key, const EMObject val)
 
void insert_params (const Dict &new_params)
 Insert parameters. More...
 
Dict copy_relevant_params (const FactoryBase *const that) const
 

Static Public Member Functions

static ReconstructorNEW ()
 

Static Public Attributes

static const string NAME = "nn4_ctfws"
 

Private Member Functions

void buildFFTVolume ()
 
void buildNormVolume ()
 

Private Attributes

EMDatam_volume
 
EMDatam_wptr
 
EMDatam_refvol
 
int m_vnx
 
int m_vny
 
int m_vnz
 
int m_vnzp
 
int m_vnyp
 
int m_vnxp
 
int m_vnxc
 
int m_vnyc
 
int m_vnzc
 
int m_npad
 
int m_sign
 
int m_varsnr
 
int m_weighting
 
float m_wghta
 
float m_wghtb
 
float m_snr
 
string m_symmetry
 
int m_nsym
 
int m_do_ctf
 

Additional Inherited Members

- Protected Attributes inherited from EMAN::FactoryBase
Dict params
 This is the dictionary the stores the parameters of the object. More...
 

Detailed Description

nn4_ctfws Direct Fourier Weighted Inversion Reconstructor for sorting

Definition at line 1459 of file reconstructor.h.

Constructor & Destructor Documentation

◆ nn4_ctfwsReconstructor() [1/2]

nn4_ctfwsReconstructor::nn4_ctfwsReconstructor ( )

Definition at line 5073 of file reconstructor.cpp.

5074{
5075 m_volume = NULL;
5076 m_wptr = NULL;
5077}

References m_volume, and m_wptr.

Referenced by NEW().

◆ nn4_ctfwsReconstructor() [2/2]

nn4_ctfwsReconstructor::nn4_ctfwsReconstructor ( const string &  symmetry,
int  size,
int  npad,
float  snr,
int  sign,
int  do_ctf 
)

Definition at line 5079 of file reconstructor.cpp.

5080{
5081 setup( symmetry, size, npad, snr, sign, do_ctf );
5082}
virtual void setup()
Initialize the reconstructor.

References setup().

◆ ~nn4_ctfwsReconstructor()

nn4_ctfwsReconstructor::~nn4_ctfwsReconstructor ( )
virtual

Definition at line 5084 of file reconstructor.cpp.

5085{
5087
5088 //if( m_delete_weight ) checked_delete( m_wptr );
5089
5090 //checked_delete( m_result );
5091}

Member Function Documentation

◆ buildFFTVolume()

void nn4_ctfwsReconstructor::buildFFTVolume ( )
private

Definition at line 5147 of file reconstructor.cpp.

5147 {
5148 int offset = 2 - m_vnxp%2;
5149
5150 m_volume = params["fftvol"];
5151 m_volume->get_data();
5152 /*
5153 if (m_npad ==0) m_npad = m_volume->get_attr("npad");
5154 else {
5155 int tmp_npad = m_volume->get_attr("npad");
5156 if (m_npad != tmp_npad) m_npad = m_volume->get_attr("npad");
5157 }
5158 */
5159 if ( m_vnxp % 2 == 0 ) m_volume->set_fftodd(0);
5160 else m_volume->set_fftodd(1);
5161 m_volume->set_complex(true);
5162 m_volume->set_ri(true);
5163 m_volume->set_fftpad(true);
5164 m_volume->set_array_offsets(0,1,1);
5165
5166/*
5167 if( m_volume->get_xsize() != m_vnxp+offset && m_volume->get_ysize() != m_vnyp && m_volume->get_zsize() != m_vnzp ) {
5168 m_volume->set_size(m_vnxp+offset,m_vnyp,m_vnzp);
5169 m_volume->to_zero();
5170 }
5171
5172 if ( m_vnxp % 2 == 0 ) m_volume->set_fftodd(0);
5173 else m_volume->set_fftodd(1);
5174 m_volume->set_nxc(m_vnxp/2);
5175 m_volume->set_complex(true);
5176 m_volume->set_ri(true);
5177 m_volume->set_fftpad(true);
5178 m_volume->set_attr("npad", m_npad);
5179 m_volume->set_array_offsets(0,1,1);
5180
5181 */
5182}
Dict params
This is the dictionary the stores the parameters of the object.
Definition: emobject.h:953

References m_vnxp, m_volume, and EMAN::FactoryBase::params.

Referenced by setup().

◆ buildNormVolume()

void nn4_ctfwsReconstructor::buildNormVolume ( )
private

Definition at line 5184 of file reconstructor.cpp.

5185{
5186 m_wptr = params["weight"];
5187 m_wptr->get_data();
5188 m_wptr->set_array_offsets(0,1,1);
5189/*
5190 if( m_wptr->get_xsize() != m_vnxc+1 && m_wptr->get_ysize() != m_vnyp && m_wptr->get_zsize() != m_vnzp ) {
5191 m_wptr->set_size(m_vnxc+1,m_vnyp,m_vnzp);
5192 m_wptr->to_zero();
5193 }
5194
5195 m_wptr->set_array_offsets(0,1,1);
5196*/
5197}

References m_wptr, and EMAN::FactoryBase::params.

Referenced by setup().

◆ finish()

EMData * nn4_ctfwsReconstructor::finish ( bool  doift = true)
virtual

Finish reconstruction and return the complete model.

Parameters
doiftA flag indicating whether the returned object should be guaranteed to be in real-space (true) or should be left in whatever space the reconstructor generated
Returns
The result 3D model.

Reimplemented from EMAN::Reconstructor.

Definition at line 5286 of file reconstructor.cpp.

5287{
5288 m_volume->set_array_offsets(0, 1, 1);
5289 m_wptr->set_array_offsets(0, 1, 1);
5290 m_refvol->set_array_offsets(0, 1, 1);
5291 if(m_volume->is_fftodd()) m_volume->symplane0_odd(m_wptr);
5292 else m_volume->symplane0_ctf(m_wptr);
5293 bool do_invert = false;
5294 bool refvol_present = (*m_refvol)(0) > 0.0f ;
5295 /*
5296 int box = 7;
5297 int vol = box*box*box;
5298 int kc = (box-1)/2;
5299 vector< float > pow_a( 3*kc+1, 1.0 );
5300 for( unsigned int i=1; i < pow_a.size(); ++i ) pow_a[i] = pow_a[i-1] * exp(m_wghta);
5301 pow_a[3*kc]=0.0;
5302
5303
5304 float max = max3d( kc, pow_a );
5305 float alpha = ( 1.0f - 1.0f/(float)vol ) / max;
5306 float osnr = 1.0f/m_snr;
5307 */
5308
5309
5310 int ix,iy,iz;
5311 // refvol carries fsc
5312 int limitres = m_vnyc-1;
5313 if( refvol_present ) { // If fsc is set to zero, it will be straightforward reconstruction with snr = 1
5314 for (ix = 0; ix < m_vnyc; ix++) {
5315 //cout<<" fsc "<< m_vnyc-ix-1 <<" "<<m_vnyc<<" "<<(*m_refvol)(m_vnyc-ix-1)<<endl;
5316 if( (*m_refvol)(m_vnyc-ix-1) == 0.0f ) limitres = m_vnyc-ix-2;
5317 }
5318 } else {
5319//cout<<" limitres "<<limitres<<endl;
5320
5321 vector<float> count(m_vnyc+1, 0.0f);
5322 vector<float> sigma2(m_vnyc+1, 0.0f);
5323
5324 // compute sigma2
5325 for (iz = 1; iz <= m_vnzp; iz++) {
5326 int izp = (iz<=m_vnzc) ? iz - 1 : iz-m_vnzp-1;
5327 float argz = float(izp*izp);
5328 for (iy = 1; iy <= m_vnyp; iy++) {
5329 int iyp = (iy<=m_vnyc) ? iy - 1 : iy-m_vnyp-1;
5330 float argy = argz + float(iyp*iyp);
5331 for (ix = 0; ix <= m_vnxc; ix++) {
5332 if(ix>0 || (izp>=0 && (iyp>=0 || izp!=0))) { //Skip Friedel related values
5333 float r = std::sqrt(argy + float(ix*ix));
5334 int ir = int(r);
5335 if (ir <= limitres) {
5336 float frac = r - float(ir);
5337 float qres = 1.0f - frac;
5338 float temp = (*m_wptr)(ix,iy,iz);
5339 //cout<<" WEIGHTS "<<jx<<" "<<jy<<" "<<ir<<" "<<temp<<" "<<frac<<endl;
5340 //cout<<" WEIGHTS "<<ix<<" "<<iy-1<<" "<<iz-1<<" "<<temp<<" "<<endl;
5341 sigma2[ir] += temp*qres;
5342 sigma2[ir+1] += temp*frac;
5343 count[ir] += qres;
5344 count[ir+1] += frac;
5345 }
5346 }
5347 }
5348 }
5349 }
5350 for (ix = 0; ix <= m_vnyc; ix++) {
5351 if( count[ix] > 0.0f ) (*m_refvol)(ix) = sigma2[ix]/count[ix];
5352 //cout<<" sigma2 "<< ix <<" "<<sigma2[ix]<<endl;
5353 }
5354 /*
5355 # This part will have to be done on python level.
5356 float fudge = m_refvol->get_attr("fudge");
5357 // now counter will serve to keep fsc-derived stuff
5358 for (ix = 0; ix <= limitres; ix++) count[ix] = fudge * sigma2[ix] * (1.0f - (*m_refvol)(ix))/(*m_refvol)(ix); //fudge?
5359 count[limitres+1] = count[limitres];
5360 //for (ix = 0; ix <= limitres+1; ix++) cout<<" tau2 "<< ix <<" "<<count[ix]<<endl;
5361 */
5362
5363 }
5364
5365
5366 // normalize
5367 float osnr = 0.0f;
5368 for (iz = 1; iz <= m_vnzp; iz++) {
5369 int izp = (iz<=m_vnzc) ? iz - 1 : iz-m_vnzp-1;
5370 float argz = float(izp*izp);
5371 for (iy = 1; iy <= m_vnyp; iy++) {
5372 int iyp = (iy<=m_vnyc) ? iy - 1 : iy-m_vnyp-1;
5373 float argy = argz + float(iyp*iyp);
5374 for (ix = 0; ix <= m_vnxc; ix++) {
5375 float r = std::sqrt(argy + float(ix*ix));
5376 int ir = int(r);
5377 if (ir <= limitres) {
5378 if ( (*m_wptr)(ix,iy,iz) > 0.0f) {
5379 if( refvol_present) {
5380 float frac = r - float(ir);
5381 float qres = 1.0f - frac;
5382 osnr = qres*(*m_refvol)(ir) + frac*(*m_refvol)(ir+1);
5383 //if(osnr == 0.0f) osnr = 1.0f/(0.001*(*m_wptr)(ix,iy,iz));
5384 //cout<<" "<<iz<<" "<<iy<<" "<<" "<<ix<<" "<<ir<<" "<<(*m_wptr)(ix,iy,iz)<<" "<<osnr<<" "<<(*m_volume)(2*ix,iy,iz)<<" "<<(*m_volume)(2*ix+1,iy,iz)<<endl;
5385 } else osnr = 0.0f;
5386
5387 float tmp = ((*m_wptr)(ix,iy,iz)+osnr);
5388
5389 if(do_invert){
5390 if(tmp>0.0f) {
5391 //cout<<" mvol "<<ix<<" "<<iy<<" "<<iz<<" "<<(*m_volume)(2*ix,iy,iz)<<" "<<(*m_volume)(2*ix+1,iy,iz)<<" "<<tmp<<" "<<osnr<<endl;
5392 (*m_volume)(2*ix,iy,iz) /= tmp;
5393 (*m_volume)(2*ix+1,iy,iz) /= tmp;
5394 } else {
5395 (*m_volume)(2*ix,iy,iz) = 0.0f;
5396 (*m_volume)(2*ix+1,iy,iz) = 0.0f;
5397 }
5398 } else (*m_wptr)(ix,iy,iz) = tmp;
5399 }
5400 } else {
5401 (*m_volume)(2*ix,iy,iz) = 0.0f;
5402 (*m_volume)(2*ix+1,iy,iz) = 0.0f;
5403 }
5404 }
5405 }
5406 }
5407
5408 if(do_invert) {
5409 m_volume->center_origin_fft();
5410 // back fft
5411 m_volume->do_ift_inplace();
5412 int npad = m_volume->get_attr("npad");
5413 m_volume->depad();
5414 if( compensate ) circumftrl( m_volume, npad );
5415 m_volume->set_array_offsets( 0, 0, 0 );
5416 }
5417
5418 return 0;
5419}
EMData * sqrt() const
return square root of current image
void circumftrl(EMData *win, int npad)

References circumftrl(), m_refvol, m_vnxc, m_vnyc, m_vnyp, m_vnzc, m_vnzp, m_volume, m_wptr, and sqrt().

◆ get_desc()

virtual string EMAN::nn4_ctfwsReconstructor::get_desc ( ) const
inlinevirtual

Get a clear, concise description of this class.

Returns
a clear, concise description of this class

Implements EMAN::FactoryBase.

Definition at line 1488 of file reconstructor.h.

1489 {
1490 return "Direct Fourier inversion reconstruction routine";
1491 }

◆ get_name()

virtual string EMAN::nn4_ctfwsReconstructor::get_name ( ) const
inlinevirtual

Get the unique name of this class (especially for factory based instantiation access)

Returns
the unique name of this class

Implements EMAN::FactoryBase.

Definition at line 1483 of file reconstructor.h.

1484 {
1485 return NAME;
1486 }
static const string NAME

References NAME.

◆ get_param_types()

TypeDict EMAN::nn4_ctfwsReconstructor::get_param_types ( ) const
inlinevirtual
Returns
a TypeDict defining and describing the feasible parameters of this class

Implements EMAN::FactoryBase.

Definition at line 1499 of file reconstructor.h.

1500 {
1501 TypeDict d;
1502 d.put("size", EMObject::INT);
1503 d.put("npad", EMObject::INT);
1504 d.put("sign", EMObject::INT);
1505 d.put("symmetry", EMObject::STRING);
1506 d.put("snr", EMObject::FLOAT);
1507 d.put("fftvol", EMObject::EMDATA);
1508 d.put("weight", EMObject::EMDATA);
1509 d.put("refvol", EMObject::EMDATA);
1510 d.put("weighting", EMObject::INT);
1511 d.put("varsnr", EMObject::INT);
1512 d.put("do_ctf", EMObject::INT);
1513 return d;
1514 }

References EMAN::EMObject::EMDATA, EMAN::EMObject::FLOAT, EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.

◆ insert_padfft_slice_weighted()

int nn4_ctfwsReconstructor::insert_padfft_slice_weighted ( EMData padfft,
EMData ctf2d2,
vector< float >  bckgnoise,
const Transform trans,
const float  weight 
)

Definition at line 5263 of file reconstructor.cpp.

5264{
5265 Assert( padfft != NULL );
5266
5267 vector<float> abc_list;
5268 int abc_list_len = 0;
5269 if (m_volume->has_attr("smear")) {
5270 abc_list = m_volume->get_attr("smear");
5271 abc_list_len = abc_list.size();
5272 }
5273
5274 vector<Transform> tsym = t.get_sym_proj(m_symmetry);
5275 for (unsigned int isym=0; isym < tsym.size(); isym++) {
5276 if (abc_list_len == 0)
5277 m_volume->nn_ctfw(m_wptr, padfft, ctf2d2, m_npad, bckgnoise, tsym[isym], weight);
5278 else
5279 for (int i = 0; i < abc_list_len; i += 4)
5280 m_volume->nn_ctfw(m_wptr, padfft, ctf2d2, m_npad, bckgnoise, tsym[isym] * Transform(Dict("type", "SPIDER", "phi", abc_list[i], "theta", abc_list[i+1], "psi", abc_list[i+2])), weight * abc_list[i+3]);
5281 }
5282 return 0;
5283}
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
#define Assert(s)
Define Assert() function that is effective only when -DDEBUG is used.
Definition: emassert.h:42

References Assert, EMAN::Transform::get_sym_proj(), m_npad, m_symmetry, m_volume, and m_wptr.

Referenced by insert_slice().

◆ insert_slice()

int nn4_ctfwsReconstructor::insert_slice ( const EMData *const  slice,
const Transform euler,
const float  weight 
)
virtual

Insert a slice into a 3D volume, in a given orientation.

Returns
0 if successful, 1 otherwise
Parameters
slicethe image slice to be inserted into the 3D volume
eulerEuler angle of this image slice.
weightA weighting factor for this slice, generally the number of particles in a class-average. May be ignored by some reconstructors
Returns
0 if OK. 1 if error.
Exceptions
NullPointerExceptionif the input EMData pointer is null
ImageFormatExceptionif the image is complex as opposed to real

Reimplemented from EMAN::Reconstructor.

Definition at line 5199 of file reconstructor.cpp.

5200{
5201 // sanity checks
5202 if (!slice) {
5203 LOGERR("try to insert NULL slice");
5204 return 1;
5205 }
5206 if(weight !=0.0f) {
5207 /*
5208 int buffed = slice->get_attr_default( "buffed", 0 );
5209 if( buffed > 0 ) {
5210 insert_buffed_slice( slice, weight );
5211 return 0;
5212 }
5213 */
5214
5215 EMData* padfft = padfft_slice( slice, t, m_npad );
5216
5217 EMData* ctf2d = NULL;
5218 if( m_do_ctf == 1 ) {
5219 float tmp = padfft->get_attr_default("ctf_applied", 0);
5220 int ctf_applied = (int) tmp;
5221
5222 // Generate 2D CTF (EMData object)
5223 //ctf_store_real::init( padfft->get_ysize(), padfft->get_attr( "ctf" ) );
5224 int winsize = padfft->get_ysize();
5225 Ctf* ctf = padfft->get_attr( "ctf" );
5226 Dict params = ctf->to_dict();
5227 ctf2d = Util::ctf_img_real(winsize , winsize, 1, params["defocus"], params["apix"],params["voltage"], params["cs"], \
5228 params["ampcont"], params["bfactor"], params["dfdiff"], params["dfang"], 1);
5229 params.clear();
5230 if(ctf) {delete ctf; ctf=0;}
5231 //ctf2d = ctf_store_real::get_ctf_real(); //This is in 2D projection plane
5232 int nx=ctf2d->get_xsize(),ny=ctf2d->get_ysize(),nz=ctf2d->get_zsize();
5233 float *ctf2d_ptr = ctf2d->get_data();
5234
5235 size_t size = (size_t)nx*ny*nz;
5236 if (!ctf_applied) {
5237 for (int i = 0; i < size; ++i) padfft->cmplx(i) *= ctf2d_ptr[i]; // Multiply padfft by CTF
5238 }
5239
5240 for (int i = 0; i < size; ++i) ctf2d_ptr[i] *= ctf2d_ptr[i]; // Squared 2D CTF
5241 } else {
5242 int nx=padfft->get_xsize(),ny=padfft->get_ysize(),nz=padfft->get_zsize();
5243 ctf2d = new EMData();
5244 ctf2d->set_size(nx/2,ny,nz);
5245 float *ctf2d_ptr = ctf2d->get_data();
5246 size_t size = (size_t)nx*ny*nz/2;
5247 for (int i = 0; i < size; ++i) ctf2d_ptr[i] = 1.0;
5248 }
5249
5250 vector<float> bckgnoise;
5251 bckgnoise = slice->get_attr("bckgnoise");
5252
5253 insert_padfft_slice_weighted(padfft, ctf2d, bckgnoise, t, weight);
5254
5255 checked_delete( ctf2d );
5256 checked_delete( padfft );
5257 bckgnoise.clear();
5258
5259 }
5260 return 0;
5261}
Ctf is the base class for all CTF model.
Definition: ctf.h:60
virtual Dict to_dict() const =0
void clear()
Clear all keys wraps map.clear()
Definition: emobject.h:560
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
int insert_padfft_slice_weighted(EMData *padfft, EMData *ctf2d2, vector< float > bckgnoise, const Transform &trans, const float weight)
#define LOGERR
Definition: log.h:51
EMData * padfft_slice(const EMData *const slice, const Transform &t, int npad)
Direct Fourier inversion Reconstructor.
void checked_delete(T *&x)

References checked_delete(), EMAN::Dict::clear(), insert_padfft_slice_weighted(), LOGERR, m_do_ctf, m_npad, EMAN::padfft_slice(), EMAN::FactoryBase::params, and EMAN::Ctf::to_dict().

◆ NEW()

static Reconstructor * EMAN::nn4_ctfwsReconstructor::NEW ( )
inlinestatic

Definition at line 1493 of file reconstructor.h.

1494 {
1495 return new nn4_ctfwsReconstructor();
1496 }

References nn4_ctfwsReconstructor().

◆ setup() [1/2]

void nn4_ctfwsReconstructor::setup ( )
virtual

Initialize the reconstructor.

Implements EMAN::Reconstructor.

Definition at line 5093 of file reconstructor.cpp.

5094{
5095 //if(!params.has_key("size")) throw std::logic_error("Error: image size is not given");
5096 int size = params.has_key("size")? int(params["size"]): 0;
5097 int npad = params.has_key("npad")? int(params["npad"]): 2;
5098 // int sign = params.has_key("sign") ? int(params["sign"]) : 1;
5099 int sign = 1;
5100 string symmetry = params.has_key("symmetry")? params["symmetry"].to_str() : "c1";
5101 float snr = params["snr"];
5102 int do_ctf = params["do_ctf"];
5103 setup( symmetry, size, npad, snr, sign, do_ctf );
5104}
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511

References EMAN::Dict::has_key(), EMAN::FactoryBase::params, and setup().

Referenced by nn4_ctfwsReconstructor(), and setup().

◆ setup() [2/2]

void nn4_ctfwsReconstructor::setup ( const string &  symmetry,
int  size,
int  npad,
float  snr,
int  sign,
int  do_ctf 
)

Definition at line 5106 of file reconstructor.cpp.

5107{
5109
5110 /* if( params.has_key("weighting") ) {
5111 if( int( params["weighting"])==0) m_weighting = NONE;
5112 } */
5113
5114 m_wghta = 0.2f;
5115 m_wghtb = 0.004f;
5116
5117 m_symmetry = symmetry;
5118 if (npad!=0) m_npad = npad;
5119 else m_npad = 0;
5120 m_sign = sign;
5122 m_do_ctf = do_ctf;
5123
5124 m_snr = snr;
5125
5126 m_vnx = size;
5127 m_vny = size;
5128 m_vnz = size;
5129
5130 //m_vnxp = size*npad;
5131 //m_vnyp = size*npad;
5132 //m_vnzp = size*npad;
5133 m_vnxp = size;
5134 m_vnyp = size;
5135 m_vnzp = size;
5136
5137 m_vnxc = m_vnxp/2;
5138 m_vnyc = m_vnyp/2;
5139 m_vnzc = m_vnzp/2;
5140
5143 m_refvol = params["refvol"];
5144 m_refvol->get_data();
5145}
static int get_nsym(const string &sym)
get the number of symmetries associated with the given symmetry name
Definition: transform.cpp:1570
@ ESTIMATE

References buildFFTVolume(), buildNormVolume(), ESTIMATE, EMAN::Transform::get_nsym(), m_do_ctf, m_npad, m_nsym, m_refvol, m_sign, m_snr, m_symmetry, m_vnx, m_vnxc, m_vnxp, m_vny, m_vnyc, m_vnyp, m_vnz, m_vnzc, m_vnzp, m_weighting, m_wghta, m_wghtb, and EMAN::FactoryBase::params.

Member Data Documentation

◆ m_do_ctf

int EMAN::nn4_ctfwsReconstructor::m_do_ctf
private

Definition at line 1540 of file reconstructor.h.

Referenced by insert_slice(), and setup().

◆ m_npad

int EMAN::nn4_ctfwsReconstructor::m_npad
private

Definition at line 1532 of file reconstructor.h.

Referenced by insert_padfft_slice_weighted(), insert_slice(), and setup().

◆ m_nsym

int EMAN::nn4_ctfwsReconstructor::m_nsym
private

Definition at line 1539 of file reconstructor.h.

Referenced by setup().

◆ m_refvol

EMData* EMAN::nn4_ctfwsReconstructor::m_refvol
private

Definition at line 1528 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_sign

int EMAN::nn4_ctfwsReconstructor::m_sign
private

Definition at line 1533 of file reconstructor.h.

Referenced by setup().

◆ m_snr

float EMAN::nn4_ctfwsReconstructor::m_snr
private

Definition at line 1537 of file reconstructor.h.

Referenced by setup().

◆ m_symmetry

string EMAN::nn4_ctfwsReconstructor::m_symmetry
private

Definition at line 1538 of file reconstructor.h.

Referenced by insert_padfft_slice_weighted(), and setup().

◆ m_varsnr

int EMAN::nn4_ctfwsReconstructor::m_varsnr
private

Definition at line 1534 of file reconstructor.h.

◆ m_vnx

int EMAN::nn4_ctfwsReconstructor::m_vnx
private

Definition at line 1529 of file reconstructor.h.

Referenced by setup().

◆ m_vnxc

int EMAN::nn4_ctfwsReconstructor::m_vnxc
private

Definition at line 1531 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_vnxp

int EMAN::nn4_ctfwsReconstructor::m_vnxp
private

Definition at line 1530 of file reconstructor.h.

Referenced by buildFFTVolume(), and setup().

◆ m_vny

int EMAN::nn4_ctfwsReconstructor::m_vny
private

Definition at line 1529 of file reconstructor.h.

Referenced by setup().

◆ m_vnyc

int EMAN::nn4_ctfwsReconstructor::m_vnyc
private

Definition at line 1531 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_vnyp

int EMAN::nn4_ctfwsReconstructor::m_vnyp
private

Definition at line 1530 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_vnz

int EMAN::nn4_ctfwsReconstructor::m_vnz
private

Definition at line 1529 of file reconstructor.h.

Referenced by setup().

◆ m_vnzc

int EMAN::nn4_ctfwsReconstructor::m_vnzc
private

Definition at line 1531 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_vnzp

int EMAN::nn4_ctfwsReconstructor::m_vnzp
private

Definition at line 1530 of file reconstructor.h.

Referenced by finish(), and setup().

◆ m_volume

EMData* EMAN::nn4_ctfwsReconstructor::m_volume
private

◆ m_weighting

int EMAN::nn4_ctfwsReconstructor::m_weighting
private

Definition at line 1535 of file reconstructor.h.

Referenced by setup().

◆ m_wghta

float EMAN::nn4_ctfwsReconstructor::m_wghta
private

Definition at line 1536 of file reconstructor.h.

Referenced by setup().

◆ m_wghtb

float EMAN::nn4_ctfwsReconstructor::m_wghtb
private

Definition at line 1536 of file reconstructor.h.

Referenced by setup().

◆ m_wptr

EMData* EMAN::nn4_ctfwsReconstructor::m_wptr
private

◆ NAME

const string nn4_ctfwsReconstructor::NAME = "nn4_ctfws"
static

Definition at line 1523 of file reconstructor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: