Commit 34a438c7 authored by Raza, Zamaan's avatar Raza, Zamaan

Added frequency tolerance to SubframeAutoIndexer

parent 62d6185a
Pipeline #24211 passed with stage
in 29 minutes and 11 seconds
......@@ -57,6 +57,7 @@ AutoIndexer::AutoIndexer() : _solutions(), _handler(nullptr)
void AutoIndexer::autoIndex(const std::vector<Peak3D*>& peaks)
{
_params.log(Level::Info);
// Find the Q-space directions along which the projection of the the Q-vectors
// shows the highest periodicity
computeFFTSolutions(peaks);
......@@ -76,7 +77,6 @@ void AutoIndexer::autoIndex(const std::vector<Peak3D*>& peaks)
void AutoIndexer::autoIndex(PeakCollection* peaks)
{
nsxlog(Level::Info, "AutoIndexer::autoindex: indexing PeakCollection", peaks->name());
_params.log(Level::Info);
std::vector<Peak3D*> peak_list = peaks->getPeakList();
autoIndex(peak_list);
}
......
......@@ -258,7 +258,7 @@ void PeakFinder::findPrimaryBlobs(
{
int n_numors = _current_data.size();
std::ostringstream oss;
oss << "Finding blobs for numor " << n_numor << " of " << n_numors;
oss << "Finding blobs for numor " << n_numor+1 << " of " << n_numors;
// update via handler if necessary
if (_handler) {
......
......@@ -13,6 +13,7 @@
// ***********************************************************************************************
#include "gui/subframe_index/SubframeAutoIndexer.h"
#include "base/utils/Logger.h"
#include "base/utils/ProgressHandler.h"
#include "base/utils/Units.h"
#include "core/algo/AutoIndexer.h"
......@@ -171,6 +172,11 @@ void SubframeAutoIndexer::setParametersUp()
para_grid->addWidget(label_ptr, 8, 0, 1, 1);
label_ptr->setSizePolicy(*_size_policy_widgets);
label_ptr = new QLabel("Frequency tol.:");
label_ptr->setAlignment(Qt::AlignRight);
para_grid->addWidget(label_ptr, 9, 0, 1, 1);
label_ptr->setSizePolicy(*_size_policy_widgets);
_gruber = new QDoubleSpinBox();
_niggli = new QDoubleSpinBox();
_only_niggli = new QCheckBox("Find Niggli cell only");
......@@ -180,6 +186,7 @@ void SubframeAutoIndexer::setParametersUp()
_number_subdivisions = new QSpinBox();
_min_cell_volume = new QDoubleSpinBox();
_indexing_tolerance = new QDoubleSpinBox();
_frequency_tolerance = new QDoubleSpinBox();
_gruber->setMaximumWidth(1000);
_gruber->setMaximum(100000);
......@@ -211,6 +218,10 @@ void SubframeAutoIndexer::setParametersUp()
_indexing_tolerance->setMaximum(100000);
_indexing_tolerance->setDecimals(6);
_frequency_tolerance->setMaximumWidth(1000);
_frequency_tolerance->setMaximum(1);
_frequency_tolerance->setDecimals(3);
_gruber->setSizePolicy(*_size_policy_widgets);
_niggli->setSizePolicy(*_size_policy_widgets);
_only_niggli->setSizePolicy(*_size_policy_widgets);
......@@ -220,6 +231,7 @@ void SubframeAutoIndexer::setParametersUp()
_number_subdivisions->setSizePolicy(*_size_policy_widgets);
_min_cell_volume->setSizePolicy(*_size_policy_widgets);
_indexing_tolerance->setSizePolicy(*_size_policy_widgets);
_frequency_tolerance->setSizePolicy(*_size_policy_widgets);
para_grid->addWidget(_gruber, 0, 1, 1, 1);
para_grid->addWidget(_niggli, 1, 1, 1, 1);
......@@ -230,6 +242,7 @@ void SubframeAutoIndexer::setParametersUp()
para_grid->addWidget(_number_solutions, 6, 1, 1, 1);
para_grid->addWidget(_min_cell_volume, 7, 1, 1, 1);
para_grid->addWidget(_indexing_tolerance, 8, 1, 1, 1);
para_grid->addWidget(_frequency_tolerance, 9, 1, 1, 1);
_para_box->setContentLayout(*para_grid, true);
_para_box->setSizePolicy(*_size_policy_box);
......@@ -362,6 +375,7 @@ void SubframeAutoIndexer::grabIndexerParameters()
_number_solutions->setValue(parameters.nSolutions);
_max_cell_dimension->setValue(parameters.maxdim);
_indexing_tolerance->setValue(parameters.indexingTolerance);
_frequency_tolerance->setValue(parameters.frequencyTolerance);
_min_cell_volume->setValue(parameters.minUnitCellVolume);
}
......@@ -382,6 +396,7 @@ void SubframeAutoIndexer::setIndexerParameters() const
parameters.nSolutions = _number_solutions->value();
parameters.maxdim = _max_cell_dimension->value();
parameters.indexingTolerance = _indexing_tolerance->value();
parameters.frequencyTolerance = _frequency_tolerance->value();
parameters.minUnitCellVolume = _min_cell_volume->value();
auto_indexer->setParameters(parameters);
......@@ -410,7 +425,7 @@ void SubframeAutoIndexer::runAutoIndexer()
try {
auto_indexer->autoIndex(collection->getPeakList());
} catch (const std::exception& e) {
// gLogger->log("[ERROR] AutoIndex: " + QString::fromStdString(e.what()));
nsx::nsxlog(nsx::Level::Info, e.what());
return;
}
......
......@@ -111,6 +111,7 @@ class SubframeAutoIndexer : public QWidget {
QDoubleSpinBox* _max_cell_dimension;
QDoubleSpinBox* _min_cell_volume;
QDoubleSpinBox* _indexing_tolerance;
QDoubleSpinBox* _frequency_tolerance;
QSpinBox* _number_vertices;
QSpinBox* _number_solutions;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment