Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MEG Metadata Importer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Ben Wagner
MEG Metadata Importer
Commits
c17674d5
Commit
c17674d5
authored
1 year ago
by
Ben Wagner
Browse files
Options
Downloads
Patches
Plain Diff
Gear runs in both Session and in Batch
parent
1da00c21
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifest.json
+2
-2
2 additions, 2 deletions
manifest.json
run.py
+11
-5
11 additions, 5 deletions
run.py
with
13 additions
and
7 deletions
manifest.json
+
2
−
2
View file @
c17674d5
...
...
@@ -16,7 +16,7 @@
},
"gear-builder"
:
{
"category"
:
"utility"
,
"image"
:
"ansir/meg-metadata-importer:0.0.02
8
"
"image"
:
"ansir/meg-metadata-importer:0.0.0
3
2"
}
},
"description"
:
"Import file metadata into Flywheel. Metadata is stored under file.info.header. May also update blank fields in acquisition, session, and subject. Supports FIFF files."
,
...
...
@@ -42,5 +42,5 @@
"name"
:
"meg-metadata-importer"
,
"source"
:
"https://git.biohpc.swmed.edu/ben.wagner/meg-metadata-importer"
,
"url"
:
"https://git.biohpc.swmed.edu/ben.wagner/meg-metadata-importer"
,
"version"
:
"0.0.02
8
"
"version"
:
"0.0.0
3
2"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
run.py
+
11
−
5
View file @
c17674d5
...
...
@@ -19,9 +19,9 @@ log = logging.getLogger(__name__)
def
main
(
context
):
pp
=
pprint
.
PrettyPrinter
(
indent
=
4
)
print
(
"
config_json:
"
)
pp
.
pprint
(
context
.
config_json
)
#
pp = pprint.PrettyPrinter(indent=4)
#
print("config_json:")
#
pp.pprint(context.config_json)
in_file
=
context
.
get_input_path
(
"
input-file
"
)
print
(
f
"
Examining:
{
in_file
}
"
)
...
...
@@ -86,7 +86,7 @@ def main(context):
context
.
metadata
.
update_file
(
os
.
path
.
split
(
in_file
)[
1
],
info
=
file_info
)
if
not
context
.
config
.
get
(
"
nonfile_metadata
"
):
return
0
print
(
"
Checking for nonfile metadata to update
"
)
#
print("Checking for nonfile metadata to update")
# Possible items to update (only if empty)
#
...
...
@@ -111,7 +111,13 @@ def main(context):
# context.metadata.update_container("acquisition", some_dict)
# initalize SDK and get session info
acq
=
context
.
client
.
get
(
context
.
destination
[
"
id
"
])
# This doesn't work as destination["id"] is acquisition from "Run Batch Gear", but session from "Run Gear"
# acq = context.client.get(context.destination["id"])
# print("input: input-file:")
# pp.pprint(context.get_input("input-file"))
acq_id
=
context
.
get_input
(
"
input-file
"
)[
"
hierarchy
"
][
"
id
"
]
acq
=
context
.
client
.
get
(
acq_id
)
session_id
=
acq
[
"
parents
"
][
"
session
"
]
subject_id
=
acq
[
"
parents
"
][
"
subject
"
]
project_id
=
acq
[
"
parents
"
][
"
project
"
]
...
...
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