126 lines
3.6 KiB
C++
126 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include "types.h"
|
|
#include "DoseImage.h"
|
|
#include "RoiLoader.h"
|
|
|
|
#include <QWidget>
|
|
#include <QString>
|
|
#include <vector>
|
|
|
|
class ImageManager;
|
|
class SliceViewWidget;
|
|
class ImageListPanel;
|
|
class QComboBox;
|
|
class QSlider;
|
|
class QLabel;
|
|
class QLineEdit;
|
|
class QListWidget;
|
|
class QListWidgetItem;
|
|
class QPushButton;
|
|
class QProgressBar;
|
|
class QSpinBox;
|
|
class QDragEnterEvent;
|
|
class QDropEvent;
|
|
|
|
class GammaComparePage : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit GammaComparePage(QWidget* parent = nullptr);
|
|
~GammaComparePage() override = default;
|
|
|
|
bool loadDoseFile(const QString& path, QString* error = nullptr);
|
|
|
|
protected:
|
|
void dragEnterEvent(QDragEnterEvent* event) override;
|
|
void dropEvent(QDropEvent* event) override;
|
|
|
|
private slots:
|
|
void onImportDose();
|
|
void onBrowseStructure();
|
|
void onDeleteImage(const QString& id);
|
|
void onFrontChanged(int index);
|
|
void onBackgroundChanged(int index);
|
|
void onOpacityChanged(int value);
|
|
void onColorMapChanged(int index);
|
|
void onSliceSliderChanged(int value);
|
|
void onCursorChanged(Vec3d world);
|
|
void refreshImageSelectors();
|
|
void refreshDoseViews();
|
|
void refreshGammaViews();
|
|
void syncSliceSliders();
|
|
void onZoomScaleChanged(double parallelScale);
|
|
void onPanWorldDelta(double dx, double dy, double dz);
|
|
void syncSharedZoomFromDoseViews();
|
|
void syncSharedZoomFromGammaViews();
|
|
void onCalculateGamma();
|
|
void onRoiItemChanged(QListWidgetItem* item);
|
|
|
|
private:
|
|
void buildUi();
|
|
QString currentBgId() const;
|
|
QString currentFgId() const;
|
|
DoseImage::Pointer bgDose() const;
|
|
DoseImage::Pointer fgDose() const;
|
|
void setCursor(const Vec3d& world, bool fromSlider);
|
|
QString defaultOpenDir() const;
|
|
void rememberOpenPath(const QString& path);
|
|
bool isSupportedDosePath(const QString& path) const;
|
|
bool isSupportedDropPath(const QString& path) const;
|
|
void applyBgFgAfterLoad(const QString& newId, int countBefore);
|
|
void promoteBgFgAfterDelete(const QString& deletedId, const QString& oldBg, const QString& oldFg);
|
|
bool loadStructuresFromPath(const QString& path, QString* error);
|
|
void rebuildRoiList();
|
|
int selectedRoiIndex() const;
|
|
void setRoiCheckedExclusive(int listRow);
|
|
void syncDoseRoleChecks();
|
|
void applyGammaMapDisplay();
|
|
QString resolveGammaDllPath() const;
|
|
|
|
ImageManager* m_manager = nullptr;
|
|
ImageListPanel* m_listPanel = nullptr;
|
|
QListWidget* m_roiList = nullptr;
|
|
QLineEdit* m_structEdit = nullptr;
|
|
bool m_blockRoiCheck = false;
|
|
|
|
SliceViewWidget* m_axial = nullptr;
|
|
SliceViewWidget* m_sagittal = nullptr;
|
|
SliceViewWidget* m_coronal = nullptr;
|
|
SliceViewWidget* m_gAxial = nullptr;
|
|
SliceViewWidget* m_gSagittal = nullptr;
|
|
SliceViewWidget* m_gCoronal = nullptr;
|
|
bool m_blockViewSync = false;
|
|
bool m_blockGammaZoom = false;
|
|
|
|
QComboBox* m_frontCombo = nullptr;
|
|
QComboBox* m_bgCombo = nullptr;
|
|
QComboBox* m_colorMapCombo = nullptr;
|
|
QSlider* m_opacitySlider = nullptr;
|
|
QLabel* m_opacityLabel = nullptr;
|
|
|
|
QSlider* m_sliderAxial = nullptr;
|
|
QSlider* m_sliderSagittal = nullptr;
|
|
QSlider* m_sliderCoronal = nullptr;
|
|
QSlider* m_gSliderAxial = nullptr;
|
|
QSlider* m_gSliderSagittal = nullptr;
|
|
QSlider* m_gSliderCoronal = nullptr;
|
|
|
|
QSpinBox* m_dtaSpin = nullptr;
|
|
QSpinBox* m_ddSpin = nullptr;
|
|
QSpinBox* m_thSpin = nullptr;
|
|
QPushButton* m_calcBtn = nullptr;
|
|
QLabel* m_passLabel = nullptr;
|
|
QProgressBar* m_progress = nullptr;
|
|
QLabel* m_statusLabel = nullptr;
|
|
|
|
Vec3d m_cursor;
|
|
bool m_blockSliders = false;
|
|
QString m_pendingFgId;
|
|
QString m_pendingBgId;
|
|
bool m_hasPendingRoles = false;
|
|
|
|
std::vector<std::string> m_roiNames;
|
|
std::vector<RoiMaskType::Pointer> m_roiMasks;
|
|
DoseImage::Pointer m_gammaMap;
|
|
};
|