Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing the performance of the angular distance program #639

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/xmipp/libraries/reconstruction/angular_distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <core/args.h>
#include <core/histogram.h>
#include "core/geometry.h"
#include <core/metadata_db.h>

// Read arguments ==========================================================
void ProgAngularDistance::readParams()
Expand Down Expand Up @@ -127,7 +128,7 @@ void ProgAngularDistance::run()
return;
}

MetaDataDb DF_out;
MetaDataVec DF_out;
double angular_distance=0;
double shift_distance=0;

Expand Down Expand Up @@ -206,7 +207,7 @@ void ProgAngularDistance::run()
// Fill the output result
if (fillOutput)
{
MDRowSql row;
MDRowVec row;
//output[0]=rot1;
row.setValue(MDL_ANGLE_ROT, rot1);
//output[1]=rot2p;
Expand Down Expand Up @@ -288,7 +289,7 @@ void ProgAngularDistance::run()

void ProgAngularDistance::computeWeights()
{
MetaDataDb DF1sorted, DF2sorted, DFweights;
MetaDataVec DF1sorted, DF2sorted, DFweights;
MDLabel label=MDL::str2Label(idLabel);
DF1sorted.sort(DF1,label);
DF2sorted.sort(DF2,label);
Expand Down Expand Up @@ -547,7 +548,7 @@ void ProgAngularDistance::computeWeights()
DF2.removeLabel(angleDiffLabel);
if (DF2.containsLabel(weightLabel))
DF2.removeLabel(weightLabel);
DF2weighted.join1(DF2,DFweights,label,INNER);
DF2weighted.join1(MetaDataDb(DF2),MetaDataDb(DFweights),label,INNER);

for (size_t objId : DF2weighted.ids())
{
Expand Down
6 changes: 3 additions & 3 deletions src/xmipp/libraries/reconstruction/angular_distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define _PROG_ANGULAR_DISTANCE

#include <core/xmipp_funcs.h>
#include <core/metadata_db.h>
#include <core/metadata_vec.h>
#include <core/xmipp_program.h>
#include <core/symmetries.h>

Expand Down Expand Up @@ -61,9 +61,9 @@ class ProgAngularDistance: public XmippProgram
int set;
public:
// DocFile 1
MetaDataDb DF1;
MetaDataVec DF1;
// DocFile 2
MetaDataDb DF2;
MetaDataVec DF2;
// Symmetry List
SymList SL;
public:
Expand Down