-
Notifications
You must be signed in to change notification settings - Fork 2
/
qmri-neuropipe.py
executable file
·75 lines (56 loc) · 2.35 KB
/
qmri-neuropipe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
import os,sys, shutil, json, argparse, copy
from distutils.util import strtobool
from core.anatomical.anat_proc import AnatomicalPrepPipeline
from core.dmri.dmri_proc import DiffusionProcessingPipeline
from core.qmri.despot_proc import DESPOTProcessingPipeline
from core.segmentation.segment_proc import SegmentationPipeline
parser = argparse.ArgumentParser(description='Waisman Center Processing for Quantitative MRI Data in BIDS format')
parser.add_argument('--load_json',
type=str,
help='Load settings from file in json format. Command line options are overriden by values in file.',
default=None)
parser.add_argument('--anat_proc_pipeline',
type=bool,
help='Preprocess the Anataomical Imaging Data',
default=False)
parser.add_argument('--dwi_proc_pipeline',
type=bool,
help='Process Diffusion Imaging Data',
default=False)
parser.add_argument('--despot_proc_pipeline',
type=bool,
help='Process DESPOT Imaging Data',
default=False)
parser.add_argument('--segmentation_pipeline',
type=bool,
help='Run Structural Segmentation',
default=False)
parser.add_argument('--verbose',
type=bool,
help='Print out information meassages and progress status',
default=False)
args, unknown = parser.parse_known_args()
if args.load_json:
with open(args.load_json, 'rt') as f:
t_args = argparse.Namespace()
t_dict = vars(t_args)
t_dict.update(json.load(f))
args, unknown = parser.parse_known_args(namespace=t_args)
##################################
##################################
##### PROCESSING STARTS HERE #####
##################################
##################################
if args.anat_proc_pipeline:
anat_pipeline = AnatomicalPrepPipeline()
anat_pipeline.run()
if args.dwi_proc_pipeline:
dwi_pipeline = DiffusionProcessingPipeline()
dwi_pipeline.run()
if args.despot_proc_pipeline:
despot_pipeline = DESPOTProcessingPipeline()
despot_pipeline.run()
if args.segmentation_pipeline:
seg_pipeline = SegmentationPipeline()
seg_pipeline.run()