xnatqa 0.0.9__py3-none-any.whl → 0.0.11__py3-none-any.whl

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/xnatqa.py CHANGED
@@ -1,34 +1,24 @@
1
1
  import os
2
2
  import argparse
3
3
  from xnatqa.tag import tag_scans
4
- from xnatqa.launch import launch
5
4
 
6
5
  def main():
7
6
 
8
7
  # parse input arguments
9
- parser = argparse.ArgumentParser(description="Auto Labeler")
8
+ parser = argparse.ArgumentParser(description="XNAT QA Workflow")
10
9
  parser.add_argument("--dicom_dir", default="/input", help = "where the DICOMs are located", required=True)
11
- parser.add_argument("--host", default="https://xnat2.bu.edu", help="BU XNAT host", required=True)
12
- parser.add_argument("--user", help="BU XNAT2 username", required=True)
13
- parser.add_argument("--password", help="BU XNAT2 Password", required=True)
14
10
  parser.add_argument("--experiment", default = "", required=True)
15
11
 
16
12
  args, unknown_args = parser.parse_known_args()
17
13
  dicom_dir = os.path.join(args.dicom_dir, 'SCANS')
18
- host = args.host
19
- user = args.user
20
- password = args.password
21
14
  experiment = args.experiment
22
15
 
23
16
  # run xnat authentication for this container. writes an ~/.xnat_auth file to the home directory
24
17
  # this file is used in all subsequent calls to XNAT
25
- os.system(f'xnat_auth --alias xnat --url {host} --username {user} --password {password}')
18
+ os.system(f'xnat_auth --alias xnat --url $XNAT_HOST --username $XNAT_USER --password $XNAT_PASS')
26
19
 
27
20
  # tag all scans in this session
28
21
  tag_scans(dicom_dir, experiment)
29
22
 
30
- # launch all QA jobs for this session
31
- launch(experiment)
32
-
33
23
  if __name__ == "__main__":
34
24
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xnatqa
3
- Version: 0.0.9
3
+ Version: 0.0.11
4
4
  Summary: A workflow for automatically labeling and running QA on MRI scans within XNAT
5
5
  Author-email: Kyle Kurkela <kkurkela@bu.edu>
6
6
  License-Expression: MIT
@@ -0,0 +1,9 @@
1
+ xnatqa/__init__.py,sha256=RIG_ihjfFD1upKlhlxI-9Fs4ISf0lIW4Zg7CaFirV4A,644
2
+ xnatqa/xnatqa.py,sha256=RJp65oIE13COs_0UG4hEku_f6YFDpoQV4JHEhtppXfs,861
3
+ xnatqa/tag/__init__.py,sha256=kjdB9zSA_YHGOPmG_BDM0HtSK6thmBt0Awd4Zj6NN5A,8921
4
+ xnatqa-0.0.11.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ xnatqa-0.0.11.dist-info/METADATA,sha256=viecCkDxux1GEdxGxDQxetiEDoklWT9U-AyJ7ZCqDpE,1200
6
+ xnatqa-0.0.11.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
7
+ xnatqa-0.0.11.dist-info/entry_points.txt,sha256=UqPAByHiJTqwkT0UBymn6EOIGBlPsb9mEZK86HIahs8,46
8
+ xnatqa-0.0.11.dist-info/top_level.txt,sha256=FmRWgO6ww0FwyNs5ccyhP9FcAxI129qSJqLs2OKOxJw,7
9
+ xnatqa-0.0.11.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
xnatqa/launch/__init__.py DELETED
@@ -1,36 +0,0 @@
1
- import os
2
- import yaxil
3
-
4
- def launch(MRsession):
5
- # So, at this point, everything has been labeled for this session.
6
- # We now need to:
7
-
8
- # Identify all of the tagged scans in this sessions
9
- # For each tagged scan, launch the appropriate QA routine
10
-
11
- # authenticate with xnat using the ~/.xnat_auth file created earlier in the workflow
12
- auth = yaxil.auth(alias = 'xnat')
13
-
14
- # open and automatically close a connection to XNAT using the auth
15
- with yaxil.session(auth) as sess:
16
- # keep track of the number of BOLD (b) and ANAT (a) scans idenfified
17
- b = 0
18
- a = 0
19
-
20
- # for each scan in this session...
21
- for scan in sess.scans(label=MRsession):
22
-
23
- # this scan's note
24
- note = scan['note']
25
-
26
- # if that note has a "#BOLD" tag...
27
- if '#BOLD' in note:
28
- print('Run BOLDQC')
29
- os.system(f'qsub -P drkrcs boldqc.qsub {MRsession} {b}')
30
- b+=1
31
-
32
- # if that note has a "#T1w" tag...
33
- if '#T1w' in note:
34
- print('Run ANATQC')
35
- os.system(f'qsub -P drkrcs anatqc.qsub {MRsession} {a}')
36
- a+=1
@@ -1,10 +0,0 @@
1
- xnatqa/__init__.py,sha256=RIG_ihjfFD1upKlhlxI-9Fs4ISf0lIW4Zg7CaFirV4A,644
2
- xnatqa/xnatqa.py,sha256=8W4iN98gWyVD8uVcdTkF3K7pFqrm6riBQaS90pq9ohk,1289
3
- xnatqa/launch/__init__.py,sha256=zT6XGXWBHOtHZ_TVmlN9vp3V8JqUAYscxMBUZJJBlgo,1178
4
- xnatqa/tag/__init__.py,sha256=kjdB9zSA_YHGOPmG_BDM0HtSK6thmBt0Awd4Zj6NN5A,8921
5
- xnatqa-0.0.9.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- xnatqa-0.0.9.dist-info/METADATA,sha256=3fDVZzf8u6yRY4fAlMrDuo5CsiIRWh0WILFmSRIdzX0,1199
7
- xnatqa-0.0.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- xnatqa-0.0.9.dist-info/entry_points.txt,sha256=UqPAByHiJTqwkT0UBymn6EOIGBlPsb9mEZK86HIahs8,46
9
- xnatqa-0.0.9.dist-info/top_level.txt,sha256=FmRWgO6ww0FwyNs5ccyhP9FcAxI129qSJqLs2OKOxJw,7
10
- xnatqa-0.0.9.dist-info/RECORD,,