|
15 | 15 | # Don't write to /tmp/share in cfl |
16 | 16 | os.environ["TMPDIR"] = "/tmp" |
17 | 17 |
|
| 18 | +use_nlinv = False |
| 19 | + |
18 | 20 | def process(connection, config, metadata): |
19 | 21 | logging.info("Config: \n%s", config) |
20 | 22 |
|
@@ -48,7 +50,7 @@ def process(connection, config, metadata): |
48 | 50 | if isinstance(item, ismrmrd.Acquisition): |
49 | 51 | # Accumulate all imaging readouts in a group |
50 | 52 | if (not item.is_flag_set(ismrmrd.ACQ_IS_NOISE_MEASUREMENT) and |
51 | | - not item.is_flag_set(ismrmrd.ACQ_IS_PARALLEL_CALIBRATION) and |
| 53 | + (use_nlinv or not item.is_flag_set(ismrmrd.ACQ_IS_PARALLEL_CALIBRATION)) and |
52 | 54 | not item.is_flag_set(ismrmrd.ACQ_IS_PHASECORR_DATA)): |
53 | 55 | acqGroup.append(item) |
54 | 56 |
|
@@ -134,13 +136,26 @@ def process_raw(group, config, metadata): |
134 | 136 | logging.debug("Raw data is size %s" % (data.shape,)) |
135 | 137 | np.save(debugFolder + "/" + "raw.npy", data) |
136 | 138 |
|
137 | | - # Fourier Transform with BART |
138 | | - logging.info("Calling BART FFT") |
139 | | - data = bart(1, 'fft -u -i 3', data) |
| 139 | + # Reconstruction with BART. |
| 140 | + if use_nlinv: |
| 141 | + logging.info("Calling BART NLINV") |
| 142 | + |
| 143 | + # coil compression to 8 channels |
| 144 | + data = bart(1, "cc -p8", data) |
| 145 | + |
| 146 | + # nlinv with debug level 4 and 13 gauss-newton steps. |
| 147 | + data = bart(1, "nlinv -d4 -i13", data) |
| 148 | + |
| 149 | + data = np.atleast_3d(abs(data)) |
| 150 | + |
| 151 | + else: |
| 152 | + logging.info("Calling BART FFT") |
| 153 | + data = bart(1, 'fft -u -i 3', data) |
| 154 | + |
| 155 | + # RSS with BART |
| 156 | + data = bart(1, 'rss 8', data) |
140 | 157 |
|
141 | | - # RSS with BART |
142 | | - data = bart(1, 'rss 8', data) |
143 | | - data = np.atleast_3d(data.real) |
| 158 | + data = np.atleast_3d(data.real) |
144 | 159 |
|
145 | 160 | logging.debug("Image data is size %s" % (data.shape,)) |
146 | 161 | np.save(debugFolder + "/" + "img.npy", data) |
|
0 commit comments