BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Collection of detector masks. More...
Public Member Functions | |
DetectorMask () | |
DetectorMask (const DetectorMask &other) | |
void | addMask (const IShape2D &shape, bool mask_value) |
Add mask to the stack of detector masks. More... | |
Histogram2D * | createHistogram () const |
const OutputData< bool > * | getMaskData () const |
const IShape2D * | getMaskShape (size_t mask_index, bool &mask_value) const |
bool | hasMasks () const |
returns true if has masks More... | |
void | initMaskData (const IDetector2D &detector) |
Init the map of masks for the given detector plane. More... | |
void | initMaskData (const OutputData< double > &data) |
bool | isMasked (size_t index) const |
int | numberOfMaskedChannels () const |
size_t | numberOfMasks () const |
DetectorMask & | operator= (const DetectorMask &other) |
Private Member Functions | |
void | process_masks () |
Private Attributes | |
OutputData< bool > | m_mask_data |
std::vector< bool > | m_mask_of_shape |
int | m_number_of_masked_channels |
SafePointerVector< IShape2D > | m_shapes |
Collection of detector masks.
Definition at line 28 of file DetectorMask.h.
DetectorMask::DetectorMask | ( | ) |
Definition at line 19 of file DetectorMask.cpp.
DetectorMask::DetectorMask | ( | const DetectorMask & | other | ) |
Definition at line 21 of file DetectorMask.cpp.
References OutputData< T >::copyFrom(), and m_mask_data.
void DetectorMask::addMask | ( | const IShape2D & | shape, |
bool | mask_value | ||
) |
Add mask to the stack of detector masks.
The value "true" means that the area will be excluded from the analysis.
shape | The shape of mask. |
mask_value | The value of mask |
Definition at line 42 of file DetectorMask.cpp.
References OutputData< T >::clear(), IShape2D::clone(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, m_shapes, and SafePointerVector< T >::push_back().
Referenced by IDetector2D::addMask(), and MaskResultsPresenter::createMaskPresentation().
Histogram2D * DetectorMask::createHistogram | ( | ) | const |
Definition at line 83 of file DetectorMask.cpp.
References OutputData< T >::copyShapeFrom(), IHistogram::createHistogram(), OutputData< T >::getAllocatedSize(), and m_mask_data.
|
inline |
const IShape2D * DetectorMask::getMaskShape | ( | size_t | mask_index, |
bool & | mask_value | ||
) | const |
Definition at line 97 of file DetectorMask.cpp.
References m_mask_of_shape, m_shapes, and numberOfMasks().
|
inline |
returns true if has masks
Definition at line 52 of file DetectorMask.h.
References SafePointerVector< T >::empty(), and m_shapes.
Referenced by MaskResultsPresenter::createMaskPresentation().
void DetectorMask::initMaskData | ( | const IDetector2D & | detector | ) |
Init the map of masks for the given detector plane.
Definition at line 50 of file DetectorMask.cpp.
References OutputData< T >::addAxis(), ASSERT, IDetector::axis(), OutputData< T >::clear(), IDetector::dimension(), m_mask_data, m_mask_of_shape, m_shapes, process_masks(), and SafePointerVector< T >::size().
Referenced by IDetector2D::addMask(), MaskResultsPresenter::createMaskPresentation(), IDetector2D::resetRegionOfInterest(), and IDetector2D::setRegionOfInterest().
void DetectorMask::initMaskData | ( | const OutputData< double > & | data | ) |
Definition at line 67 of file DetectorMask.cpp.
References OutputData< T >::addAxis(), ASSERT, OutputData< T >::axis(), OutputData< T >::clear(), m_mask_data, m_mask_of_shape, m_shapes, process_masks(), OutputData< T >::rank(), and SafePointerVector< T >::size().
bool DetectorMask::isMasked | ( | size_t | index | ) | const |
Definition at line 78 of file DetectorMask.cpp.
References m_mask_data, and m_number_of_masked_channels.
Referenced by MaskResultsPresenter::createMaskPresentation().
|
inline |
size_t DetectorMask::numberOfMasks | ( | ) | const |
Definition at line 92 of file DetectorMask.cpp.
References m_shapes, and SafePointerVector< T >::size().
Referenced by getMaskShape(), and TransformFromDomain::setDetectorMasks().
DetectorMask & DetectorMask::operator= | ( | const DetectorMask & | other | ) |
Definition at line 29 of file DetectorMask.cpp.
References OutputData< T >::copyFrom(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, and m_shapes.
|
private |
Definition at line 105 of file DetectorMask.cpp.
References IShape2D::contains(), SafePointerVector< T >::empty(), OutputData< T >::getAllocatedSize(), OutputData< T >::getAxisBin(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, m_shapes, OutputData< T >::setAllTo(), and SafePointerVector< T >::size().
Referenced by initMaskData().
|
private |
Definition at line 65 of file DetectorMask.h.
Referenced by DetectorMask(), addMask(), createHistogram(), getMaskData(), initMaskData(), isMasked(), operator=(), and process_masks().
|
private |
Definition at line 64 of file DetectorMask.h.
Referenced by addMask(), getMaskShape(), initMaskData(), operator=(), and process_masks().
|
private |
Definition at line 66 of file DetectorMask.h.
Referenced by addMask(), isMasked(), numberOfMaskedChannels(), operator=(), and process_masks().
|
private |
Definition at line 63 of file DetectorMask.h.
Referenced by addMask(), getMaskShape(), hasMasks(), initMaskData(), numberOfMasks(), operator=(), and process_masks().