Slicing

Many Slices Along Axis

class PVGeo.filters.slicing.ManySlicesAlongAxis(n_slices=5, axis=0, rng=None, pad=0.01, outputType='vtkMultiBlockDataSet')[source]

Bases: _SliceBase

Slices a vtkDataSet along a given axis many times. This produces a specified number of slices at once each with a normal vector oriented along the axis of choice and spaced uniformly through the range of the dataset on the chosen axis.

Parameters:

pad (float) – Padding as a percentage (0.0, 1.0)

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

_get_origin(pdi, idx)[source]

Internal helper to get plane origin

_set_axial_range(pdi)[source]

Internal helper to set the slicing range along the set axis

get_axis()[source]

Get the set axis to slice upon as int index (0,1,2)

get_input_bounds(pdi)[source]

Gets the bounds of the input data set on the set slicing axis.

static get_input_center(pdi)[source]

Gets the center of the input data set

Returns:

the XYZ coordinates of the center of the data set.

Return type:

tuple

get_normal()[source]

Get the normal of the slicing plane

get_range()[source]

Get the slicing range for the set axis

set_axis(axis)[source]

Set the axis on which to slice

Parameters:

axis (int) – the axial index (0, 1, 2) = (x, y, z)

set_padding(pad)[source]

Set the percent padding for the slices on the edges

Many Slices Along Points

class PVGeo.filters.slicing.ManySlicesAlongPoints(n_slices=5, nearest_nbr=True, outputType='vtkMultiBlockDataSet')[source]

Bases: _SliceBase

Takes a series of points and a data source to be sliced. The points are used to construct a path through the data source and a slice is added at intervals of that path along the vector of that path at that point. This constructs many slices through the input dataset as a merged vtkMultiBlockDataSet.

Note

  • Make sure the input data source is slice-able.

  • The SciPy module is required for this filter.

FillInputPortInformation(port, info)[source]

This simply makes sure the user selects the correct inputs

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

_get_planes(pts)[source]

Internal helper to generate planes for the slices

_get_slice(pts, data, planes, output)[source]

Internal helper to perform the filter

apply(points, data)[source]

Run the algorithm along some points for the given input data

set_use_nearest_nbr(flag)[source]

Set a flag on whether to use SciPy’s nearest neighbor approximation when generating the slicing path

Slice Through Time

class PVGeo.filters.slicing.SliceThroughTime(n_slices=5, dt=1.0, axis=0, rng=None)[source]

Bases: ManySlicesAlongAxis

Takes a sliceable vtkDataSet and progresses a slice of it along a given axis. The macro requires that the clip already exist in the pipeline. This is especially useful if you have many clips linked together as all will move through the seen as a result of this macro.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to set the time information

_update_time_steps()[source]

For internal use only

get_time_step_values()[source]

Use this in ParaView decorator to register timesteps

set_number_of_slices(num)[source]

Set the number of slices/timesteps to generate

set_time_delta(dt)[source]

Set the time step interval in seconds

Slide Slice Along Points

class PVGeo.filters.slicing.SlideSliceAlongPoints(n_slices=5, nearest_nbr=True)[source]

Bases: ManySlicesAlongPoints

Takes a series of points and a data source to be sliced. The points are used to construct a path through the data source and a slice is added at specified locations along that path along the vector of that path at that point. This constructs one slice through the input dataset which the user can translate via a slider bar in ParaView.

Note

  • Make sure the input data source is slice-able.

  • The SciPy module is required for this filter.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to prepare output

_get_slice(pts, data, planes, output)[source]

Internal helper to perform the filter

get_location()[source]

Return the current location along the input line for the slice

set_location(loc)[source]

Set the location along the input line for the slice location as a percent (0, 99).