v1.0.0-rc.153 (#63)
Build Packages / Unit tests (push) Successful in 1h31m59s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m5s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m56s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 10m27s
Build Packages / build:rpm (rocky8) (push) Successful in 9m20s
Build Packages / build:rpm (rocky9) (push) Successful in 10m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m38s
Build Packages / DIALS test (push) Successful in 12m13s
Build Packages / XDS test (durin plugin) (push) Successful in 7m8s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m8s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m50s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Skipped
Build Packages / Unit tests (push) Successful in 1h31m59s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m5s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m56s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 10m27s
Build Packages / build:rpm (rocky8) (push) Successful in 9m20s
Build Packages / build:rpm (rocky9) (push) Successful in 10m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m38s
Build Packages / DIALS test (push) Successful in 12m13s
Build Packages / XDS test (durin plugin) (push) Successful in 7m8s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m8s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m50s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Skipped
This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use. * jfjoch_broker: Add EXPERIMENTAL pixelrefine mode for image processing * jfjoch_broker: Allow to load user mask from 8-bit and 16-bit TIFF files * jfjoch_broker: Add ROI calculation in non-FPGA workflow * jfjoch_broker: Fixes to TCP image pusher * jfjoch_broker: Remove NUMA bindings * jfjoch_broker: Improvements to indexing * jfjoch_broker: For PSI EIGER, trimming energies are taken from the detector configuration (now compulsory) instead of hardcoded values * jfjoch_writer: Save ROI definitions and the per-pixel ROI bitmap in the master file; azimuthal ROIs support phi (angular) sectors * jfjoch_viewer: Major redesign with dockable panels and saved layouts, plus on-canvas creation/move/resize of box, circle and azimuthal ROIs * jfjoch_viewer: Run jfjoch_process reprocessing jobs from inside the GUI and overlay per-run results Reviewed-on: #63
This commit was merged in pull request #63.
This commit is contained in:
+118
-3
@@ -9,6 +9,8 @@
|
||||
#include "../broker/gen/model/Image_buffer_status.h"
|
||||
#include "../broker/gen/model/Plots.h"
|
||||
#include "../broker/gen/model/Broker_status.h"
|
||||
#include "../broker/gen/model/Roi_definitions.h"
|
||||
#include "../common/JFJochMath.h"
|
||||
#include "../image_analysis/bragg_integration/CalcISigma.h"
|
||||
|
||||
void JFJochHttpReader::Close() {
|
||||
@@ -50,7 +52,7 @@ BrokerStatus JFJochHttpReader::GetBrokerStatus() const {
|
||||
auto res = cli_cmd.Get("/status");
|
||||
if (!res || res->status != httplib::StatusCode::OK_200)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Could not get image buffer status");
|
||||
"Could not get broker status");
|
||||
|
||||
try {
|
||||
org::openapitools::server::model::Broker_status input = nlohmann::json::parse(res->body);
|
||||
@@ -59,6 +61,8 @@ BrokerStatus JFJochHttpReader::GetBrokerStatus() const {
|
||||
ret.gpu_count = input.getGpuCount();
|
||||
if (input.progressIsSet())
|
||||
ret.progress = input.getProgress();
|
||||
if (input.messageIsSet())
|
||||
ret.message = input.getMessage();
|
||||
|
||||
if (input.getState() == "Inactive")
|
||||
ret.state = JFJochState::Inactive;
|
||||
@@ -87,7 +91,7 @@ BrokerStatus JFJochHttpReader::GetBrokerStatus() const {
|
||||
return ret;
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Could not parse image buffer status");
|
||||
"Could not parse broker status");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +213,30 @@ void JFJochHttpReader::ReadURL(const std::string &url) {
|
||||
SetStartMessage(UpdateDataset_i());
|
||||
}
|
||||
|
||||
std::shared_ptr<const JFJochReaderDataset> JFJochHttpReader::RefreshDatasetIfChanged(int64_t &num_images_out) {
|
||||
std::unique_lock ul(http_mutex);
|
||||
|
||||
num_images_out = 0;
|
||||
if (addr.empty())
|
||||
return {};
|
||||
|
||||
auto status = GetImageBufferStatus();
|
||||
num_images_out = status.max_image_number + 1;
|
||||
|
||||
// Re-fetch the dataset (start message + plots) only when the buffer actually changed,
|
||||
// so the dataset-only follow mode does not hammer the broker with plot requests.
|
||||
const bool buffer_changed = !last_image_buffer_counter.has_value()
|
||||
|| !status.current_counter.has_value()
|
||||
|| last_image_buffer_counter.value() != status.current_counter.value();
|
||||
last_image_buffer_counter = status.current_counter;
|
||||
|
||||
if (!buffer_changed)
|
||||
return {};
|
||||
|
||||
SetStartMessage(UpdateDataset_i());
|
||||
return GetDataset();
|
||||
}
|
||||
|
||||
bool JFJochHttpReader::LoadImage_i(std::shared_ptr<JFJochReaderDataset> &dataset,
|
||||
DataMessage &message,
|
||||
std::vector<uint8_t> &buffer,
|
||||
@@ -342,7 +370,7 @@ std::vector<float> JFJochHttpReader::GetPlot_i(const std::string &plot_type, flo
|
||||
return {};
|
||||
} catch (nlohmann::json::parse_error &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Could not parse image buffer status");
|
||||
"Could not parse plot " + plot_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,6 +404,93 @@ void JFJochHttpReader::UploadUserMask(const std::vector<uint32_t>& mask) {
|
||||
"Server rejected user mask upload");
|
||||
}
|
||||
|
||||
ROIDefinition JFJochHttpReader::GetROIDefinitions() const {
|
||||
std::unique_lock ul(http_mutex);
|
||||
if (addr.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "HTTP address not set");
|
||||
|
||||
httplib::Client cli_cmd(addr);
|
||||
auto res = cli_cmd.Get("/config/roi");
|
||||
if (!res || res->status != httplib::StatusCode::OK_200)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Could not get ROI definitions");
|
||||
|
||||
org::openapitools::server::model::Roi_definitions input = nlohmann::json::parse(res->body);
|
||||
ROIDefinition out;
|
||||
for (const auto &i : input.getBox().getRois())
|
||||
out.boxes.emplace_back(i.getName(), i.getMinXPxl(), i.getMaxXPxl(), i.getMinYPxl(), i.getMaxYPxl());
|
||||
for (const auto &i : input.getCircle().getRois())
|
||||
out.circles.emplace_back(i.getName(), i.getCenterXPxl(), i.getCenterYPxl(), i.getRadiusPxl());
|
||||
for (const auto &i : input.getAzim().getRois()) {
|
||||
float phi_min = 0, phi_max = 0;
|
||||
if (i.phiMinDegIsSet() && i.phiMaxDegIsSet()) {
|
||||
phi_min = i.getPhiMinDeg();
|
||||
phi_max = i.getPhiMaxDeg();
|
||||
}
|
||||
const float d_min = (i.getQMaxRecipA() == 0.0f) ? 0.0f : 2.0f * static_cast<float>(PI) / i.getQMaxRecipA();
|
||||
const float d_max = (i.getQMinRecipA() == 0.0f) ? 0.0f : 2.0f * static_cast<float>(PI) / i.getQMinRecipA();
|
||||
out.azimuthal.emplace_back(i.getName(), d_min, d_max, phi_min, phi_max);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
void JFJochHttpReader::UploadROIDefinitions(const ROIDefinition &rois) const {
|
||||
std::unique_lock ul(http_mutex);
|
||||
if (addr.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "HTTP address not set");
|
||||
|
||||
namespace model = org::openapitools::server::model;
|
||||
model::Roi_definitions out;
|
||||
|
||||
model::Roi_box_list bl;
|
||||
std::vector<model::Roi_box> boxes;
|
||||
for (const auto &b : rois.boxes) {
|
||||
model::Roi_box e;
|
||||
e.setName(b.GetName());
|
||||
e.setMinXPxl(b.GetXMin()); e.setMaxXPxl(b.GetXMax());
|
||||
e.setMinYPxl(b.GetYMin()); e.setMaxYPxl(b.GetYMax());
|
||||
boxes.push_back(e);
|
||||
}
|
||||
bl.setRois(boxes);
|
||||
out.setBox(bl);
|
||||
|
||||
model::Roi_circle_list cl;
|
||||
std::vector<model::Roi_circle> circles;
|
||||
for (const auto &c : rois.circles) {
|
||||
model::Roi_circle e;
|
||||
e.setName(c.GetName());
|
||||
e.setCenterXPxl(c.GetX()); e.setCenterYPxl(c.GetY());
|
||||
e.setRadiusPxl(c.GetRadius_pxl());
|
||||
circles.push_back(e);
|
||||
}
|
||||
cl.setRois(circles);
|
||||
out.setCircle(cl);
|
||||
|
||||
model::Roi_azim_list al;
|
||||
std::vector<model::Roi_azimuthal> azim;
|
||||
for (const auto &a : rois.azimuthal) {
|
||||
model::Roi_azimuthal e;
|
||||
e.setName(a.GetName());
|
||||
e.setQMinRecipA(a.GetQMin_recipA());
|
||||
e.setQMaxRecipA(a.GetQMax_recipA());
|
||||
if (a.HasPhi()) {
|
||||
e.setPhiMinDeg(a.GetPhiMin_deg());
|
||||
e.setPhiMaxDeg(a.GetPhiMax_deg());
|
||||
}
|
||||
azim.push_back(e);
|
||||
}
|
||||
al.setRois(azim);
|
||||
out.setAzim(al);
|
||||
|
||||
nlohmann::json j = out;
|
||||
httplib::Client cli_cmd(addr);
|
||||
auto res = cli_cmd.Put("/config/roi", j.dump(), "application/json");
|
||||
if (!res)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Failed to connect to server to upload ROIs");
|
||||
if (res->status != httplib::StatusCode::OK_200)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Server rejected ROI upload");
|
||||
}
|
||||
|
||||
std::vector<SpotToSave> JFJochHttpReader::ReadSpots(int64_t image) const {
|
||||
std::unique_lock ul(http_mutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user