ImageDev

GetObliqueSliceFromVolume3d

Extracts a 2D section from a 3D volume.

Access to parameter description

GetObliqueSliceFromVolume3d extracts a section of a 3D image, given a point of this section and the theta and phi angles of its normal given in respect to the spherical coordinates generally used in mathematics.
The 2D image is created with dimensions deduced from the intersection between the input volume and the plane defined by the point and normal inputs.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
getObliqueSliceFromVolume3d( std::shared_ptr< iolink::ImageView > inputImage,
                             iolink::Vector3i32 pointCoordinates,
                             double thetaAngle,
                             double phiAngle,
                             GetObliqueSliceFromVolume3d::InterpolationType interpolationType,
                             std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
get_oblique_slice_from_volume_3d( input_image,
                                  point_coordinates = [1, 1, 1],
                                  theta_angle = 0,
                                  phi_angle = 0,
                                  interpolation_type = GetObliqueSliceFromVolume3d.InterpolationType.NEAREST_NEIGHBOR,
                                  output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
GetObliqueSliceFromVolume3d( IOLink.ImageView inputImage,
                             int[] pointCoordinates = null,
                             double thetaAngle = 0,
                             double phiAngle = 0,
                             GetObliqueSliceFromVolume3d.InterpolationType interpolationType = ImageDev.GetObliqueSliceFromVolume3d.InterpolationType.NEAREST_NEIGHBOR,
                             IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name GetObliqueSliceFromVolume3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input 3D image (the volume from which the slice is extracted). Image Binary, Label, Grayscale or Multispectral nullptr
input
pointCoordinates
Coordinates of a point of the 3D section. Vector3i32 >=0 {1, 1, 1}
input
thetaAngle
The azimuthal angle in degrees (angle between the X axis and the projection of the normal on XY plane). Float64 Any value 0
input
phiAngle
The polar angle in degrees (angle between the normal and the Z axis). Float64 Any value 0
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each result voxel.
NEAREST_NEIGHBOR This mode gets the value of the nearest voxel.
LINEAR This mode gets the cubic interpolation from the nearest voxels.
Enumeration NEAREST_NEIGHBOR
output
outputImage
The output 2D image (the extracted slice). Image nullptr

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

GetObliqueSliceFromVolume3d getObliqueSliceFromVolume3dAlgo;
getObliqueSliceFromVolume3dAlgo.setInputImage( foam );
getObliqueSliceFromVolume3dAlgo.setPointCoordinates( {1, 1, 1} );
getObliqueSliceFromVolume3dAlgo.setThetaAngle( 0.0 );
getObliqueSliceFromVolume3dAlgo.setPhiAngle( 0.0 );
getObliqueSliceFromVolume3dAlgo.setInterpolationType( GetObliqueSliceFromVolume3d::InterpolationType::NEAREST_NEIGHBOR );
getObliqueSliceFromVolume3dAlgo.execute();

std::cout << "outputImage:" << getObliqueSliceFromVolume3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

get_oblique_slice_from_volume_3d_algo = imagedev.GetObliqueSliceFromVolume3d()
get_oblique_slice_from_volume_3d_algo.input_image = foam
get_oblique_slice_from_volume_3d_algo.point_coordinates = [1, 1, 1]
get_oblique_slice_from_volume_3d_algo.theta_angle = 0.0
get_oblique_slice_from_volume_3d_algo.phi_angle = 0.0
get_oblique_slice_from_volume_3d_algo.interpolation_type = imagedev.GetObliqueSliceFromVolume3d.NEAREST_NEIGHBOR
get_oblique_slice_from_volume_3d_algo.execute()

print( "output_image:", str( get_oblique_slice_from_volume_3d_algo.output_image ) );
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

GetObliqueSliceFromVolume3d getObliqueSliceFromVolume3dAlgo = new GetObliqueSliceFromVolume3d
{
    inputImage = foam,
    pointCoordinates = new int[]{1, 1, 1},
    thetaAngle = 0.0,
    phiAngle = 0.0,
    interpolationType = GetObliqueSliceFromVolume3d.InterpolationType.NEAREST_NEIGHBOR
};
getObliqueSliceFromVolume3dAlgo.Execute();

Console.WriteLine( "outputImage:" + getObliqueSliceFromVolume3dAlgo.outputImage.ToString() );

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = getObliqueSliceFromVolume3d( foam, {1, 1, 1}, 0.0, 0.0, GetObliqueSliceFromVolume3d::InterpolationType::NEAREST_NEIGHBOR );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.get_oblique_slice_from_volume_3d( foam, [1, 1, 1], 0.0, 0.0, imagedev.GetObliqueSliceFromVolume3d.NEAREST_NEIGHBOR )

print( "output_image:", str( result ) );
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.GetObliqueSliceFromVolume3d( foam, new int[]{1, 1, 1}, 0.0, 0.0, GetObliqueSliceFromVolume3d.InterpolationType.NEAREST_NEIGHBOR );

Console.WriteLine( "outputImage:" + result.ToString() );