File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1313from .base import FourierOperatorBase
1414
1515from .interfaces .utils import is_cuda_array
16+ import warnings
17+ from scipy .ndimage import zoom
1618
1719if CUPY_AVAILABLE :
1820 import cupy as cp
@@ -238,7 +240,18 @@ def __init__(
238240 self .shape = fourier_op .shape
239241 self .smaps = fourier_op .smaps
240242 self .autograd_available = fourier_op .autograd_available
241-
243+ if b0_map is not None :
244+ b0_map = np .asarray (b0_map , dtype = np .float32 )
245+ if b0_map .shape != self .shape :
246+ warnings .warn (
247+ f"B0 map shape { b0_map .shape } does not match operator \
248+ shape { self .shape } . "
249+ "Upsampling will be performed automatically.\
250+ Please ensure orientation is correct." ,
251+ UserWarning ,
252+ )
253+ zoom_factors = tuple (t / c for t , c in zip (self .shape , b0_map .shape ))
254+ b0_map = zoom (b0_map , zoom_factors , order = 1 )
242255 if B is not None and tl is not None :
243256 self .B = self .xp .asarray (B )
244257 self .tl = self .xp .asarray (tl )
You can’t perform that action at this time.
0 commit comments