# Transform¶

## Reverse Image Data Axii¶

class PVGeo.grids.transform.ReverseImageDataAxii(axes=[True, True, True])[source]

This filter will flip vtkImageData on any of the three cartesian axii. A checkbox is provided for each axis on which you may desire to flip the data.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output.

SetFlipX(flag)[source]

Set the filter to flip th input data along the X-axis

SetFlipY(flag)[source]

Set the filter to flip th input data along the Y-axis

SetFlipZ(flag)[source]

Set the filter to flip th input data along the Z-axis

_ReverseGridAxii(idi, ido)[source]

## Table To Grid¶

class PVGeo.grids.transform.TableToGrid(extent=[10, 10, 10], order='C', spacing=[1.0, 1.0, 1.0], origin=[0.0, 0.0, 0.0], seplib=False, swapXY=False)[source]

This filter takes a vtkTable object with columns that represent data to be translated (reshaped) into a 3D grid (2D also works, just set the third dimensions extent to 1). The grid will be a n1 by n2 by n3 vtkImageData structure and an origin (south-west bottom corner) can be set at any xyz point. Each column of the vtkTable will represent a data attribute of the vtkImageData formed (essentially a uniform mesh). The SEPlib option allows you to unfold data that was packed in the SEPlib format where the most important dimension is z and thus the z data is d1 (d1=z, d2=y, d3=x). When using SEPlib, specify n1 as the number of elements in the Z-direction, n2 as the number of elements in the X-direction, and n3 as the number of elements in the Y-direction (and so on for other parameters).

Warning

Work in progress

static RefoldIdx(SEPlib=True, swapXY=False)[source]

Theses are indexing corrections to set the spacings and origin witht the correct axes after refolding.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to set whole output extent.

SetExtent(nx, ny, nz)[source]

Set the extent of the output grid

SetOrder(order)[source]

Set the reshape order (‘C’ or ‘F’)

SetOrigin(x0, y0, z0)[source]

Set the origin of the output vtkImageData

SetSEPlib(flag)[source]

Set a flag to swap the axial order for the refold of the table

SetSpacing(dx, dy, dz)[source]

Set the spacing for the points along each axial direction

SetSwapXY(flag)[source]

Set a flag to swap the X and Y axii

_TableToGrid(pdi, ido)[source]

Converts a table of data arrays to vtkImageData given an extent to reshape that table. Each column in the table will be treated as seperate data arrays for the described data space.

static _rearangeSEPlib(arr, extent)[source]

This is a helper method to swap axes when using SEPlib axial conventions.

static _refold(arr, extent, SEPlib=True, order='F', swapXY=False)[source]

This is a helper method to handle grabbing a data array and make sure it is ready for VTK/Fortran ordering in vtkImageData.

static _transposeXY(arr, extent, SEPlib=False)[source]

Transposes X and Y axes. Needed for PoroTomo project.

static _unpack(arr, extent, order='C')[source]

This is a helper method that handles the initial unpacking of a data array. ParaView and VTK use Fortran packing so this is convert data saved in C packing to Fortran packing.

## Table To Time Grid¶

class PVGeo.grids.transform.TableToTimeGrid(extent=[10, 10, 10, 1], order='C', spacing=[1.0, 1.0, 1.0], origin=[0.0, 0.0, 0.0], dims=[0, 1, 2, 3], dt=1.0, points=False, **kwargs)[source]

A filter to convert a static (no time variance) table to a time varying grid. This effectively reashapes a table full of data arrays as a 4D array that is placed onto the CellData of a vtkImageData object.

GetTimestepValues()[source]

Use this in ParaView decorator to register timesteps on the pipeline.

Modified(runAgain=True)[source]

Call modified if the filter needs to run again

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to set whole output extent.

SetDimensions(x, y, z, t)[source]
SetExtent(nx, ny, nz, nt)[source]

Set the extent of the output grid

SetOrder(order)[source]

Set the reshape order (‘C’ or ‘F’)

SetOrigin(x0, y0, z0)[source]

Set the origin of the output vtkImageData

SetSpacing(dx, dy, dz)[source]

Set the spacing for the points along each axial direction

SetTimeDelta(dt)[source]

An advanced property to set the time step in seconds.

SetUsePoints(flag)[source]

Set whether or not to place the data on the nodes/cells of the grid. True places data on nodes, false places data at cell centers (CellData). In ParaView, switching can be a bit buggy: be sure to turn the visibility of this data object OFF on the pipeline when changing between nodes/cells.

_BuildImageData(img)[source]
_SetData(table)[source]
_UpdateTimeSteps()[source]

For internal use only: appropriately sets the timesteps.

## Translate Grid Origin¶

class PVGeo.grids.transform.TranslateGridOrigin(corner=1)[source]

This filter will translate the origin of vtkImageData to any specified Corner of the data set assuming it is currently in the South West Bottom Corner (will not work if Corner was moved prior).

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to generate output.

SetCorner(corner)[source]

Set the corner to use

Parameters: corner (int) – corner location; see note.

Note

• 1: South East Bottom
• 2: North West Bottom
• 3: North East Bottom
• 4: South West Top
• 5: South East Top
• 6: North West Top
• 7: North East Top
_Translate(pdi, pdo)[source]