pyvista.ImageData

目次

pyvista.ImageData#

class ImageData(*args, **kwargs)[ソース]#

3つの座標方向に均一な間隔でデータセットをモデル化します.

いくつかの方法の1つで初期化できます:

  • 空のグリッドを作成

  • vtk.vtkImageData オブジェクトから初期化します

  • 寸法,セル間隔,原点に基づいて初期化します.

バージョン 0.33.0 で変更: 最初の引数には,パスまたは vtk.vtkImageData を指定します.キーワード引数を使って,ユニフォーム・グリッドの寸法,間隔,および原点を指定します.

バージョン 0.37.0 で変更: dims パラメータは dimensions に名称が変更されました.

パラメータ:
uinputstr, vtk.vtkImageData, pyvista.ImageData, optional

ユニフォームグリッドを初期化するためのファイル名またはデータセット. 設定されている場合,残りの引数は無視されます.

dimensionssequence[int], optional

dimensions of the uniform grid.

spacingsequence[float], default: (1.0, 1.0, 1.0)

spacing of the uniform grid in each dimension. Must be positive.

originsequence[float], default: (0.0, 0.0, 0.0)

origin of the uniform grid.

deepbool, default: False

vtk.vtkImageData オブジェクトをディープコピーするかどうかを指定します.キーワードのみ.

direction_matrixRotationLike, optional

The direction_matrix is a 3x3 matrix which controls the orientation of the image data.

Added in version 0.45.

offsetint | VectorLike[int], default: (0, 0, 0)

The offset defines the minimum extent of the image. Offset values can be positive or negative. In physical space, the offset is relative to the image's origin.

Added in version 0.45.

空の ImageData を作成

>>> import pyvista as pv
>>> grid = pv.ImageData()

vtk.vtkImageData オブジェクトから初期化します.

>>> import vtk
>>> vtkgrid = vtk.vtkImageData()
>>> grid = pv.ImageData(vtkgrid)

グリッドの寸法とデフォルトの間隔と原点だけを使って初期化します.これらはキーワード引数でなければなりません.

>>> grid = pv.ImageData(dimensions=(10, 10, 10))

寸法と間隔を使って初期化します.

>>> grid = pv.ImageData(
...     dimensions=(10, 10, 10),
...     spacing=(2, 1, 5),
... )

寸法,間隔,原点を使って初期化します.

>>> grid = pv.ImageData(
...     dimensions=(10, 10, 10),
...     spacing=(2, 1, 5),
...     origin=(10, 35, 50),
... )

別のImageDataから初期化します.

>>> grid = pv.ImageData(
...     dimensions=(10, 10, 10),
...     spacing=(2, 1, 5),
...     origin=(10, 35, 50),
... )
>>> grid_from_grid = pv.ImageData(grid)
>>> grid_from_grid == grid
True

メソッド

ImageData.cast_to_rectilinear_grid()

この均一なグリッドを直線格子にキャストします.

ImageData.cast_to_structured_grid()

この均一な格子を構造化格子にキャストします.

ImageData.to_tetrahedra([tetra_per_cell, ...])

4面体メッシュの構造化グリッドを作成します.

アトリビュート

ImageData.active_normals

アクティブな法線を配列で返します.

ImageData.active_scalars

アクティブなスカラーを配列で返します.

ImageData.active_scalars_info

アクティブなスカラーの関連付けと名前を返します.

ImageData.active_scalars_name

アクティブなスカラーの名前を返します.

ImageData.active_t_coords

ポイント上のアクティブなテクスチャ座標を返します.

ImageData.active_tensors

​アクティブなテンソル配列を返します.

ImageData.active_tensors_info

​アクティブなテンソルのフィールドと名前を取得します: [field, name].

ImageData.active_tensors_name

アクティブなテンソル配列の名前を返します.

ImageData.active_texture_coordinates

ポイント上のアクティブなテクスチャ座標を返します.

ImageData.active_vectors

アクティブなベクトル配列を返します.

ImageData.active_vectors_info

アクティブなベクトルの関連付けと名前を返します.

ImageData.active_vectors_name

アクティブなベクトル配列の名前を返します.

ImageData.actual_memory_size

データセットオブジェクトの実際のサイズを返します.

ImageData.area

2Dの場合,メッシュの面積を返します.

ImageData.array_names

データセットの配列名のリストを返します.

ImageData.arrows

アクティブなベクトルデータのグリフ表現を矢印で返します.

ImageData.bounds

このデータセットの境界ボックスを返します.

ImageData.cell

すべてのセルを簡単にループさせる方法を提供するジェネレーター.

ImageData.cell_data

DataSetAttributesとしてセルデータを返します.

ImageData.cell_ghost_array

read-only, Calls GetCellGhostArray

ImageData.cell_types_array

read-only, Calls GetCellTypesArray

ImageData.cells

read-only, Calls GetCells

ImageData.center

境界ボックスの中心を返します.

ImageData.class_name

read-only, Calls GetClassName

ImageData.data_description

read-only, Calls GetDataDescription

ImageData.data_dimension

read-only, Calls GetDataDimension

ImageData.data_object_type

read-only, Calls GetDataObjectType

ImageData.data_released

read-only, Calls GetDataReleased

ImageData.debug

read-write, Calls GetDebug/SetDebug

ImageData.dimensionality

Return the dimensionality of the grid.

ImageData.dimensions

グリッドの大きさを返します.

ImageData.direction_matrix

Set or get the direction matrix.

ImageData.extent

ImageDataの範囲を返すか設定します.

ImageData.extent_type

read-only, Calls GetExtentType

ImageData.field_data

DataSetAttributesとしてFieldData を返します.

ImageData.global_release_data_flag

read-write, Calls GetGlobalReleaseDataFlag/SetGlobalReleaseDataFlag

ImageData.global_warning_display

read-write, Calls GetGlobalWarningDisplay/SetGlobalWarningDisplay

ImageData.increments

read-only, Calls GetIncrements

ImageData.index_to_physical_matrix

Return or set 4x4 matrix to convert coordinates from index space (ijk) to physical space (xyz).

ImageData.information

read-write, Calls GetInformation/SetInformation

ImageData.is_empty

Return True if there are no points.

ImageData.is_in_memkind

read-only, Calls GetIsInMemkind

ImageData.length

境界ボックスの対角線の長さを返します.

ImageData.length2

read-only, Calls GetLength2

ImageData.m_time

read-only, Calls GetMTime

ImageData.max_cell_size

read-only, Calls GetMaxCellSize

ImageData.max_spatial_dimension

read-only, Calls GetMaxSpatialDimension

ImageData.memkind_directory

write-only, Calls SetMemkindDirectory

ImageData.memory_address

基盤となるVTK C++オブジェクトのアドレスを返します.

ImageData.mesh_m_time

read-only, Calls GetMeshMTime

ImageData.n_arrays

データセット内に存在する配列の数を返します.

ImageData.n_cells

データセット全体のセル数を返します.

ImageData.n_points

データセット全体の点の数を返します.

ImageData.number_of_cells

セルの数を返します.

ImageData.number_of_points

点の数を返します.

ImageData.number_of_scalar_components

read-only, Calls GetNumberOfScalarComponents

ImageData.object_description

read-only, Calls GetObjectDescription

ImageData.object_name

read-write, Calls GetObjectName/SetObjectName

ImageData.offset

Return or set the index offset of the ImageData.

ImageData.origin

グリッドの原点(南西下角)を返します.

ImageData.physical_to_index_matrix

Return or set 4x4 matrix to convert coordinates from physical space (xyz) to index space (ijk).

ImageData.point_data

DataSetAttributesとしてポイントデータを返します.

ImageData.point_ghost_array

read-only, Calls GetPointGhostArray

ImageData.points

暗黙的に定義されたポイントのコピーを,数値配列として作成します.

ImageData.reference_count

read-write, Calls GetReferenceCount/SetReferenceCount

ImageData.scalar_pointer

read-only, Calls GetScalarPointer

ImageData.scalar_range

read-only, Calls GetScalarRange

ImageData.scalar_size

read-only, Calls GetScalarSize

ImageData.scalar_type

read-only, Calls GetScalarType

ImageData.scalar_type_max

read-only, Calls GetScalarTypeMax

ImageData.scalar_type_min

read-only, Calls GetScalarTypeMin

ImageData.spacing

各軸方向の間隔を返すか設定します.

ImageData.update_time

read-only, Calls GetUpdateTime

ImageData.user_dict

ユーザー指定のデータ辞書を設定または返します。

ImageData.using_memkind

read-only, Calls GetUsingMemkind

ImageData.volume

メッシュボリュームを返します.

ImageData.x

すべてのXポイントを返します.

ImageData.y

すべてのYポイントを返します.

ImageData.z

すべてのZポイントを返します.