25 #ifndef _PROG_ANGULAR_ASSIGN_FOR_TILTSERIES 26 #define _PROG_ANGULAR_ASSIGN_FOR_TILTSERIES 44 double thresholdAffine,
bool globalAffine,
bool isMirror,
177 void produceSideInfo();
180 void computeAffineTransformations(
bool globalAffineToUse);
183 void identifyOutliers(
bool mark);
186 void produceInformationFromLandmarks();
203 bool reversed,
double &maxCorr)
const;
209 void generateLandmarkSet();
212 void writeLandmarkSet(
const FileName &fnLandmark)
const;
215 void writeTransformations(
const FileName &fnTransformations)
const;
218 void readLandmarkSet(
const FileName &fnLandmark);
221 void removeOutlierLandmarks(
const Alignment &alignment);
237 std::vector < MultidimArray<unsigned char> *>
img;
240 std::vector < MultidimArray<unsigned char> *>
maskImg;
277 std::vector< std::vector<int> >
Vseti;
280 std::vector< std::vector<int> >
Vsetj;
283 std::vector< Matrix1D<double> >
barpi;
299 std::vector< Matrix1D<double> >
di;
300 std::vector< Matrix1D<double> >
rj;
338 for (
int i=0;
i<Nimg;
i++)
340 Ai.push_back(dummy23);
341 Ait.push_back(dummy32);
342 Aip.push_back(dummy23);
343 Aipt.push_back(dummy32);
344 di.push_back(dummy2);
345 diaxis.push_back(dummy2);
346 B1i.push_back(dummy33);
347 B2i.push_back(dummy33);
348 barri.push_back(dummy3);
350 allLandmarksPredictedX.initZeros(Nlandmark,Nimg);
351 allLandmarksPredictedY.initZeros(Nlandmark,Nimg);
352 errorLandmark.initZeros(Nlandmark);
355 for (
int j=0;
j<Nlandmark;
j++)
356 rj.push_back(dummy3);
389 double optimizeGivenAxisDirection();
392 void computeGeometryDependentOfAxis();
395 void computeGeometryDependentOfRotation();
398 double computeError()
const;
401 void computeErrorForLandmarks();
407 friend std::ostream&
operator<<(std::ostream &out,
418 std::vector< Matrix2D<double> >
Ai;
421 std::vector< Matrix2D<double> >
Ait;
424 std::vector< Matrix2D<double> >
Aip;
427 std::vector< Matrix2D<double> >
Aipt;
430 std::vector< Matrix1D<double> >
barri;
436 std::vector< Matrix2D<double> >
B1i;
439 std::vector< Matrix2D<double> >
B2i;
461 double thresholdAffine,
bool globalAffine,
bool isMirror,
bool globalAffine
Look for local affine transformation.
std::vector< Matrix1D< double > > di
double computeAffineTransformation(const MultidimArray< unsigned char > &I1, const MultidimArray< unsigned char > &I2, int maxShift, int maxIterDE, const FileName &fn_affine, Matrix2D< double > &A12, Matrix2D< double > &A21, bool show, double thresholdAffine, bool globalAffine, bool isMirror, bool checkRotation)
double maxShiftPercentage
Maxshift percentage.
const ProgTomographAlignment * prm
std::vector< Matrix1D< double > > rj
Matrix2D< double > allLandmarksY
std::vector< double > tiltList
double deltaRot
Delta rot.
double alignImages(const MultidimArray< double > &Iref, const AlignmentTransforms &IrefTransforms, MultidimArray< double > &I, Matrix2D< double > &M, bool wrap, AlignmentAux &aux, CorrelationAux &aux2, RotationalCorrelationAux &aux3)
size_t seqLength
Sequence Length.
Matrix2D< double > Binvraxis
MultidimArray< double > errorLandmark
Matrix1D< int > isOutlier
std::vector< MultidimArray< unsigned char > * > maskImg
std::vector< Matrix1D< double > > barpi
double corrThreshold
Correlation threshold for a good landmark.
FileName fnSel
MetaData File with all images.
int maxIterDE
Maximum number of iterations in Differential Evolution.
std::vector< Matrix2D< double > > Ait
Matrix2D< double > allLandmarksX
int operator<(const Landmark &rhs) const
int maxStep
Maximum Step for chain refinement.
FileName fnRoot
Output root.
std::ostream & operator<<(std::ostream &os, const Message &sb)
std::vector< Matrix2D< double > > Ai
size_t Ncritical
Number of critical points.
std::vector< std::string > name_list
int gridSamples
Grid samples.
Matrix1D< double > avgForwardPatchCorr
std::vector< Matrix1D< double > > diaxis
int lastStep
Last step to run (-1=run them all)
int numThreads
Number of threads to use for parallel computing.
Matrix1D< double > avgBackwardPatchCorr
std::vector< std::vector< int > > Vseti
std::vector< Landmark > LandmarkChain
double thresholdAffine
Threshold affine.
std::vector< Matrix2D< double > > B2i
std::vector< Matrix2D< double > > Aip
FileName fnSelOrig
MetaData File with all images at the original scale.
bool doNotIdentifyOutliers
Do not identify outlier micrographs.
double identifyOutliersZ
Identify outlier micrographs.
Alignment * bestPreviousAlignment
std::vector< MultidimArray< unsigned char > * > img
bool useCriticalPoints
Use critical points.
Landmark & operator=(const Landmark &rhs)
std::vector< Matrix2D< double > > B1i
std::vector< std::vector< Matrix2D< double > > > affineTransformations
double localSize
Local refinement size.
std::vector< std::vector< int > > Vsetj
std::vector< Matrix2D< double > > Aipt
Alignment(const ProgTomographAlignment *_prm)
Matrix2D< double > allLandmarksPredictedX
bool isCapillar
This tilt series comes from a capillar.
Matrix2D< double > allLandmarksPredictedY
double psiMax
Maximum rotation.
std::vector< Matrix1D< double > > barri
bool optimizeTiltAngle
Optimize tilt angle of tilt axis.
bool showAffine
Show affine transformations.
bool dontNormalize
Don't normalize the corrected images.
std::vector< double > correlationList