xnatqa 0.0.16__tar.gz → 0.0.17__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xnatqa
3
- Version: 0.0.16
3
+ Version: 0.0.17
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xnatqa"
3
- version = "0.0.16"
3
+ version = "0.0.17"
4
4
  authors = [
5
5
  { name="Kyle Kurkela", email="kkurkela@bu.edu" },
6
6
  ]
@@ -12,9 +12,11 @@ def main():
12
12
  # parse input arguments
13
13
  parser = argparse.ArgumentParser(description="XNAT QA Workflow")
14
14
  parser.add_argument("--experiment", default = "", required=True)
15
+ parser.add_argument("--dryrun", default = "", action='store_true', help="Run in dry run mode: No launching of jobs")
15
16
 
16
17
  args, unknown_args = parser.parse_known_args()
17
18
  MRsession = args.experiment
19
+ dryrun = args.dryrun
18
20
 
19
21
  # authenticate with xnat using the ~/.xnat_auth file created earlier in the workflow
20
22
  auth = yaxil.auth(alias = 'xnat')
@@ -33,12 +35,16 @@ def main():
33
35
 
34
36
  # if that note has a "#BOLD" tag...
35
37
  if '#BOLD' in note:
36
- print('Run BOLDQC')
37
- os.system(f'qsub -P cncxnat boldqc.qsub {MRsession} {b}')
38
+ print('Run BOLDQC:')
39
+ print(f'qsub -P cncxnat boldqc.qsub {MRsession} {b}')
40
+ if not dryrun:
41
+ os.system(f'qsub -P cncxnat boldqc.qsub {MRsession} {b}')
38
42
  b+=1
39
43
 
40
44
  # if that note has a "#T1w" tag...
41
45
  if '#T1w' in note:
42
- print('Run ANATQC')
43
- os.system(f'qsub -P cncxnat anatqc.qsub {MRsession} {a}')
46
+ print('Run ANATQC:')
47
+ print(f'qsub -P cncxnat anatqc.qsub {MRsession} {a}')
48
+ if not dryrun:
49
+ os.system(f'qsub -P cncxnat anatqc.qsub {MRsession} {a}')
44
50
  a+=1
@@ -188,11 +188,12 @@ def update_xnat_tags(MRsession):
188
188
  # run the command
189
189
  os.system(f'xnat_tagger.py --label {MRsession} --target-modality all --xnat-alias xnat --config tagger.yaml')
190
190
 
191
- def tag_scans(dicom_dir, MRsession):
191
+ def tag_scans(dicom_dir, MRsession, dryrun):
192
192
 
193
193
  # generate the xnattag config file
194
194
  generate_tagger_config(dicom_dir)
195
195
 
196
196
  # update the xnat tags
197
- update_xnat_tags(MRsession)
197
+ if not dryrun:
198
+ update_xnat_tags(MRsession)
198
199
 
@@ -8,17 +8,19 @@ def main():
8
8
  parser = argparse.ArgumentParser(description="XNAT QA Workflow")
9
9
  parser.add_argument("--dicom_dir", default="/input", help = "where the DICOMs are located", required=True)
10
10
  parser.add_argument("--experiment", default = "", required=True)
11
+ parser.add_argument("--dryrun", default = "", action='store_true', help="Run in dry run mode: No upload to XNAT")
11
12
 
12
13
  args, unknown_args = parser.parse_known_args()
13
14
  dicom_dir = os.path.join(args.dicom_dir, 'SCANS')
14
15
  experiment = args.experiment
16
+ dryrun = args.dryrun
15
17
 
16
18
  # run xnat authentication for this container. writes an ~/.xnat_auth file to the home directory
17
19
  # this file is used in all subsequent calls to XNAT
18
20
  os.system(f'xnat_auth --alias xnat --url $XNAT_HOST --username $XNAT_USER --password $XNAT_PASS')
19
21
 
20
22
  # tag all scans in this session
21
- tag_scans(dicom_dir, experiment)
23
+ tag_scans(dicom_dir, experiment, dryrun)
22
24
 
23
25
  if __name__ == "__main__":
24
26
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xnatqa
3
- Version: 0.0.16
3
+ Version: 0.0.17
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
File without changes
File without changes
File without changes
File without changes