26572a6f569dbe13d3b707ae103d089c8c425933,unet3d/utils/utils.py,,resize,#,64
Before Change
def resize(image, new_shape, interpolation="continuous"):
input_shape = np.asarray(image.shape, dtype=np.float16)
ras_image = reorder_img(image, resample=interpolation)
output_shape = np.asarray(new_shape)
new_spacing = input_shape/output_shape
new_affine = np.copy(ras_image.affine)
new_affine[:3, :3] = ras_image.affine[:3, :3] * np.diag(new_spacing)
return resample_img(ras_image, target_affine=new_affine, target_shape=output_shape, interpolation=interpolation)
After Change
def resize(image, new_shape, interpolation="continuous"):
image = reorder_img(image, resample=interpolation)
zoom_level = np.divide(new_shape, image.shape)
new_diagonal = (image.affine.diagonal()[:3] / zoom_level).tolist() + [1]
new_affine = np.copy(image.affine)
np.fill_diagonal(new_affine, new_diagonal)
new_data = zoom(image.get_data(), zoom_level)
return new_img_like(image, new_data, affine=new_affine)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: ellisdg/3DUnetCNN
Commit Name: 26572a6f569dbe13d3b707ae103d089c8c425933
Time: 2018-03-14
Author: david.ellis@unmc.edu
File Name: unet3d/utils/utils.py
Class Name:
Method Name: resize
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 31f768dd2cd555649d2b0e494935cb37cf223142
Time: 2019-03-22
Author: datarian@againstthecurrent.ch
File Name: category_encoders/one_hot.py
Class Name: OneHotEncoder
Method Name: reverse_dummies
Project Name: ANTsX/ANTsPy
Commit Name: d23adb96056f3a4ff2d477ae9051a79b481d625b
Time: 2018-11-23
Author: stnava@gmail.com
File Name: ants/utils/mask_image.py
Class Name:
Method Name: mask_image