Texture operation

Apply a formula over a list of textures to build a new one

Description

This process can be used in various situations to build a texture from a list of existing ones. It may perform min/max operations, or custom ones given as a formula. One can typically use it to perform masking, averaging, etc.

All input textures should have the same size and order, they are expected to all match the same mesh.

The formuma is a python expression.

The formula can perform either on aims.TimeTexture objects, or on their numpy wrapings: both can be used under different python variable names. Texture objects are named T0, T1 etc., or as a list T[0], T[1] etc. Numpy arrays are found under NT0, NT1 etc., or as a list NT[0], NT[1] etc.

Note that numpy arrays only bind the 1st timestep of each texture.

When the output_is_first_input parameter is False, the result of the formula is the output. It may be either an aims.TimeTexture object, or a numpy array (which will be converted into a texture).

Ex:

NT0 + NT1 - 2 * NT3
np.sum(NT)

When the output_is_first_input parameter is True, then the formula is expected to modify the first texture object or array, and this modiifed texture will be saved as the result.

Ex: masking

NT0[NT1 != 0] = 0

Parameters

textures: ListOf( Texture ) ( input )
operation: Choice ( input )
formula: String ( input )
output_texture: Texture ( output )
output_is_first_input: Boolean ( input )

Technical information

Toolbox : Cortical Surface

User level : 0

Identifier : texture_operation

File name : brainvisa/toolboxes/cortical_surface/processes/low-level/texture_operation.py

Supported file formats :

textures :
GIFTI file, GIFTI file, Texture
output_texture :
GIFTI file, GIFTI file, Texture