-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDwDataImportAndQSpace.py
106 lines (87 loc) · 3.53 KB
/
DwDataImportAndQSpace.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import os, json, sys, shutil
sys.path.insert( 0, os.path.join( os.sep, 'usr', 'share', 'gkg', 'python' ) )
from CopyFileDirectoryRm import *
def runDwImportAndQspace( Dir,
subject,
verbose ):
if ( verbose == True ):
#-----------------------------------------------------------------------------
# Make Directories and Inputs
#-----------------------------------------------------------------------------
makedir( os.path.join( Dir,
subject,
'02-Diffusion',
'03-DWIAndQSpace' ) )
dw_Shell1 = os.path.join( Dir,
subject,
'02-Diffusion',
'01-TopUp',
'dw_01_eddy_corrected_data')
dw_Shell2 = os.path.join( Dir,
subject,
'02-Diffusion',
'01-TopUp',
'dw_02_eddy_corrected_data')
dw_Shell3 = os.path.join( Dir,
subject,
'02-Diffusion',
'01-TopUp',
'dw_03_eddy_corrected_data')
txt_Shell1 = os.path.join( Dir,
subject,
'02-Diffusion',
'00-Dicom-to-Gis',
'dw_01')
txt_Shell2 = os.path.join( Dir,
subject,
'02-Diffusion',
'00-Dicom-to-Gis',
'dw_02')
txt_Shell3 = os.path.join( Dir,
subject,
'02-Diffusion',
'00-Dicom-to-Gis',
'dw_03')
#-----------------------------------------------------------------------------
# DWIAndQSpace
#-----------------------------------------------------------------------------
parameterValues = {
'_algorithmName' : 'DWI-Data-Import-And-QSpace-Sampling',
'_subjectName' : '',
'acqpFileNames' : '',
'applyVisuCoreTransformation' : 1,
'bValFileNames' : '',
'bValueStdDev' : 10.0,
'bValueThreshold' : 10.0,
'bVecFileNames' : '',
'fileNameDwi' : '',
'gradientCharacteristicsFileNames' : '',
'invertXAxis' : 0,
'invertYAxis' : 0,
'invertZAxis' : 0,
'manufacturer' : 3,
'methodFileNames' : '',
'outputWorkDirectory' : '',
'phaseAxis' : 1,
'qSpaceSamplingType' : 2,
'sliceAxis' : 0,
'visuParsFileNames' : ''
}
dwiFile = dw_Shell1 + '.ima' + ';' + \
dw_Shell2 + '.ima' + ';' + \
dw_Shell3 + '.ima'
bvalFile = txt_Shell1 + '.bval' + ';' + \
txt_Shell2 + '.bval' + ';' + \
txt_Shell3 + '.bval'
bvecFile = dw_Shell1 + '.eddy_rotated_bvecs' + ';' + \
dw_Shell2 + '.eddy_rotated_bvecs' + ';' + \
dw_Shell3 + '.eddy_rotated_bvecs'
outputFolder = os.path.join( Dir,
subject,
'02-Diffusion',
'03-DWIAndQSpace' )
parameterValues[ 'fileNameDwi' ] = dwiFile
parameterValues[ 'bValFileNames' ] = bvalFile
parameterValues[ 'bVecFileNames' ] = bvecFile
runGinkgo( parameterValues, outputFolder )
print( 'Done' )