Two defects the merge created and one the API carried. Rugnux gated the per-image spot engine on AnalysisModeIsMX, so AnalysisMode::Grid fell through to the azimuthal-integration-only path: a raster ran, scored nothing, and reported no crystals. The gate now asks the stages table whether the mode does spot finding, which is the actual question - three modes need that engine for three different reasons, and a fourth would otherwise have to be remembered here too. max_crystals was a required integer defaulting to 10, with 0 meaning "all". Zero reads as "report no crystals", the opposite of what it did. It is now optional, and absent means no cap; a crystal found and then dropped is information the caller cannot get back. grow_score_threshold was missing from the schema entirely. Measured over the labelled corpus after these fixes: 34 of 34 confirmed-protein rasters yield a crystal, 0 of 8 water, 0 of 6 ice, 19 of 19 heldout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
262 lines
8.0 KiB
C++
262 lines
8.0 KiB
C++
/**
|
|
* Jungfraujoch
|
|
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.167
|
|
* Contact: filip.leonarski@psi.ch
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "Grid_scan_analysis_settings.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Grid_scan_analysis_settings::Grid_scan_analysis_settings()
|
|
{
|
|
m_Protein_score_threshold = 0.5f;
|
|
m_Grow_score_threshold = 0.35f;
|
|
m_Min_blob_cells = 3L;
|
|
m_Decisive_single_cell_score = 0.6f;
|
|
m_Max_crystals = 0L;
|
|
m_Max_crystalsIsSet = false;
|
|
m_Indexing = true;
|
|
|
|
}
|
|
|
|
void Grid_scan_analysis_settings::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Grid_scan_analysis_settings::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Grid_scan_analysis_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_analysis_settings" : pathPrefix;
|
|
|
|
|
|
|
|
/* Protein_score_threshold */ {
|
|
const float& value = m_Protein_score_threshold;
|
|
const std::string currentValuePath = _pathPrefix + ".proteinScoreThreshold";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(1))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 1;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Grow_score_threshold */ {
|
|
const float& value = m_Grow_score_threshold;
|
|
const std::string currentValuePath = _pathPrefix + ".growScoreThreshold";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(1))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 1;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Min_blob_cells */ {
|
|
const int64_t& value = m_Min_blob_cells;
|
|
const std::string currentValuePath = _pathPrefix + ".minBlobCells";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Decisive_single_cell_score */ {
|
|
const float& value = m_Decisive_single_cell_score;
|
|
const std::string currentValuePath = _pathPrefix + ".decisiveSingleCellScore";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(1))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 1;";
|
|
}
|
|
|
|
}
|
|
|
|
if (maxCrystalsIsSet())
|
|
{
|
|
const int64_t& value = m_Max_crystals;
|
|
const std::string currentValuePath = _pathPrefix + ".maxCrystals";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Grid_scan_analysis_settings::operator==(const Grid_scan_analysis_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getProteinScoreThreshold() == rhs.getProteinScoreThreshold())
|
|
&&
|
|
|
|
(getGrowScoreThreshold() == rhs.getGrowScoreThreshold())
|
|
&&
|
|
|
|
(getMinBlobCells() == rhs.getMinBlobCells())
|
|
&&
|
|
|
|
(getDecisiveSingleCellScore() == rhs.getDecisiveSingleCellScore())
|
|
&&
|
|
|
|
|
|
((!maxCrystalsIsSet() && !rhs.maxCrystalsIsSet()) || (maxCrystalsIsSet() && rhs.maxCrystalsIsSet() && getMaxCrystals() == rhs.getMaxCrystals())) &&
|
|
|
|
(isIndexing() == rhs.isIndexing())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Grid_scan_analysis_settings::operator!=(const Grid_scan_analysis_settings& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Grid_scan_analysis_settings& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["protein_score_threshold"] = o.m_Protein_score_threshold;
|
|
j["grow_score_threshold"] = o.m_Grow_score_threshold;
|
|
j["min_blob_cells"] = o.m_Min_blob_cells;
|
|
j["decisive_single_cell_score"] = o.m_Decisive_single_cell_score;
|
|
if(o.maxCrystalsIsSet())
|
|
j["max_crystals"] = o.m_Max_crystals;
|
|
j["indexing"] = o.m_Indexing;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Grid_scan_analysis_settings& o)
|
|
{
|
|
j.at("protein_score_threshold").get_to(o.m_Protein_score_threshold);
|
|
j.at("grow_score_threshold").get_to(o.m_Grow_score_threshold);
|
|
j.at("min_blob_cells").get_to(o.m_Min_blob_cells);
|
|
j.at("decisive_single_cell_score").get_to(o.m_Decisive_single_cell_score);
|
|
if(j.find("max_crystals") != j.end())
|
|
{
|
|
j.at("max_crystals").get_to(o.m_Max_crystals);
|
|
o.m_Max_crystalsIsSet = true;
|
|
}
|
|
j.at("indexing").get_to(o.m_Indexing);
|
|
|
|
}
|
|
|
|
float Grid_scan_analysis_settings::getProteinScoreThreshold() const
|
|
{
|
|
return m_Protein_score_threshold;
|
|
}
|
|
void Grid_scan_analysis_settings::setProteinScoreThreshold(float const value)
|
|
{
|
|
m_Protein_score_threshold = value;
|
|
}
|
|
float Grid_scan_analysis_settings::getGrowScoreThreshold() const
|
|
{
|
|
return m_Grow_score_threshold;
|
|
}
|
|
void Grid_scan_analysis_settings::setGrowScoreThreshold(float const value)
|
|
{
|
|
m_Grow_score_threshold = value;
|
|
}
|
|
int64_t Grid_scan_analysis_settings::getMinBlobCells() const
|
|
{
|
|
return m_Min_blob_cells;
|
|
}
|
|
void Grid_scan_analysis_settings::setMinBlobCells(int64_t const value)
|
|
{
|
|
m_Min_blob_cells = value;
|
|
}
|
|
float Grid_scan_analysis_settings::getDecisiveSingleCellScore() const
|
|
{
|
|
return m_Decisive_single_cell_score;
|
|
}
|
|
void Grid_scan_analysis_settings::setDecisiveSingleCellScore(float const value)
|
|
{
|
|
m_Decisive_single_cell_score = value;
|
|
}
|
|
int64_t Grid_scan_analysis_settings::getMaxCrystals() const
|
|
{
|
|
return m_Max_crystals;
|
|
}
|
|
void Grid_scan_analysis_settings::setMaxCrystals(int64_t const value)
|
|
{
|
|
m_Max_crystals = value;
|
|
m_Max_crystalsIsSet = true;
|
|
}
|
|
bool Grid_scan_analysis_settings::maxCrystalsIsSet() const
|
|
{
|
|
return m_Max_crystalsIsSet;
|
|
}
|
|
void Grid_scan_analysis_settings::unsetMax_crystals()
|
|
{
|
|
m_Max_crystalsIsSet = false;
|
|
}
|
|
bool Grid_scan_analysis_settings::isIndexing() const
|
|
{
|
|
return m_Indexing;
|
|
}
|
|
void Grid_scan_analysis_settings::setIndexing(bool const value)
|
|
{
|
|
m_Indexing = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|