379a62714282b82147d84134864df41cc1975b1e,invesalius/data/imagedata_utils.py,,ResampleImage2D,#,61
Before Change
spacing = imagedata.GetSpacing()
dimensions = imagedata.GetDimensions()
if resolution_percentage:
px = math.ceil(dimensions[0] * resolution_percentage)
py = math.ceil(dimensions[1] * resolution_percentage)
if abs(extent[1]-extent[3]) < abs(extent[3]-extent[5]):
f = extent[1]
elif abs(extent[1]-extent[5]) < abs(extent[1] - extent[3]):
f = extent[1]
After Change
spacing = imagedata.GetSpacing()
dimensions = imagedata.GetDimensions()
if resolution_percentage:
factor_x = resolution_percentage
factor_y = resolution_percentage
else:
if abs(extent[1]-extent[3]) < abs(extent[3]-extent[5]):
f = extent[1]
elif abs(extent[1]-extent[5]) < abs(extent[1] - extent[3]):
f = extent[1]
elif abs(extent[3]-extent[5]) < abs(extent[1] - extent[3]):
f = extent[3]
else:
f = extent[1]
factor_x = px/float(f+1)
factor_y = py/float(f+1)
resample = vtk.vtkImageResample()
resample.SetInputData(imagedata)
resample.SetAxisMagnificationFactor(0, factor_x)
resample.SetAxisMagnificationFactor(1, factor_y)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: invesalius/invesalius3
Commit Name: 379a62714282b82147d84134864df41cc1975b1e
Time: 2018-01-15
Author: totonixsame@gmail.com
File Name: invesalius/data/imagedata_utils.py
Class Name:
Method Name: ResampleImage2D
Project Name: librosa/librosa
Commit Name: f947b1479e76dbeee06400e8d97b23bf64d0c8ff
Time: 2013-11-21
Author: brm2132@columbia.edu
File Name: librosa/segment.py
Class Name:
Method Name: recurrence_matrix
Project Name: WheatonCS/Lexos
Commit Name: e64a027b9a50e6a10e520aeaa540adf60ceeb87c
Time: 2017-08-15
Author: darias0826@gmail.com
File Name: lexos/processors/prepare/cutter.py
Class Name:
Method Name: cut_by_number