- Colour indexed spots from a secondary (or further) lattice in coral (#FA7268), the viewer's finishing accent, in the diffraction-image overlay. - Draw resolution rings by sweeping ResPhiToPxl into a QPainterPath (like the azimuthal ROI arcs), replacing the 4-point bounding-box ellipse and the poni_rot_3=0 hack, so rings follow the geometry on tilted detectors. - Add a spot/prediction colour legend to the Image-features side panel; the two user-adjustable swatches track the colour picker. - Show a colour swatch matching the on-image annotation on each ROI-list item, via a shared ROIAnnotationColor palette used by both the overlay and the list. - Add "Save image as JPEG..." / "...with overlay as JPEG..." to the image right-click menu, reusing a factored renderToImage() helper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
69 lines
2.1 KiB
C++
69 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <QLabel>
|
|
#include <QWidget>
|
|
#include <QLineEdit>
|
|
#include <QCheckBox>
|
|
|
|
#include "widgets/JFJochViewerROIList.h"
|
|
#include "../reader/JFJochReader.h"
|
|
#include "charts/JFJochSimpleChartView.h"
|
|
#include "widgets/ResolutionRingWidget.h"
|
|
|
|
class CollapsibleSection;
|
|
|
|
class JFJochViewerSidePanel : public QWidget {
|
|
Q_OBJECT
|
|
|
|
JFJochViewerROIList *roi_list = nullptr;
|
|
ResolutionRingWidget *res_rings = nullptr;
|
|
CollapsibleSection *roiSection = nullptr; // auto-expands when ROIs change
|
|
|
|
// Legend swatches for the two user-adjustable colours, kept so the legend tracks colour picks.
|
|
QLabel *legend_spot_swatch_ = nullptr; // non-indexed spots
|
|
QLabel *legend_indexed_swatch_ = nullptr; // indexed spots (feature colour)
|
|
|
|
signals:
|
|
void showSpots(bool input);
|
|
void setFeatureColor(QColor input);
|
|
void setSpotColor(QColor input);
|
|
void showHighestPixels(int32_t v);
|
|
void showSaturatedPixels(bool input);
|
|
void showPredictions(bool input);
|
|
void highlightIceRings(bool input);
|
|
void showROILabels(bool input);
|
|
void showROIFill(bool input);
|
|
void roisChanged(ROIDefinition rois);
|
|
void selectedROIChanged(QString name);
|
|
void downloadROIs();
|
|
void uploadROIs();
|
|
void maskFromROI(QString name, bool add);
|
|
void findBeamCenter(const UnitCell &input, bool guess);
|
|
void analyze();
|
|
|
|
void imageLoaded(std::shared_ptr<const JFJochReaderImage> image);
|
|
|
|
void writeStatusBar(QString string, int timeout_ms = 0);
|
|
|
|
void ringModeSet(JFJochDiffractionImage::RingMode mode);
|
|
void resRingsSet(QVector<float> v);
|
|
public:
|
|
JFJochViewerSidePanel(QWidget *parent);
|
|
public slots:
|
|
void loadImage(std::shared_ptr<const JFJochReaderImage> image);
|
|
void SetRings(QVector<float> v);
|
|
void selectROIInList(QString name);
|
|
|
|
private slots:
|
|
void spotsToggled(bool input);
|
|
void predictionsToggled(bool input);
|
|
void highlightIceRingsToggled(bool input);
|
|
void saturatedPixelsToggled(bool input);
|
|
};
|
|
|
|
|
|
|