Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyNutil
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Harry Carey
PyNutil
Commits
e5bfcc5c
Commit
e5bfcc5c
authored
7 months ago
by
polarbean
Browse files
Options
Downloads
Patches
Plain Diff
started the linking of the GUI PyNutil function
parent
d4898fe9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PyNutilGUI.py
+34
-9
34 additions, 9 deletions
PyNutilGUI.py
with
34 additions
and
9 deletions
PyNutilGUI.py
+
34
−
9
View file @
e5bfcc5c
...
...
@@ -2,25 +2,34 @@ import tkinter
from
tkinter
import
*
from
tkinter
import
ttk
import
brainglobe_atlasapi
import
PyNutil
from
tkinter.filedialog
import
askopenfilename
from
tkinter
import
colorchooser
#Basic GUI example
root
=
Tk
()
#root.geometry("300x300")
root
.
title
(
"
PyNutil
"
)
root
.
wm_iconbitmap
(
"
Logo_PyNutil.ico
"
)
#photo = tkinter.PhotoImage(file = 'Logo_PyNutil.ico')
#root.wm_iconphoto(False, photo)
arguments
=
{
"
registration_json
"
:
None
,
"
object_colour
"
:
None
}
atlas
=
brainglobe_atlasapi
.
list_atlases
.
get_all_atlases_lastversions
()
atlas
=
[
"
Reference Atlas
"
,
"
Allen CCFv3
"
,
"
WHS v3
"
,
"
WHS v4
"
]
selected_atlas
=
StringVar
(
value
=
atlas
[
0
])
selected_atlas
=
StringVar
(
value
=
"
Reference Atlas
"
)
directory
=
[
"
select
"
,
"
select1
"
,
"
select2
"
]
selected_directory
=
StringVar
(
value
=
atlas
[
0
]
)
selected_directory
=
StringVar
(
value
=
"
directory
"
)
colour
=
[
"
colour
"
,
"
black
"
,
"
red
"
,
"
blue
"
,
"
green
"
]
selected_colour
=
StringVar
(
value
=
colour
[
0
])
# root.wm_iconbitmap("Logo_PyNutil.ico")
#photo = tkinter.PhotoImage(file = 'Logo_PyNutil.ico')
#root.wm_iconphoto(False, photo)
def
donothing
():
filewin
=
Toplevel
(
root
)
label
=
Label
(
filewin
,
text
=
"
Do nothing
"
)
...
...
@@ -72,17 +81,33 @@ ttk.Button(mainframe, text="Help", width=8, command="buttonpressed").grid(column
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
width
=
8
,
command
=
"
buttonpressed
"
).
grid
(
column
=
3
,
row
=
5
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Docs
"
,
width
=
8
,
command
=
"
buttonpressed
"
).
grid
(
column
=
3
,
row
=
6
,
sticky
=
W
)
def
open_registration_json
():
value
=
askopenfilename
()
arguments
[
"
registration_json
"
]
=
value
print
(
arguments
)
ttk
.
OptionMenu
(
mainframe
,
selected_atlas
,
*
atlas
).
grid
(
column
=
2
,
row
=
1
,
sticky
=
W
)
def
choose_colour
():
value
=
colorchooser
.
askcolor
()
arguments
[
"
object_colour
"
]
=
value
print
(
list
(
value
[
0
]))
def
start_analysis
():
#your code here
return
ttk
.
OptionMenu
(
mainframe
,
selected_atlas
,
"
Reference Atlas
"
,
*
atlas
).
grid
(
column
=
2
,
row
=
1
,
sticky
=
W
)
#ttk.OptionMenu(mainframe, selected_directory, *directory).grid(column=3, row=2, sticky=W)
#ttk.OptionMenu(mainframe, selected_directory, *directory).grid(column=3, row=3, sticky=W)
#ttk.OptionMenu(mainframe, selected_colour, *colour).grid(column=3, row=4, sticky=W)
#ttk.OptionMenu(mainframe, selected_directory, *directory).grid(column=3, row=5, sticky=W)
#ttk.Button(mainframe, width=16, text="Browse...", command="buttonpressed").grid(column=4, row=1, sticky=W)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
2
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Browse...
"
,
command
=
open_registration_json
).
grid
(
column
=
2
,
row
=
2
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
3
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Colour
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
4
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Colour
"
,
command
=
choose_colour
).
grid
(
column
=
2
,
row
=
4
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
5
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
width
=
16
,
text
=
"
Run
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
6
,
sticky
=
W
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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