21 #include <QVBoxLayout>
24 : QObject(parent), m_interpolation_flag_backup(false)
29 const QModelIndex& maskContainerIndex,
92 std::unique_ptr<RegionOfInterest> roi;
97 if (maskItem->modelType() ==
"RegionOfInterest") {
105 std::unique_ptr<IShape2D> shape(maskItem->createShape());
107 detectorMask.
addMask(*shape.get(), mask_value);
112 if (!detectorMask.
hasMasks() && !roi)
121 if (roi && !roi->isInROI(i))
Defines class DetectorMask.
Defines class IntensityDataItem.
Defines MaskItems classes.
Defines class MaskResultsPresenter.
Defines class RegionOfInterest.
Defines class SessionModel.
OutputData< double > * getOutputData()
Collection of detector masks.
bool isMasked(size_t index) const
bool hasMasks() const
returns true if has masks
void addMask(const IShape2D &shape, bool mask_value)
Add mask to the stack of detector masks.
void initMaskData(const IDetector2D &detector)
Init the map of masks for the given detector plane.
void setOutputData(OutputData< double > *data) override
The given pointer becomes owned by this class!!
static const QString P_IS_INTERPOLATED
A base class for all mask items.
static const QString P_MASK_VALUE
QModelIndex m_maskContainerIndex
std::unique_ptr< OutputData< double > > m_dataBackup
void updatePresenter(MaskEditorFlags::PresentationType mode)
void setMaskContext(SessionModel *maskModel, const QModelIndex &maskContainerIndex, IntensityDataItem *intensityItem)
void setShowMaskMode()
Update IntensityDataItem in SessionModel to represent masked areas.
IntensityDataItem * m_intensityDataItem
SessionModel * m_maskModel
OutputData< double > * createMaskPresentation() const
Constructs OutputData which contains original intensity data except masked areas, and areas outside o...
bool m_interpolation_flag_backup
MaskResultsPresenter(QWidget *parent=0)
void setOriginalMode()
Restores original state of IntensityDataItem.
size_t getAllocatedSize() const
Returns total size of data buffer (product of bin number in every dimension).
OutputData * clone() const
static const QString P_XUP
static const QString P_YLOW
static const QString P_YUP
static const QString P_XLOW
Defines rectangular area for the detector which will be simulated/fitted.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
SessionItem * itemForIndex(const QModelIndex &index) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
virtual int rowCount(const QModelIndex &parent) const