index_first = tuple([0] * ndim)
index_last = tuple([-1 if n == axis else 0 for n in range(ndim)])
// unwrap the image without wrap around
with warnings.catch_warnings():
// We do not want warnings about length 1 dimensions
warnings.simplefilter("ignore")
image_unwrap_no_wrap_around = unwrap_phase(image_wrapped, seed=0)
print("endpoints without wrap_around:",
image_unwrap_no_wrap_around[index_first],
image_unwrap_no_wrap_around[index_last])
After Change
index_last = tuple([-1 if n == axis else 0 for n in range(ndim)])
// unwrap the image without wrap around
// We do not want warnings about length 1 dimensions
with expected_warnings([r"Image has a length 1 dimension|\A\Z"]):
image_unwrap_no_wrap_around = unwrap_phase(image_wrapped, seed=0)
print("endpoints without wrap_around:",
image_unwrap_no_wrap_around[index_first],