pyvista.plotting.volume_property.VolumeProperty.interpolation_type#
- property VolumeProperty.interpolation_type: str[ソース]#
補間の種類を返すか設定します.
値は
'linear'
または'nearest'
のどちらかでなければなりません.例
サンプルの
pyvista.ImageData
データセットを作成します.>>> import numpy as np >>> import pyvista as pv >>> n = 21 >>> c = -(n - 1) / 2 >>> vol = pv.ImageData(dimensions=(n, n, n), origin=(c, c, c)) >>> scalars = np.linalg.norm(vol.points, axis=1) >>> scalars *= 255 / scalars.max() >>> vol['scalars'] = scalars
最近接 (デフォルト) 補間のデモを行います.
>>> pl = pv.Plotter() >>> actor = pl.add_volume( ... vol, ... show_scalar_bar=False, ... opacity=[0.3, 0.0, 0.05, 0.0, 0.0, 0.0, 1.0, 0.0], ... cmap='plasma', ... ) >>> actor.prop.interpolation_type = 'nearest' >>> pl.show()
線形補間をデモします.
>>> pl = pv.Plotter() >>> actor = pl.add_volume( ... vol, ... show_scalar_bar=False, ... opacity=[0.3, 0.0, 0.05, 0.0, 0.0, 0.0, 1.0, 0.0], ... cmap='plasma', ... ) >>> actor.prop.interpolation_type = 'linear' >>> pl.show()