xnatqa 0.0.14__tar.gz → 0.0.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xnatqa-0.0.14/xnatqa.egg-info → xnatqa-0.0.16}/PKG-INFO +2 -2
- {xnatqa-0.0.14 → xnatqa-0.0.16}/pyproject.toml +3 -2
- xnatqa-0.0.16/xnatqa/launch.py +44 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa/tag/__init__.py +1 -3
- {xnatqa-0.0.14 → xnatqa-0.0.16/xnatqa.egg-info}/PKG-INFO +2 -2
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa.egg-info/SOURCES.txt +1 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa.egg-info/entry_points.txt +1 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa.egg-info/requires.txt +1 -1
- {xnatqa-0.0.14 → xnatqa-0.0.16}/LICENSE +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/README.md +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/setup.cfg +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa/__init__.py +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa/xnatqa.py +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa.egg-info/dependency_links.txt +0 -0
- {xnatqa-0.0.14 → xnatqa-0.0.16}/xnatqa.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xnatqa
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: A workflow for automatically tagging MRI scans within XNAT
|
|
5
5
|
Author-email: Kyle Kurkela <kkurkela@bu.edu>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -11,7 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist:
|
|
14
|
+
Requires-Dist: xnattagger-kkurk
|
|
15
15
|
Requires-Dist: yaxil
|
|
16
16
|
Requires-Dist: pyyaml
|
|
17
17
|
Requires-Dist: glob2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xnatqa"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.16"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name="Kyle Kurkela", email="kkurkela@bu.edu" },
|
|
6
6
|
]
|
|
@@ -14,7 +14,7 @@ classifiers = [
|
|
|
14
14
|
license = "MIT"
|
|
15
15
|
license-files = ["LICEN[CS]E*"]
|
|
16
16
|
dependencies = [
|
|
17
|
-
"
|
|
17
|
+
"xnattagger-kkurk",
|
|
18
18
|
"yaxil",
|
|
19
19
|
"pyyaml",
|
|
20
20
|
"glob2"
|
|
@@ -22,6 +22,7 @@ dependencies = [
|
|
|
22
22
|
|
|
23
23
|
[project.scripts]
|
|
24
24
|
xnatqa = "xnatqa.xnatqa:main"
|
|
25
|
+
launch = "xnatqa.launch:main"
|
|
25
26
|
|
|
26
27
|
[project.urls]
|
|
27
28
|
Homepage = "https://github.com/kakurk/auto_labeler"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import yaxil
|
|
3
|
+
import argparse
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
# So, at this point, everything has been labeled for this session.
|
|
7
|
+
# We now need to:
|
|
8
|
+
|
|
9
|
+
# Identify all of the tagged scans in this sessions
|
|
10
|
+
# For each tagged scan, launch the appropriate QA routine
|
|
11
|
+
|
|
12
|
+
# parse input arguments
|
|
13
|
+
parser = argparse.ArgumentParser(description="XNAT QA Workflow")
|
|
14
|
+
parser.add_argument("--experiment", default = "", required=True)
|
|
15
|
+
|
|
16
|
+
args, unknown_args = parser.parse_known_args()
|
|
17
|
+
MRsession = args.experiment
|
|
18
|
+
|
|
19
|
+
# authenticate with xnat using the ~/.xnat_auth file created earlier in the workflow
|
|
20
|
+
auth = yaxil.auth(alias = 'xnat')
|
|
21
|
+
|
|
22
|
+
# open and automatically close a connection to XNAT using the auth
|
|
23
|
+
with yaxil.session(auth) as sess:
|
|
24
|
+
# keep track of the number of BOLD (b) and ANAT (a) scans idenfified
|
|
25
|
+
b = 0
|
|
26
|
+
a = 0
|
|
27
|
+
|
|
28
|
+
# for each scan in this session...
|
|
29
|
+
for scan in sess.scans(label=MRsession):
|
|
30
|
+
|
|
31
|
+
# this scan's note
|
|
32
|
+
note = scan['note']
|
|
33
|
+
|
|
34
|
+
# if that note has a "#BOLD" tag...
|
|
35
|
+
if '#BOLD' in note:
|
|
36
|
+
print('Run BOLDQC')
|
|
37
|
+
os.system(f'qsub -P cncxnat boldqc.qsub {MRsession} {b}')
|
|
38
|
+
b+=1
|
|
39
|
+
|
|
40
|
+
# if that note has a "#T1w" tag...
|
|
41
|
+
if '#T1w' in note:
|
|
42
|
+
print('Run ANATQC')
|
|
43
|
+
os.system(f'qsub -P cncxnat anatqc.qsub {MRsession} {a}')
|
|
44
|
+
a+=1
|
|
@@ -19,7 +19,7 @@ def generate_tagger_config(dicom_dir):
|
|
|
19
19
|
# This seems to work well most of the time, with the odd hicups. I include manual code here to catch the "hicups".
|
|
20
20
|
|
|
21
21
|
# call to dcm2niix. generates a bunch of *.json text files in the current working directory.
|
|
22
|
-
os.system(f"dcm2niix -s y -a y -b o -o $PWD -f 'output_%s_%d' -w 0 -m 1 -i y {dicom_dir}")
|
|
22
|
+
os.system(f"dcm2niix -s y -a y -b o -o $PWD -f 'output_%s_%d' -w 0 -m 1 -i y {dicom_dir} &>>log.txt")
|
|
23
23
|
|
|
24
24
|
# idenfity all of these text files
|
|
25
25
|
jsonFiles = glob(os.path.abspath('./output*.json'))
|
|
@@ -180,8 +180,6 @@ def generate_tagger_config(dicom_dir):
|
|
|
180
180
|
with open('tagger.yaml', 'a') as file:
|
|
181
181
|
yaml.dump(tagger_data, file)
|
|
182
182
|
|
|
183
|
-
print(tagger_data)
|
|
184
|
-
|
|
185
183
|
def update_xnat_tags(MRsession):
|
|
186
184
|
|
|
187
185
|
# make sure an xnat authentication files has already been created. See YXAIL documentation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xnatqa
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: A workflow for automatically tagging MRI scans within XNAT
|
|
5
5
|
Author-email: Kyle Kurkela <kkurkela@bu.edu>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -11,7 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist:
|
|
14
|
+
Requires-Dist: xnattagger-kkurk
|
|
15
15
|
Requires-Dist: yaxil
|
|
16
16
|
Requires-Dist: pyyaml
|
|
17
17
|
Requires-Dist: glob2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|