Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
0d235a2d
Commit
0d235a2d
authored
3 years ago
by
casagran
Browse files
Options
Downloads
Patches
Plain Diff
add roi selection
parent
474a52e7
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Draft: Resolve "py-bkg-rm"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_Python/pydct/orangecontrib/pydct/widgets/roi_selection.py
+2
-18
2 additions, 18 deletions
...Python/pydct/orangecontrib/pydct/widgets/roi_selection.py
with
2 additions
and
18 deletions
zUtil_Python/pydct/orangecontrib/pydct/widgets/roi_selection.py
+
2
−
18
View file @
0d235a2d
...
...
@@ -148,16 +148,13 @@ class ROISelectionWidget(qt.QWidget):
def
applyRoi
(
self
):
"""
todo update all docs here
Function to apply the region of interest at the data of the dataset
and show the new data in the stack. Dataset data is not yet replaced.
A new roi is created in the middle of the new stack.
"""
self
.
roi
=
RectangleROI
()
self
.
roi
.
setGeometry
(
origin
=
self
.
getRoi
().
getOrigin
(),
size
=
self
.
getRoi
().
getSize
())
# self._update_dataset = self.dataset.apply_roi(size=numpy.flip(self.roi.getSize()),
# center=numpy.flip(self.roi.getCenter()))
# self.setStack(self._update_dataset)
# self.resetROI()
def
apply
(
self
):
"""
...
...
@@ -207,7 +204,6 @@ class RoiSelectionWidgetOW(OWWidget):
icon
=
"
icons/one_round.png
"
want_main_area
=
False
# Inputs/Outputs
class
Inputs
:
data
=
Input
(
"
data
"
,
ndarray
)
colormap
=
Input
(
"
colormap
"
,
Colormap
)
...
...
@@ -215,10 +211,7 @@ class RoiSelectionWidgetOW(OWWidget):
class
Outputs
:
roi_origin
=
Output
(
"
roi_origin
"
,
list
)
roi_size
=
Output
(
"
roi_size
"
,
list
)
# data = Output("data", ndarray)
# colormap = Output("colormap", Colormap)
# Settings
roi_origin
=
Setting
(
list
(),
schema_only
=
True
)
roi_size
=
Setting
(
list
(),
schema_only
=
True
)
...
...
@@ -235,28 +228,19 @@ class RoiSelectionWidgetOW(OWWidget):
self
.
_widget
.
setDataset
(
data
)
else
:
self
.
_widget
.
clearStack
()
# Emit None
self
.
Outputs
.
roi
.
send
(
None
)
# Set saved roi
if
len
(
self
.
roi_origin
)
and
len
(
self
.
roi_size
):
self
.
_widget
.
setRoi
(
origin
=
self
.
roi_origin
,
size
=
self
.
roi_size
)
# self.open()
@Inputs.colormap
def
setColormap
(
self
,
colormap
):
self
.
_widget
.
setStackViewColormap
(
colormap
)
def
_sendSignal
(
self
,
roi_origin
=
[],
roi_size
=
[]):
"""
Emits the signal with the new data.
"""
"""
Emits the signal with the new data.
"""
self
.
close
()
self
.
roi_origin
=
roi_origin
self
.
roi_size
=
roi_size
self
.
Outputs
.
roi_origin
.
send
(
self
.
roi_origin
)
self
.
Outputs
.
roi_size
.
send
(
self
.
roi_size
)
# roi = (tuple(self.origin), (self.origin[0] + self.roi_size[0], self.origin[1] + self.roi_size[1]))
# self.Outputs.dataset.send(self._widget.getDataset())
# self.Outputs.colormap.send(self._widget.getStackViewColormap())
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