Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xsocs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kmap
xsocs
Commits
8862464d
Commit
8862464d
authored
Dec 07, 2016
by
Damien Naudet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.esrf.fr:kmap/kmap into fitview
parents
55782f89
04985a1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
51 deletions
+27
-51
kmap/gui/view/QspaceView.py
kmap/gui/view/QspaceView.py
+27
-51
No files found.
kmap/gui/view/QspaceView.py
View file @
8862464d
...
...
@@ -332,6 +332,9 @@ class QSpaceView(Qt.QMainWindow):
# setting up the plot3D and its param tree
self
.
__view3d
=
view3d
=
ScalarFieldView
()
view3d
.
addIsosurface
(
lambda
data
:
np
.
mean
(
data
)
+
np
.
std
(
data
),
'#FF0000FF'
)
view3d
.
setMinimumSize
(
400
,
400
)
view3d
.
setAxesLabels
(
'qx'
,
'qy'
,
'qz'
)
self
.
setCentralWidget
(
view3d
)
...
...
@@ -341,6 +344,8 @@ class QSpaceView(Qt.QMainWindow):
# Register ROIPlotIntensity
view3d
.
sigSelectedRegionChanged
.
connect
(
roiPlotWindow
.
roiChanged
)
# Store the cut plane signals connection state
self
.
__connectedToCutPlane
=
False
view3d
.
getCutPlanes
()[
0
].
sigPlaneChanged
.
connect
(
self
.
__cutPlaneChanged
)
view3d
.
getCutPlanes
()[
0
].
sigDataChanged
.
connect
(
self
.
__cutPlaneChanged
)
...
...
@@ -536,60 +541,31 @@ class QSpaceView(Qt.QMainWindow):
def
__planePlotDockVisibilityChanged
(
self
,
visible
):
cutPlane
=
self
.
__view3d
.
getCutPlanes
()[
0
]
if
visible
:
cutPlane
.
sigPlaneChanged
.
connect
(
self
.
__cutPlaneChanged
)
cutPlane
.
sigDataChanged
.
connect
(
self
.
__cutPlaneChanged
)
self
.
__cutPlaneChanged
()
# To sync
if
not
self
.
__connectedToCutPlane
:
# Prevent multiple connect
self
.
__connectedToCutPlane
=
True
cutPlane
.
sigPlaneChanged
.
connect
(
self
.
__cutPlaneChanged
)
cutPlane
.
sigDataChanged
.
connect
(
self
.
__cutPlaneChanged
)
self
.
__cutPlaneChanged
()
# To sync
else
:
cutPlane
.
sigPlaneChanged
.
disconnect
(
self
.
__cutPlaneChanged
)
cutPlane
.
sigDataChanged
.
disconnect
(
self
.
__cutPlaneChanged
)
if
self
.
__connectedToCutPlane
:
# Prevent multiple disconnect
self
.
__connectedToCutPlane
=
False
cutPlane
.
sigPlaneChanged
.
disconnect
(
self
.
__cutPlaneChanged
)
cutPlane
.
sigDataChanged
.
disconnect
(
self
.
__cutPlaneChanged
)
def
__cutPlaneChanged
(
self
):
plane
=
self
.
__view3d
.
getCutPlanes
()[
0
]
if
plane
.
isVisible
()
and
plane
.
isValid
():
data
=
self
.
__view3d
.
getData
(
copy
=
False
)
if
data
is
not
None
:
normal
=
plane
.
getNormal
()
point
=
np
.
array
(
plane
.
getPoint
(),
dtype
=
np
.
int
)
labels
=
self
.
__view3d
.
getAxesLabels
()
scale
=
self
.
__view3d
.
getScale
()
translation
=
self
.
__view3d
.
getTranslation
()
if
np
.
all
(
np
.
equal
(
normal
,
(
1.
,
0.
,
0.
))):
index
=
max
(
0
,
min
(
point
[
0
],
data
.
shape
[
2
]
-
1
))
slice_
=
data
[:,
:,
index
]
xlabel
,
ylabel
=
labels
.
getYLabel
(),
labels
.
getZLabel
()
imageScale
=
scale
[
1
],
scale
[
2
]
imageTranslation
=
translation
[
1
],
translation
[
2
]
title
=
labels
.
getXLabel
()
+
' = %f'
%
\
(
index
*
scale
[
0
]
+
translation
[
0
])
elif
np
.
all
(
np
.
equal
(
normal
,
(
0.
,
1.
,
0.
))):
index
=
max
(
0
,
min
(
point
[
1
],
data
.
shape
[
1
]
-
1
))
slice_
=
data
[:,
index
,
:]
xlabel
,
ylabel
=
labels
.
getXLabel
(),
labels
.
getZLabel
()
imageScale
=
scale
[
0
],
scale
[
2
]
imageTranslation
=
translation
[
0
],
translation
[
2
]
title
=
labels
.
getYLabel
()
+
' = %f'
%
\
(
index
*
scale
[
1
]
+
translation
[
1
])
elif
np
.
all
(
np
.
equal
(
normal
,
(
0.
,
0.
,
1.
))):
index
=
max
(
0
,
min
(
point
[
2
],
data
.
shape
[
0
]
-
1
))
slice_
=
data
[
index
,
:,
:]
xlabel
,
ylabel
=
labels
.
getXLabel
(),
labels
.
getYLabel
()
imageScale
=
scale
[
0
],
scale
[
1
]
imageTranslation
=
translation
[
0
],
translation
[
1
]
title
=
labels
.
getZLabel
()
+
' = %f'
%
\
(
index
*
scale
[
2
]
+
translation
[
2
])
slice_
=
np
.
array
(
slice_
,
copy
=
True
)
self
.
__planePlotWindow
.
setGraphXLabel
(
xlabel
)
self
.
__planePlotWindow
.
setGraphYLabel
(
ylabel
)
self
.
__planePlotWindow
.
setGraphTitle
(
title
)
self
.
__planePlotWindow
.
addImage
(
slice_
,
legend
=
'cutting plane'
,
origin
=
imageTranslation
,
scale
=
imageScale
,
resetzoom
=
True
)
planeImage
=
plane
.
getImageData
()
if
planeImage
.
isValid
():
self
.
__planePlotWindow
.
setGraphXLabel
(
planeImage
.
getXLabel
())
self
.
__planePlotWindow
.
setGraphYLabel
(
planeImage
.
getYLabel
())
title
=
(
planeImage
.
getNormalLabel
()
+
' = %f'
%
planeImage
.
getPosition
())
self
.
__planePlotWindow
.
setGraphTitle
(
title
)
self
.
__planePlotWindow
.
addImage
(
planeImage
.
getData
(
copy
=
False
),
legend
=
'cutting plane'
,
origin
=
planeImage
.
getTranslation
(),
scale
=
planeImage
.
getScale
(),
resetzoom
=
True
)
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