4
4
import ismrmrd .xsd
5
5
from ismrmrdtools import simulation , transform
6
6
import numpy as np
7
+ import argparse
7
8
8
9
def create (filename = 'testdata.h5' , matrix_size = 256 , coils = 8 , oversampling = 2 , repetitions = 1 , acceleration = 1 , noise_level = 0.05 ):
9
10
@@ -82,7 +83,7 @@ def create(filename='testdata.h5', matrix_size=256, coils=8, oversampling=2, rep
82
83
limits1 .minimum = 0
83
84
limits1 .center = ny / 2
84
85
limits1 .maximum = ny - 1
85
- limits .kspaceEncodingStep1 = limits1
86
+ limits .kspace_encoding_step_1 = limits1
86
87
87
88
limits_rep = ismrmrd .xsd .limitType ()
88
89
limits_rep .minimum = 0
@@ -94,7 +95,7 @@ def create(filename='testdata.h5', matrix_size=256, coils=8, oversampling=2, rep
94
95
limits_rest .minimum = 0
95
96
limits_rest .center = 0
96
97
limits_rest .maximum = 0
97
- limits .kspaceEncodingStep0 = limits_rest
98
+ limits .kspace_encoding_step_0 = limits_rest
98
99
limits .slice = limits_rest
99
100
limits .average = limits_rest
100
101
limits .contrast = limits_rest
@@ -163,3 +164,25 @@ def create(filename='testdata.h5', matrix_size=256, coils=8, oversampling=2, rep
163
164
164
165
# Clean up
165
166
dset .close ()
167
+
168
+
169
+ def main ():
170
+ parser = argparse .ArgumentParser (formatter_class = argparse .ArgumentDefaultsHelpFormatter )
171
+ parser .add_argument ('-o' , '--output' , help = 'output filename' )
172
+ parser .add_argument ('-m' , '--matrix-size' , type = int , dest = 'matrix_size' , help = 'k-space matrix size' )
173
+ parser .add_argument ('-c' , '--coils' , type = int , help = 'number of coils' )
174
+ parser .add_argument ('-s' , '--oversampling' , type = int , help = 'oversampling' )
175
+ parser .add_argument ('-r' , '--repetitions' , type = int , help = 'number of repetitions' )
176
+ parser .add_argument ('-a' , '--acceleration' , type = int , help = 'acceleration' )
177
+ parser .add_argument ('-n' , '--noise-level' , type = float , dest = 'noise_level' , help = 'noise level' )
178
+
179
+ parser .set_defaults (output = 'testdata.h5' , matrix_size = 256 , coils = 8 ,
180
+ oversampling = 2 , repetitions = 1 , acceleration = 1 , noise_level = 0.05 )
181
+
182
+ args = parser .parse_args ()
183
+
184
+ create (args .output , args .matrix_size , args .coils , args .oversampling ,
185
+ args .repetitions , args .acceleration , args .noise_level )
186
+
187
+ if __name__ == "__main__" :
188
+ main ()
0 commit comments