@@ -380,7 +380,7 @@ def _setup_image(
380380 N = self .getGoodImageSize (1.0 )
381381 if odd :
382382 N += 1
383- bounds = BoundsI (1 , N , 1 , N )
383+ bounds = BoundsI (xmin = 1 , deltax = N , ymin = 1 , deltay = N )
384384 image .resize (bounds )
385385 # Else use the given image as is
386386
@@ -486,7 +486,7 @@ def _get_new_bounds(self, image, nx, ny, bounds, center):
486486 if image is not None and image .bounds .isDefined ():
487487 return image .bounds
488488 elif nx is not None and ny is not None :
489- b = BoundsI (1 , nx , 1 , ny )
489+ b = BoundsI (xmin = 1 , deltax = nx , ymin = 1 , deltay = ny )
490490 if center is not None :
491491 # this code has to match the code in _setup_image
492492 # for the same branch of the if statement block
@@ -853,7 +853,14 @@ def drawFFT_makeKImage(self, image):
853853 image_N = jnp .max (
854854 jnp .array (
855855 [
856- jnp .max (jnp .abs (jnp .array (image .bounds ._getinitargs ()))) * 2 ,
856+ jnp .max (
857+ jnp .abs (
858+ jnp .array (
859+ [image .xmin , image .xmax , image .ymin , image .ymax ]
860+ )
861+ )
862+ )
863+ * 2 ,
857864 jnp .max (jnp .array (image .bounds .numpyShape ())),
858865 ]
859866 )
@@ -880,7 +887,9 @@ def drawFFT_makeKImage(self, image):
880887 "drawFFT requires an FFT that is too large." , Nk
881888 )
882889
883- bounds = BoundsI (0 , Nk // 2 , - Nk // 2 , Nk // 2 )
890+ bounds = BoundsI (
891+ xmin = 0 , deltax = Nk // 2 + 1 , ymin = - Nk // 2 , deltay = 2 * (Nk // 2 ) + 1
892+ )
884893 if image .dtype in (np .complex128 , np .float64 , np .int32 , np .uint32 ):
885894 kimage = ImageCD (bounds = bounds , scale = dk )
886895 else :
@@ -895,12 +904,20 @@ def drawFFT_finish(self, image, kimage, wrap_size, add_to_image):
895904 # Wrap the full image to the size we want for the FT.
896905 # Even if N == Nk, this is useful to make this portion properly Hermitian in the
897906 # N/2 column and N/2 row.
898- bwrap = BoundsI (0 , wrap_size // 2 , - wrap_size // 2 , wrap_size // 2 - 1 )
899- kimage_wrap = kimage ._wrap (bwrap , True , False )
907+ bwrap = BoundsI (
908+ xmin = 0 ,
909+ deltax = wrap_size // 2 + 1 ,
910+ ymin = - wrap_size // 2 ,
911+ deltay = 2 * (wrap_size // 2 ),
912+ )
913+ kimage_wrap = kimage ._wrap (bwrap , True , False , wrap_size )
900914
901915 # Perform the fourier transform.
902916 breal = BoundsI (
903- - wrap_size // 2 , wrap_size // 2 - 1 , - wrap_size // 2 , wrap_size // 2 - 1
917+ xmin = - wrap_size // 2 ,
918+ deltax = 2 * (wrap_size // 2 ),
919+ ymin = - wrap_size // 2 ,
920+ deltay = 2 * (wrap_size // 2 ),
904921 )
905922 kimg_shift = jnp .fft .ifftshift (kimage_wrap .array , axes = (- 2 ,))
906923 real_image_arr = jnp .fft .fftshift (
0 commit comments