Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
id06workflow
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Boards
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
payno
id06workflow
Commits
cfef4e34
Commit
cfef4e34
authored
Nov 28, 2018
by
payno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[orange contrib] fix the saveimage
parent
d6e79d74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
orangecontrib/id06workflow/widgets/saveimage.py
orangecontrib/id06workflow/widgets/saveimage.py
+13
-4
test_real_dataset.py
test_real_dataset.py
+6
-4
No files found.
orangecontrib/id06workflow/widgets/saveimage.py
View file @
cfef4e34
...
...
@@ -31,8 +31,9 @@ __date__ = "10/10/2018"
import
os
from
Orange.widgets.widget
import
OWWidget
from
Orange.canvas.registry.description
import
InputSignal
from
silx.gui.utils.image
import
convertArrayToQImage
from
id06workflow.gui.settings
import
DEFAULT_COLORMAP
from
id06workflow.core.types
import
_Image
from
silx.gui.plot
import
Plot2D
import
logging
_logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -70,10 +71,18 @@ class SaveImageOW(OWWidget):
if
output
is
None
:
_logger
.
warning
(
"No environment variable define under "
"'WORKFLOW_OUTPUT'"
)
output
=
'.'
output
=
os
.
getcwd
()
_logger
.
info
(
'save image to
%
s'
%
output
)
try
:
qimage
=
convertArrayToQImage
(
image
.
img
)
qimage
.
save
(
os
.
path
.
join
(
output
,
image
.
name
),
'PNG'
)
# TODO: fix me, do not use the creation of Plot to save the image
# but a qimage ?
_name
=
image
.
name
if
_name
.
lower
()
.
endswith
(
'.png'
)
is
False
:
_name
=
_name
+
'.png'
plot
=
Plot2D
()
plot
.
setDefaultColormap
(
DEFAULT_COLORMAP
)
plot
.
addImage
(
image
.
img
)
plot
.
replot
()
plot
.
saveGraph
(
filename
=
os
.
path
.
join
(
output
,
_name
),
fileFormat
=
'png'
)
except
Exception
as
e
:
_logger
.
error
(
e
)
test_real_dataset.py
View file @
cfef4e34
...
...
@@ -110,7 +110,7 @@ class TestTrueData(OrangeWorflowTest):
if
self
.
_previous_workflow_output
is
not
None
:
os
.
environ
[
'WORKFLOW_OUTPUT'
]
=
self
.
_previous_workflow_output
shutil
.
rmtree
(
self
.
_screenshot_output
)
#
shutil.rmtree(self._screenshot_output)
OrangeWorflowTest
.
tearDown
(
self
)
def
createDataset
(
self
):
...
...
@@ -188,18 +188,20 @@ class TestTrueData(OrangeWorflowTest):
self
.
assertTrue
(
self
.
_shiftCorrectionWidget
.
_editedExperiment
is
not
None
)
self
.
_shiftCorrectionWidget
.
setShift
(
dx
=
0.0
,
dy
=
0.0
,
dz
=
0.0
)
self
.
_shiftCorrectionWidget
.
validate
()
self
.
_shiftCorrectionWidget
.
hide
()
self
.
_moveToNextStep
()
# screenshot saving
# make sur all screenshots are processed
for
i
in
range
(
9
):
self
.
_moveToNextStep
()
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'intensity.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_diffry_mean.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_diffry_variance.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_diffry_s
c
kewness.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_diffry_skewness.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_diffry_kurtosis.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_obpitch_mean.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_obpitch_variance.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_obpitch_s
c
kewness.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_obpitch_skewness.png'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
_screenshot_output
,
'positioner_obpitch_kurtosis.png'
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment