Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
67154285
Commit
67154285
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
Use mask (inverted rectangle) in MaskPresenter instead of RegionOfInterest
parent
02027aa6
No related branches found
No related tags found
1 merge request
!88
Remove RegionOfInterest
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/Views/MaskWidgets/MaskResultsPresenter.cpp
+9
-11
9 additions, 11 deletions
GUI/Views/MaskWidgets/MaskResultsPresenter.cpp
with
9 additions
and
11 deletions
GUI/Views/MaskWidgets/MaskResultsPresenter.cpp
+
9
−
11
View file @
67154285
...
...
@@ -14,7 +14,6 @@
#include
"GUI/Views/MaskWidgets/MaskResultsPresenter.h"
#include
"Device/ProDetector/DetectorMask.h"
#include
"Device/ProDetector/RegionOfInterest.h"
#include
"GUI/Models/IntensityDataItem.h"
#include
"GUI/Models/MaskItems.h"
#include
"GUI/Models/SessionModel.h"
...
...
@@ -87,18 +86,13 @@ void MaskResultsPresenter::backup_data()
OutputData
<
double
>*
MaskResultsPresenter
::
createMaskPresentation
()
const
{
// Requesting mask information
std
::
unique_ptr
<
RegionOfInterest
>
roi
;
std
::
unique_ptr
<
IShape2D
>
roi
;
DetectorMask
detectorMask
;
for
(
int
i_row
=
m_maskModel
->
rowCount
(
m_maskContainerIndex
);
i_row
>
0
;
--
i_row
)
{
QModelIndex
itemIndex
=
m_maskModel
->
index
(
i_row
-
1
,
0
,
m_maskContainerIndex
);
if
(
MaskItem
*
maskItem
=
dynamic_cast
<
MaskItem
*>
(
m_maskModel
->
itemForIndex
(
itemIndex
)))
{
if
(
maskItem
->
modelType
()
==
"RegionOfInterest"
)
{
double
xlow
=
maskItem
->
getItemValue
(
RectangleItem
::
P_XLOW
).
toDouble
();
double
ylow
=
maskItem
->
getItemValue
(
RectangleItem
::
P_YLOW
).
toDouble
();
double
xup
=
maskItem
->
getItemValue
(
RectangleItem
::
P_XUP
).
toDouble
();
double
yup
=
maskItem
->
getItemValue
(
RectangleItem
::
P_YUP
).
toDouble
();
roi
.
reset
(
new
RegionOfInterest
(
m_intensityDataItem
->
getOutputData
()
->
axes
(),
xlow
,
ylow
,
xup
,
yup
));
roi
=
maskItem
->
createShape
();
}
else
{
std
::
unique_ptr
<
IShape2D
>
shape
(
maskItem
->
createShape
());
bool
mask_value
=
maskItem
->
getItemValue
(
MaskItem
::
P_MASK_VALUE
).
toBool
();
...
...
@@ -107,14 +101,18 @@ OutputData<double>* MaskResultsPresenter::createMaskPresentation() const
}
}
if
(
!
detectorMask
.
hasMasks
()
&&
!
roi
)
return
0
;
// ROI mask has to be the last one, it can not be "unmasked" by other shapes
if
(
roi
)
detectorMask
.
addMask
(
*
roi
,
true
);
if
(
!
detectorMask
.
hasMasks
())
return
nullptr
;
OutputData
<
double
>*
result
=
m_intensityDataItem
->
getOutputData
()
->
clone
();
detectorMask
.
initMaskData
(
result
->
axes
());
for
(
size_t
i
=
0
;
i
<
result
->
getAllocatedSize
();
++
i
)
if
(
detectorMask
.
isMasked
(
i
)
||
(
roi
&&
!
roi
->
isInROI
(
i
))
)
if
(
detectorMask
.
isMasked
(
i
))
(
*
result
)[
i
]
=
0.0
;
return
result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment