Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
GEPARD
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GEPARD
GEPARD
Commits
cfa964ed
Commit
cfa964ed
authored
Jul 25, 2019
by
JosefBrandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temporary fixes, non working solution
parent
f1fe95fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
47 deletions
+54
-47
ramancom/simulatedraman.py
ramancom/simulatedraman.py
+6
-3
viewitems.py
viewitems.py
+44
-42
zeissimporter.py
zeissimporter.py
+4
-2
No files found.
ramancom/simulatedraman.py
View file @
cfa964ed
...
...
@@ -21,6 +21,8 @@ If not, see <https://www.gnu.org/licenses/>.
Simualted Raman interface module for testing without actual raman system connected
"""
import
sys
stdout
=
sys
.
stdout
from
time
import
sleep
import
numpy
as
np
from
shutil
import
copyfile
...
...
@@ -35,9 +37,9 @@ class SimulatedRaman(RamanBase):
self
.
currentpos
=
None
,
0.
,
0.
self
.
currentZ
=
0.
# some plausible data to simulate consecutively changing positions
self
.
positionlist
=
np
.
array
([[
1526.
,
-
1379.9
,
-
131.
],
[
3762.5
,
-
1197.7
,
-
138.1
],
[
2313.7
,
-
2627.2
,
-
138.1
],
self
.
positionlist
=
np
.
array
([[
-
12012
,
13716
,
-
1290
],
[
-
11955
,
-
9200
,
-
1279
],
[
10978
,
-
9254
,
-
1297
],
[
2704.1
,
-
1788.2
,
-
138.1
],
[
3884.
,
-
2650.8
,
-
138.1
]])
self
.
znum
=
4
...
...
@@ -77,6 +79,7 @@ class SimulatedRaman(RamanBase):
def
moveToAbsolutePosition
(
self
,
x
,
y
,
z
=
None
,
epsxy
=
0.11
,
epsz
=
0.011
,
debugReturn
=
False
,
measurementRunning
=
False
):
assert
self
.
connected
print
(
'moving to:'
,
x
,
y
,
z
,
file
=
stdout
)
if
z
is
None
:
self
.
currentpos
=
x
,
y
,
self
.
currentpos
[
2
]
else
:
...
...
viewitems.py
View file @
cfa964ed
...
...
@@ -113,49 +113,51 @@ class SegmentationContours(QtWidgets.QGraphicsItem):
self
.
update
()
def
contextMenuEvent
(
self
,
event
):
contextMenu
=
QtWidgets
.
QMenu
(
"Particle options"
)
combineMenu
=
QtWidgets
.
QMenu
(
"Combine Particles into"
)
combineActs
=
[]
assignments
=
[]
for
index
in
self
.
selectedContours
:
# partIndex = int(np.where(self.parent.dataset.ramanscansortindex == index)[0])
partIndex
=
index
assignments
.
append
(
self
.
parent
.
analysiswidget
.
datastats
.
particleResults
[
partIndex
])
assignments
.
append
(
"other"
)
for
assignment
in
np
.
unique
(
np
.
array
(
assignments
)):
combineActs
.
append
(
combineMenu
.
addAction
(
assignment
))
reassignActs
=
[]
reassignMenu
=
QtWidgets
.
QMenu
(
"Reassign particle(s) into"
)
for
polymer
in
self
.
parent
.
analysiswidget
.
datastats
.
getUniquePolymers
():
reassignActs
.
append
(
reassignMenu
.
addAction
(
polymer
))
reassignActs
.
append
(
reassignMenu
.
addAction
(
"other"
))
contextMenu
.
addMenu
(
combineMenu
)
contextMenu
.
addMenu
(
reassignMenu
)
deleteAct
=
contextMenu
.
addAction
(
"Delete Particle(s)"
)
numParticles
=
len
(
self
.
selectedContours
)
if
numParticles
==
0
:
reassignMenu
.
setDisabled
(
True
)
combineMenu
.
setDisabled
(
True
)
deleteAct
.
setDisabled
(
True
)
elif
numParticles
==
1
:
combineMenu
.
setDisabled
(
True
)
action
=
contextMenu
.
exec_
(
event
.
screenPos
())
if
action
==
deleteAct
:
print
(
'deleting'
)
elif
action
in
combineActs
:
newAssignment
=
action
.
text
()
self
.
parent
.
analysiswidget
.
editor
.
combineParticles
(
self
.
selectedContours
,
newAssignment
)
if
self
.
parent
.
analysiswidget
is
not
None
:
contextMenu
=
QtWidgets
.
QMenu
(
"Particle options"
)
combineMenu
=
QtWidgets
.
QMenu
(
"Combine Particles into"
)
combineActs
=
[]
assignments
=
[]
for
index
in
self
.
selectedContours
:
# partIndex = int(np.where(self.parent.dataset.ramanscansortindex == index)[0])
partIndex
=
index
assignments
.
append
(
self
.
parent
.
analysiswidget
.
datastats
.
particleResults
[
partIndex
])
assignments
.
append
(
"other"
)
for
assignment
in
np
.
unique
(
np
.
array
(
assignments
)):
combineActs
.
append
(
combineMenu
.
addAction
(
assignment
))
reassignActs
=
[]
reassignMenu
=
QtWidgets
.
QMenu
(
"Reassign particle(s) into"
)
for
polymer
in
self
.
parent
.
analysiswidget
.
datastats
.
getUniquePolymers
():
reassignActs
.
append
(
reassignMenu
.
addAction
(
polymer
))
reassignActs
.
append
(
reassignMenu
.
addAction
(
"other"
))
elif
action
in
reassignActs
:
newAssignment
=
action
.
text
()
self
.
parent
.
analysiswidget
.
editor
.
reassignParticles
(
self
.
selectedContours
,
newAssignment
)
contextMenu
.
addMenu
(
combineMenu
)
contextMenu
.
addMenu
(
reassignMenu
)
deleteAct
=
contextMenu
.
addAction
(
"Delete Particle(s)"
)
numParticles
=
len
(
self
.
selectedContours
)
if
numParticles
==
0
:
reassignMenu
.
setDisabled
(
True
)
combineMenu
.
setDisabled
(
True
)
deleteAct
.
setDisabled
(
True
)
elif
numParticles
==
1
:
combineMenu
.
setDisabled
(
True
)
action
=
contextMenu
.
exec_
(
event
.
screenPos
())
if
action
==
deleteAct
:
print
(
'deleting'
)
elif
action
in
combineActs
:
newAssignment
=
action
.
text
()
self
.
parent
.
analysiswidget
.
editor
.
combineParticles
(
self
.
selectedContours
,
newAssignment
)
elif
action
in
reassignActs
:
newAssignment
=
action
.
text
()
self
.
parent
.
analysiswidget
.
editor
.
reassignParticles
(
self
.
selectedContours
,
newAssignment
)
class
FitPosIndicator
(
QtWidgets
.
QGraphicsItem
):
...
...
zeissimporter.py
View file @
cfa964ed
...
...
@@ -186,10 +186,12 @@ class ZeissImporter(QtWidgets.QDialog):
dataset
.
coordinatetransform
=
T
,
pc
# set image center as reference point in data set (use Zeiss coordinates)
p0
=
np
.
array
([
self
.
region
.
centerx
,
self
.
region
.
centery
])
-
zpc
[:
2
]
p0center
=
np
.
array
([
self
.
region
.
centerx
,
self
.
region
.
centery
])
-
zpc
[:
2
]
p0
=
p0center
-
.
5
*
np
.
array
((
self
.
region
.
width
,
self
.
region
.
height
))
p1
=
p0center
+
.
5
*
np
.
array
((
self
.
region
.
width
,
self
.
region
.
height
))
dataset
.
readin
=
False
dataset
.
lastpos
=
p0
dataset
.
maxdim
=
p0
+
p
0
dataset
.
maxdim
=
p0
+
p
1
zmin
,
zmax
=
dataset
.
zpositions
.
min
(),
dataset
.
zpositions
.
max
()
blur
=
(
blur
)
*
(
255.
)
...
...
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