# Path: dicom2nifti/common.py
# def get_nifti_data(nifti_image):
#     """
#     Function that replicates the deprecated nifti.get_data behavior
#     """
#     return numpy.asanyarray(nifti_image.dataobj)
# 
# Path: dicom2nifti/settings.py
# def disable_validate_slice_increment():
# def disable_validate_instance_number():
# def disable_validate_orientation():
# def disable_validate_orthogonal():
# def disable_validate_slicecount():
# def disable_validate_multiframe_implicit():
# def enable_validate_slice_increment():
# def enable_validate_instance_number():
# def enable_validate_orientation():
# def enable_validate_orthogonal():
# def enable_validate_slicecount():
# def enable_validate_multiframe_implicit():
# def enable_pydicom_read_force():
# def disable_pydicom_read_force():
# def enable_resampling():
# def disable_resampling():
# def set_resample_padding(padding):
# def set_resample_spline_interpolation_order(order):
# def set_gdcmconv_path(path):


import nibabel
import nibabel.affines
import numpy
import scipy.ndimage
from dicom2nifti.common import get_nifti_data
from dicom2nifti import settings
                      numpy.dot(point, y_axis_world),
                      numpy.dot(point, z_axis_world)]
        projections.append(projection)

    projections = numpy.array(projections)

    min_projected = numpy.amin(projections, axis=0)
    max_projected = numpy.amax(projections, axis=0)
    new_size_mm = max_projected - min_projected

    origin = min_projected[0] * x_axis_world + \
             min_projected[1] * y_axis_world + \
             min_projected[2] * z_axis_world

    new_voxelsize = voxel_size
    new_shape = numpy.ceil(new_size_mm / new_voxelsize).astype(numpy.int16) + 1

    new_affine = _create_affine(x_axis_world, y_axis_world, z_axis_world, origin, voxel_size)

    # Resample each image
    combined_image_data = numpy.full(new_shape, settings.resample_padding,
                                     dtype=get_nifti_data(nifti_images[0]).dtype)
    for nifti_image in nifti_images:
        image_affine = nifti_image.affine
        combined_affine = numpy.linalg.inv(new_affine).dot(image_affine)
        matrix, offset = nibabel.affines.to_matvec(numpy.linalg.inv(combined_affine))
        resampled_image = scipy.ndimage.affine_transform(get_nifti_data(nifti_image),
                                                         matrix=matrix,
                                                         offset=offset,
                                                         output_shape=new_shape,

# Path: dicom2nifti/common.py
# def get_nifti_data(nifti_image):
#     """
#     Function that replicates the deprecated nifti.get_data behavior
#     """
#     return numpy.asanyarray(nifti_image.dataobj)
# 
# Path: dicom2nifti/settings.py
# def disable_validate_slice_increment():
# def disable_validate_instance_number():
# def disable_validate_orientation():
# def disable_validate_orthogonal():
# def disable_validate_slicecount():
# def disable_validate_multiframe_implicit():
# def enable_validate_slice_increment():
# def enable_validate_instance_number():
# def enable_validate_orientation():
# def enable_validate_orthogonal():
# def enable_validate_slicecount():
# def enable_validate_multiframe_implicit():
# def enable_pydicom_read_force():
# def disable_pydicom_read_force():
# def enable_resampling():
# def disable_resampling():
# def set_resample_padding(padding):
# def set_resample_spline_interpolation_order(order):
# def set_gdcmconv_path(path):


# Path: dicom2nifti/resample.py
import nibabel
import nibabel.affines
import numpy
import scipy.ndimage
from dicom2nifti.common import get_nifti_data
from dicom2nifti import settings

                      numpy.dot(point, y_axis_world),
                      numpy.dot(point, z_axis_world)]
        projections.append(projection)

    projections = numpy.array(projections)

    min_projected = numpy.amin(projections, axis=0)
    max_projected = numpy.amax(projections, axis=0)
    new_size_mm = max_projected - min_projected

    origin = min_projected[0] * x_axis_world + \
             min_projected[1] * y_axis_world + \
             min_projected[2] * z_axis_world

    new_voxelsize = voxel_size
    new_shape = numpy.ceil(new_size_mm / new_voxelsize).astype(numpy.int16) + 1

    new_affine = _create_affine(x_axis_world, y_axis_world, z_axis_world, origin, voxel_size)

    # Resample each image
    combined_image_data = numpy.full(new_shape, settings.resample_padding,
                                     dtype=get_nifti_data(nifti_images[0]).dtype)
    for nifti_image in nifti_images:
        image_affine = nifti_image.affine
        combined_affine = numpy.linalg.inv(new_affine).dot(image_affine)
        matrix, offset = nibabel.affines.to_matvec(numpy.linalg.inv(combined_affine))
        resampled_image = scipy.ndimage.affine_transform(get_nifti_data(nifti_image),
                                                         matrix=matrix,
                                                         offset=offset,
                                                         output_shape=new_shape,

                                                         output=get_nifti_data(nifti_image).dtype,