def calculate_target_shape(volume, header, target_spacing):
    """
    Calculates a new number of pixels along a dimension determined by multiplying the 
    current dimension by a scale factor of (source spacing / target spacing)

    The dimension of the volume, header spacing, and target spacing must all match, but the common usecase is 3D

    :param volume: as numpy.ndarray
    :param header: ITK-SNAP header
    :param target_spacing: as tuple or list
    :return: target_shape as list
    """
    src_spacing = header.get_voxel_spacing()
    target_shape = [int(src_d * src_sp / tar_sp) for src_d, src_sp, tar_sp in
                    zip(volume.shape, src_spacing, target_spacing)]
    return target_shape