# RSL_get_slice_from_cube

### Synopsis

#include "rsl.h"
Slice *RSL_get_slice_from_cube(Cube *cube, int x, int y, int z);

###

Description

Given a Cube structure, extract one slice from it. x, y and z define the plane of the required slice. Two of the three parameters must equal -1 and the third must be nonnegative; eg, the vertical plane y=100 is specified by the parameters x=-1, y=100, z=-1. Assumes valid ranges for x, y, z are:
0 <= x <= nx-1, 0 <= y <= ny-1, 1 <= z <= nz
nx, ny and nz specify the dimensions of the cube structure and are members of it. The range of z starts at 1 , since a cappi (or carpi) at height z=0 makes no sense.

### Return value

Upon successful completion, a pointer to the appropriate structure is returned. Otherwise, a NULL pointer is returned and errno is set.

### See also

RSL_volume_to_cube

Author: Mike Kolander