// FIXME: "import copy" overwrites input parameter "copy"!import copy
data = copy.copy(data)
affine = copy.copy(affine)if target_affine is None and target_shape is None:
returnniimg
if(np.all(np.array(target_shape)== data.shape) and
np.all(target_affine == affine)):
After Change
return niimg
// We now know that some resampling must be done.
data = niimg.get_data()if target_affine is None:
target_affine = np.eye(4)
if target_shape is None: