Skip to content

Commit 5ce0bd5

Browse files
committed
Add NLINV reco example.
1 parent 9782e9c commit 5ce0bd5

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

bartfire.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# Don't write to /tmp/share in cfl
1616
os.environ["TMPDIR"] = "/tmp"
1717

18+
use_nlinv = False
19+
1820
def process(connection, config, metadata):
1921
logging.info("Config: \n%s", config)
2022

@@ -48,7 +50,7 @@ def process(connection, config, metadata):
4850
if isinstance(item, ismrmrd.Acquisition):
4951
# Accumulate all imaging readouts in a group
5052
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
5254
not item.is_flag_set(ismrmrd.ACQ_IS_PHASECORR_DATA)):
5355
acqGroup.append(item)
5456

@@ -134,13 +136,26 @@ def process_raw(group, config, metadata):
134136
logging.debug("Raw data is size %s" % (data.shape,))
135137
np.save(debugFolder + "/" + "raw.npy", data)
136138

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)
140157

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)
144159

145160
logging.debug("Image data is size %s" % (data.shape,))
146161
np.save(debugFolder + "/" + "img.npy", data)

0 commit comments

Comments
 (0)