@@ -63,7 +63,6 @@ def _job_model_T2s(
6363 dyn_datas : list [DynamicData ],
6464 sim_conf : SimConfig ,
6565 trajectories : NDArray , # (Chunksize, N, 3)
66- smaps : NDArray ,
6766 slice_2d : bool = False ,
6867 ) -> np .ndarray :
6968 """Acquire k-space data. With T2s decay."""
@@ -107,18 +106,20 @@ def _job_model_T2s(
107106 slice_location = flat_epi [0 , 0 ] # FIXME: the slice is always axial.
108107 flat_epi = flat_epi [:, 1 :]
109108 phantom_slice = phantom_state [:, slice_location ]
110- if smaps is None :
109+ if phantom . smaps is None :
111110 phantom_slice = phantom_slice [:, None , ...]
112111 else :
113- smaps_ = smaps [:, slice_location ]
112+ smaps_ = phantom . smaps [:, slice_location ]
114113 phantom_slice = phantom_slice [:, None , ...] * smaps_
115114
116115 ksp = fft (phantom_slice , axis = (- 2 , - 1 ))
117116 else :
118- if smaps is None :
117+ if phantom . smaps is None :
119118 ksp = fft (phantom_state [:, None , ...], axis = (- 3 , - 2 , - 1 ))
120119 else :
121- ksp = fft (phantom_state [:, None , ...] * smaps , axis = (- 3 , - 2 , - 1 ))
120+ ksp = fft (
121+ phantom_state [:, None , ...] * phantom .smaps , axis = (- 3 , - 2 , - 1 )
122+ )
122123
123124 for c in range (sim_conf .hardware .n_coils ):
124125 ksp_coil_sum = np .zeros (
@@ -135,7 +136,6 @@ def _job_model_simple(
135136 dyn_datas : list [DynamicData ],
136137 sim_conf : SimConfig ,
137138 trajectories : NDArray , # (Chunksize, N, 3)
138- smaps : NDArray ,
139139 slice_2d : bool = False ,
140140 ) -> np .ndarray :
141141 """Acquire k-space data. No T2s decay."""
@@ -157,17 +157,19 @@ def _job_model_simple(
157157 slice_location = flat_epi [0 , 0 ] # FIXME: the slice is always axial.
158158 flat_epi = flat_epi [:, 1 :] # Reduced to 2D.
159159 phantom_slice = phantom_state [slice_location ]
160- if smaps is None :
160+ if phantom . smaps is None :
161161 phantom_slice = phantom_slice [None , ...]
162162 else :
163- smaps_ = smaps [:, slice_location ]
163+ smaps_ = phantom . smaps [:, slice_location ]
164164 phantom_slice = phantom_slice [None , ...] * smaps_
165165 ksp = fft (phantom_slice , axis = (- 2 , - 1 ))
166166 else :
167- if smaps is None :
167+ if phantom . smaps is None :
168168 ksp = fft (phantom_state [None , ...], axis = (- 3 , - 2 , - 1 ))
169169 else :
170- ksp = fft (phantom_state [None , ...] * smaps , axis = (- 3 , - 2 , - 1 ))
170+ ksp = fft (
171+ phantom_state [None , ...] * phantom .smaps , axis = (- 3 , - 2 , - 1 )
172+ )
171173 for c in range (sim_conf .hardware .n_coils ):
172174 ksp_coil = ksp [c ]
173175 a = ksp_coil [tuple (flat_epi .T )]
@@ -247,7 +249,6 @@ def _job_model_T2s(
247249 dyn_datas : list [DynamicData ],
248250 sim_conf : SimConfig ,
249251 trajectories : NDArray , # (Chunksize, N, 3)
250- smaps : NDArray ,
251252 ) -> np .ndarray :
252253 """Acquire k-space data. With T2s decay."""
253254 readout_length = trajectories .shape [- 2 ]
@@ -299,10 +300,12 @@ def _job_model_T2s(
299300 * frame_phantom .masks
300301 )
301302
302- if smaps is None :
303+ if phantom . smaps is None :
303304 ksp = fft (phantom_state [:, None , ...], axis = (- 3 , - 2 , - 1 ))
304305 else :
305- ksp = fft (phantom_state [:, None , ...] * smaps , axis = (- 3 , - 2 , - 1 ))
306+ ksp = fft (
307+ phantom_state [:, None , ...] * phantom .smaps , axis = (- 3 , - 2 , - 1 )
308+ )
306309 flat_evi = evi .reshape (- 1 , 3 )
307310 for c in range (sim_conf .hardware .n_coils ):
308311 ksp_coil_sum = np .zeros (
@@ -322,7 +325,6 @@ def _job_model_simple(
322325 dyn_datas : list [DynamicData ],
323326 sim_conf : SimConfig ,
324327 trajectories : NDArray , # (Chunksize, N, 3)
325- smaps : NDArray ,
326328 ) -> np .ndarray :
327329 """Acquire k-space data. No T2s decay."""
328330 final_ksp = np .zeros (
@@ -351,10 +353,10 @@ def _job_model_simple(
351353 * frame_phantom .masks ,
352354 axis = 0 ,
353355 )
354- if smaps is None :
356+ if phantom . smaps is None :
355357 ksp = fft (phantom_state [None , ...], axis = (- 3 , - 2 , - 1 ))
356358 else :
357- ksp = fft (phantom_state [None , ...] * smaps , axis = (- 3 , - 2 , - 1 ))
359+ ksp = fft (phantom_state [None , ...] * phantom . smaps , axis = (- 3 , - 2 , - 1 ))
358360 flat_epi = epi_2d .reshape (- 1 , 3 )
359361 for c in range (sim_conf .hardware .n_coils ):
360362 ksp_coil = ksp [c ]
0 commit comments