vreg.full#

vreg.full(shape, fill_value, affine=None, orient='axial', spacing=1.0, pos=[0, 0, 0], **kwargs)[source]#

Return a new volume of given shape and affine, filled with fill_value.

Parameters:
  • shape (int or tuple of ints) – Shape of the new array, e.g., (2, 3) or 2.

  • fill_value (float) – value to fill the array.

  • affine (array, optional) – 4x4 affine array. If this is not provided, the affine array is constructed from the other arguments. Defaults to None.

  • orient (str, optional) – Orientation of the volume. The options are ‘axial’, ‘sagittal’, or ‘coronal’. Alternatively the same options can be provided referring to the orientation of the image planes: ‘xy’, ‘yz’ or ‘zx’. Note while ‘xy’ and ‘yz’ mean exactly the same as ‘axial’ and ‘sagittal’, respectively, ‘zx’ differs from coronal in the orientation of the z-axis. While ‘zx’ forms a right-handed reference frame, ‘coronal’ is left-handed following the common convention in medical imaging. Defaults to ‘axial’.

  • spacing (float, optional) – Pixel spacing in mm. Can be a 3D array or a single scalar for isotropic spacing. Defaults to 1.0.

  • pos (list, optional) – Position of the upper left-hand corner in mm. Defaults to [0,0,0].

  • kwargs – Any keyword arguments accepted by numpy.full.

Returns:

vreg.Volume3D with fill_value values.

Return type:

Volume3D