9d673a4694047ef68d9e5c9ba4c43e75f06bf2df,invesalius/data/imagedata_utils.py,,dcm2memmap,#Any#Any#Any#Any#,520
Before Change
if resolution_percentage == 1.0:
shape = slice_size[1], len(files), slice_size[0]
else:
shape = math.ceil(slice_size[1]*resolution_percentage), len(files),\
math.ceil(slice_size[0]*resolution_percentage)
else:
if resolution_percentage == 1.0:
shape = len(files), slice_size[1], slice_size[0]
else:
shape = len(files), math.ceil(slice_size[1]*resolution_percentage),\
math.ceil(slice_size[0]*resolution_percentage)
matrix = numpy.memmap(temp_file, mode="w+", dtype="int16", shape=shape)
dcm_reader = vtkgdcm.vtkGDCMImageReader()
cont = 0
max_scalar = None
min_scalar = None
for n, f in enumerate(files):
dcm_reader.SetFileName(f)
dcm_reader.Update()
image = dcm_reader.GetOutput()
if resolution_percentage != 1.0:
image_resized = ResampleImage2D(image, px=None, py=None,\
resolution_percentage = resolution_percentage, update_progress = None)
image = image_resized
min_aux, max_aux = image.GetScalarRange()
if min_scalar is None or min_aux < min_scalar:
min_scalar = min_aux
if max_scalar is None or max_aux > max_scalar:
max_scalar = max_aux
array = numpy_support.vtk_to_numpy(image.GetPointData().GetScalars())
if orientation == "CORONAL":
array.shape = matrix.shape[0], matrix.shape[2]
matrix[:, shape[1] - n - 1, :] = array
elif orientation == "SAGITTAL":
array.shape = matrix.shape[0], matrix.shape[1]
// TODO: Verify if it"s necessary to add the slices swapped only in
// sagittal rmi or only in // Rasiane"s case or is necessary in all
// sagittal cases.
After Change
if resolution_percentage == 1.0:
shape = slice_size[1], len(files), slice_size[0]
else:
shape = int(math.ceil(slice_size[1]*resolution_percentage)), len(files),\
int(math.ceil(slice_size[0]*resolution_percentage))
else:
if resolution_percentage == 1.0:
shape = len(files), slice_size[1], slice_size[0]
else:
shape = len(files), int(math.ceil(slice_size[1]*resolution_percentage)),\
int(math.ceil(slice_size[0]*resolution_percentage))
matrix = numpy.memmap(temp_file, mode="w+", dtype="int16", shape=shape)
dcm_reader = vtkgdcm.vtkGDCMImageReader()
cont = 0
max_scalar = None
min_scalar = None
for n, f in enumerate(files):
dcm_reader.SetFileName(f)
dcm_reader.Update()
image = dcm_reader.GetOutput()
if resolution_percentage != 1.0:
image_resized = ResampleImage2D(image, px=None, py=None,\
resolution_percentage = resolution_percentage, update_progress = None)
image = image_resized
min_aux, max_aux = image.GetScalarRange()
if min_scalar is None or min_aux < min_scalar:
min_scalar = min_aux
if max_scalar is None or max_aux > max_scalar:
max_scalar = max_aux
array = numpy_support.vtk_to_numpy(image.GetPointData().GetScalars())
if orientation == "CORONAL":
array.shape = matrix.shape[0], matrix.shape[2]
matrix[:, shape[1] - n - 1, :] = array
elif orientation == "SAGITTAL":
array.shape = matrix.shape[0], matrix.shape[1]
// TODO: Verify if it"s necessary to add the slices swapped only in
// sagittal rmi or only in // Rasiane"s case or is necessary in all
// sagittal cases.
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 8
Instances
Project Name: invesalius/invesalius3
Commit Name: 9d673a4694047ef68d9e5c9ba4c43e75f06bf2df
Time: 2017-05-30
Author: totonixsame@gmail.com
File Name: invesalius/data/imagedata_utils.py
Class Name:
Method Name: dcm2memmap
Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 398179dcf2bdbb0317c66cab7e65e53c5293cff4
Time: 2017-12-28
Author: kensho.hara@aist.go.jp
File Name: models/wide_resnet.py
Class Name: WideResNet
Method Name: __init__
Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 398179dcf2bdbb0317c66cab7e65e53c5293cff4
Time: 2017-12-28
Author: kensho.hara@aist.go.jp
File Name: models/pre_act_resnet.py
Class Name: PreActivationResNet
Method Name: __init__
Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 398179dcf2bdbb0317c66cab7e65e53c5293cff4
Time: 2017-12-28
Author: kensho.hara@aist.go.jp
File Name: models/resnet.py
Class Name: ResNet
Method Name: __init__
Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 398179dcf2bdbb0317c66cab7e65e53c5293cff4
Time: 2017-12-28
Author: kensho.hara@aist.go.jp
File Name: models/resnext.py
Class Name: ResNeXt
Method Name: __init__