def METHOD_NAME():
    imagePath = datastore.fetch('sample_image.ptif')
    source = large_image.open(imagePath)
    out = large_image_source_vips.new()
    assert out.minWidth is None
    assert out.minHeight is None
    out.minWidth = 4030
    out.minHeight = 2030
    assert out.minWidth is not None
    assert out.minHeight is not None
    out.minWidth = None
    out.minHeight = None
    assert out.minWidth is None
    assert out.minHeight is None
    with pytest.raises(TileSourceError):
        out.minWidth = -1
    with pytest.raises(TileSourceError):
        out.minHeight = -1
    out.minWidth = 4030
    out.minHeight = 2030
    for tile in source.tileIterator(
        format=large_image.constants.TILE_FORMAT_NUMPY,
        region=dict(right=4000, bottom=2000),
    ):
        out.addTile(tile['tile'], x=tile['x'], y=tile['y'])
    tmpdir = tempfile.mkdtemp()
    outputPath = os.path.join(tmpdir, 'temp.tiff')
    try:
        out.write(outputPath)
        result = large_image.open(outputPath)
        resultMetadata = result.getMetadata()
        assert resultMetadata['sizeX'] == 4030
        assert resultMetadata['sizeY'] == 2030
        outputPath2 = os.path.join(tmpdir, 'temp2.tiff')
        out.minWidth = 2000
        out.minHeight = 1000
        out.write(outputPath2)
        result = large_image.open(outputPath2)
        resultMetadata = result.getMetadata()
        assert resultMetadata['sizeX'] == 4000
        assert resultMetadata['sizeY'] == 2000
    finally:
        shutil.rmtree(tmpdir)