Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIDS Handler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Toumji Abdallah
BIDS Handler
Commits
f6e5b897
Commit
f6e5b897
authored
1 year ago
by
Toumji Abdallah
Browse files
Options
Downloads
Patches
Plain Diff
QoL saved the last directory opened for better user experience
parent
b389f0d8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
BIDSHandler/CreationTool/Application.py
+25
-7
25 additions, 7 deletions
BIDSHandler/CreationTool/Application.py
BIDSHandler/CreationTool/res/Requirements.json
+3
-0
3 additions, 0 deletions
BIDSHandler/CreationTool/res/Requirements.json
with
28 additions
and
7 deletions
BIDSHandler/CreationTool/Application.py
+
25
−
7
View file @
f6e5b897
...
...
@@ -368,6 +368,8 @@ class Application(tk.Frame):
command
=
self
.
next_step
)
self
.
integrate_data_confirm_button
.
pack
()
self
.
previous_directory
=
None
def
integrate_data_file
(
self
):
"""
This method is used to integrate a file to the new BIDS project.
...
...
@@ -390,7 +392,11 @@ class Application(tk.Frame):
The user is prompted to select the file to integrate to the new BIDS project.
The confirm button is enabled after the file is selected.
"""
if
self
.
previous_directory
is
not
None
:
self
.
experiment_file
=
tk
.
filedialog
.
askopenfilename
(
initialdir
=
self
.
previous_directory
)
else
:
self
.
experiment_file
=
tk
.
filedialog
.
askopenfilename
()
self
.
previous_directory
=
os
.
path
.
dirname
(
self
.
experiment_file
)
self
.
integrate_data_window
.
lift
()
self
.
integrate_data_label
.
config
(
text
=
'
File selected:
'
+
self
.
experiment_file
)
...
...
@@ -414,18 +420,20 @@ class Application(tk.Frame):
self
.
integrate_data_button
.
grid_forget
()
# To Do : make this method generic by using a json file
self
.
task_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Task:
'
,
font
=
(
'
Arial
'
,
12
,
'
bold
'
))
font
=
tk
.
font
.
nametofont
(
"
TkDefaultFont
"
).
actual
().
copy
()
font
[
"
weight
"
]
=
"
bold
"
self
.
task_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Task:
'
,
font
=
font
)
self
.
task_label
.
grid
(
row
=
1
,
column
=
0
)
self
.
task_entry
=
Entry
(
self
.
integrate_data_window
,
label
=
self
.
task_label
,
row
=
1
,
column
=
1
,
columnspan
=
1
,
valid_condition
=
'
len(value) > 0
'
)
self
.
acquisition_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Acquisition:
'
,
font
=
(
'
Arial
'
,
12
,
'
normal
'
))
font
[
"
weight
"
]
=
"
normal
"
self
.
acquisition_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Acquisition:
'
,
font
=
font
)
self
.
acquisition_label
.
grid
(
row
=
2
,
column
=
0
)
self
.
acquisition_entry
=
Entry
(
self
.
integrate_data_window
,
label
=
self
.
acquisition_label
,
row
=
2
,
column
=
1
,
columnspan
=
1
,
valid_condition
=
'
len(value) > 0
'
)
self
.
run_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Run:
'
,
font
=
(
'
Arial
'
,
12
,
'
normal
'
)
)
self
.
run_label
=
tk
.
Label
(
self
.
integrate_data_window
,
text
=
'
Run:
'
,
font
=
font
)
self
.
run_label
.
grid
(
row
=
3
,
column
=
0
)
self
.
run_entry
=
Entry
(
self
.
integrate_data_window
,
label
=
self
.
run_label
,
row
=
3
,
column
=
1
,
columnspan
=
1
,
valid_condition
=
'
len(value) > 0
'
)
...
...
@@ -522,6 +530,8 @@ class Application(tk.Frame):
command
=
lambda
:
os
.
startfile
(
self
.
project_directory
))
open_project_button
.
pack
()
self
.
previous_directory
=
None
def
integrate_sidecar_file
(
self
):
"""
This method is used to integrate a sidecar to the new BIDS project.
...
...
@@ -624,7 +634,11 @@ class Application(tk.Frame):
"""
self
.
sidecar_type_label
.
destroy
()
self
.
sidecar_type_dropdown
.
destroy
()
if
self
.
previous_directory
is
not
None
:
self
.
sidecar_file
=
tk
.
filedialog
.
askopenfilename
(
initialdir
=
self
.
previous_directory
)
else
:
self
.
sidecar_file
=
tk
.
filedialog
.
askopenfilename
()
self
.
previous_directory
=
os
.
path
.
dirname
(
self
.
sidecar_file
)
self
.
sidecar_file
=
self
.
sidecar_file
.
replace
(
'
\\
'
,
'
/
'
)
self
.
integrate_sidecar_window
.
lift
()
self
.
integrate_sidecar_label
.
config
(
text
=
'
File selected:
'
+
self
.
sidecar_file
)
...
...
@@ -686,7 +700,11 @@ class Application(tk.Frame):
The user is also shown a dropdown menu to select the type of the sidecar (e.g. channels, events, etc.).
The option are loaded from a json file.
"""
if
self
.
previous_directory
is
not
None
:
self
.
sidecar_file
=
tk
.
filedialog
.
askopenfilename
(
initialdir
=
self
.
previous_directory
)
else
:
self
.
sidecar_file
=
tk
.
filedialog
.
askopenfilename
()
self
.
previous_directory
=
os
.
path
.
dirname
(
self
.
sidecar_file
)
self
.
integrate_sidecar_window
.
lift
()
self
.
integrate_sidecar_label
.
config
(
text
=
'
File selected:
'
+
self
.
sidecar_file
)
...
...
This diff is collapsed.
Click to expand it.
BIDSHandler/CreationTool/res/Requirements.json
+
3
−
0
View file @
f6e5b897
...
...
@@ -150,5 +150,8 @@
},
"LICENSE"
:
{
"description"
:
"A text file that provides the full license text for the dataset."
},
"CITATION.cff"
:
{
"description"
:
"A Citation File Format (CFF) file that provides citation information for the dataset."
}
}
\ No newline at end of file
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