# Slicing¶

## Many Slices Along Axis¶

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

Bases: PVGeo.filters.slicing._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.

GetAxis()[source]

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

GetInputBounds(pdi)[source]

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

GetInputCenter(pdi)[source]

Gets the center of the input data set

Returns: the XYZ coordinates of the center of the data set. tuple
GetNormal()[source]

Get the normal of the slicing plane

GetRange()[source]

Get the slicing range for the set axis

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

SetAxis(axis)[source]

Set the axis on which to slice

Parameters: axis (int) – the axial index (0, 1, 2) = (x, y, z)
_GetOrigin(pdi, idx)[source]

Internal helper to get plane origin

_SetAxialRange(pdi)[source]

Internal helper to set the slicing range along the set axis

_UpdateNumOutputs(num)[source]

for internal use only

## Many Slices Along Points¶

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

Bases: PVGeo.filters.slicing._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.
Apply(points, data)[source]

Update the algorithm and get the output data object

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

SetUseNearestNbr(flag)[source]

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

_GetPlanes(pdipts)[source]
_GetSlice(pdipts, pdidata, planes, output)[source]

Internal helper to perfrom the filter

## Slice Through Time¶

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

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.

GetTimestepValues()[source]

Use this in ParaView decorator to register timesteps

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfoVec, outInfoVec)[source]

Used by pipeline to set the time information

SetNumberOfSlices(num)[source]

Set the number of slices/timesteps to generate

SetTimeDelta(dt)[source]

Set the time step interval in seconds

_UpdateTimeSteps()[source]

For internal use only

## Slide Slice Along Points¶

class PVGeo.filters.slicing.SlideSliceAlongPoints(numSlices=5, nearestNbr=True)[source]

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.
GetLocation()[source]
RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfo, outInfo)[source]

Overwritten by subclass to provide meta-data to downstream pipeline.

SetLocation(loc)[source]

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

_GetSlice(pdipts, pdidata, planes, output)[source]

Internal helper to perfrom the filter