The GetSliceFromVolume3d algorithm extracts a slice from a plane of a 3D image.
This plane can be orthogonal to the X, Y, or Z axis.
The 2D image is created with dimensions deduced from the volume dimensions and the selected axis:
Selected AxisPlanegxsgysXYZgyvgzvYXZgxvgzvZXYgxvgyv
Where (gxv,gyv,gzv) is the input volume size in voxels for the X, Y, and Z directions and
(gxs,gys) is the output slice size in pixels for the X and Y directions.
// Function prototype.publicstaticIOLink.ImageViewGetSliceFromVolume3d(IOLink.ImageView inputImage,GetSliceFromVolume3d.Axis axis =ImageDev.GetSliceFromVolume3d.Axis.Z_AXIS,Int32 sliceIndex =1,IOLink.ImageView outputImage =null);
Class Syntax
// Command constructor.GetSliceFromVolume3d();/// Gets the inputImage parameter./// The input 3D image (the volume from which the slice is extracted).
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input 3D image (the volume from which the slice is extracted).void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the axis parameter./// The axis orthogonal to the plane to extract.GetSliceFromVolume3d::Axis axis()const;/// Sets the axis parameter./// The axis orthogonal to the plane to extract.void setAxis(constGetSliceFromVolume3d::Axis& axis );/// Gets the sliceIndex parameter./// The axis index of the plane to extract.int32_t sliceIndex()const;/// Sets the sliceIndex parameter./// The axis index of the plane to extract.void setSliceIndex(constint32_t& sliceIndex );/// Gets the outputImage parameter./// The output 2D image (the extracted slice).
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output 2D image (the extracted slice).void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.GetSliceFromVolume3d.input_image
# Property of the axis parameter.GetSliceFromVolume3d.axis
# Property of the sliceIndex parameter.GetSliceFromVolume3d.slice_index
# Property of the outputImage parameter.GetSliceFromVolume3d.output_image
// Method to launch the command.
execute()
// Command constructor.GetSliceFromVolume3d()// Property of the inputImage parameter.GetSliceFromVolume3d.inputImage
// Property of the axis parameter.GetSliceFromVolume3d.axis
// Property of the sliceIndex parameter.GetSliceFromVolume3d.sliceIndex
// Property of the outputImage parameter.GetSliceFromVolume3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input 3D image (the volume from which the slice is extracted).
Image
Binary, Label, Grayscale or Multispectral
nullptr
axis
The axis orthogonal to the plane to extract.
X_AXIS
This mode extracts a plane orthogonal to X axis.
Y_AXIS
This mode extracts a plane orthogonal to Y axis.
Z_AXIS
This mode extracts a plane orthogonal to Z axis.
Enumeration
Z_AXIS
sliceIndex
The axis index of the plane to extract.
Int32
>=0
1
outputImage
The output 2D image (the extracted slice).
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input 3D image (the volume from which the slice is extracted).
image
Binary, Label, Grayscale or Multispectral
None
axis
The axis orthogonal to the plane to extract.
X_AXIS
This mode extracts a plane orthogonal to X axis.
Y_AXIS
This mode extracts a plane orthogonal to Y axis.
Z_AXIS
This mode extracts a plane orthogonal to Z axis.
enumeration
Z_AXIS
slice_index
The axis index of the plane to extract.
int32
>=0
1
output_image
The output 2D image (the extracted slice).
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input 3D image (the volume from which the slice is extracted).