SbDiscreteLineProfile Class Reference

ImageViz Profile line extractor More...

#include <ImageViz/SbDiscreteLineProfile.h>

List of all members.

Public Member Functions

 ~SbDiscreteLineProfile ()
size_t getLength () const
const double & getValue (int index, int component=0) const
const double * getValues () const
const SbVec4i32getPosition (int index) const
const SbVec4i32getFirstPosition () const
const SbVec4i32getLastPosition () const
const double & operator[] (int i) const



 SbDiscreteLineProfile (SbVec2i32 p1, SbVec2i32 p2, SoImageDataAdapter *image)
 SbDiscreteLineProfile (SbVec3i32 p1, SbVec3i32 p2, SoImageDataAdapter *image)
 SbDiscreteLineProfile (SbVec4i32 p1, SbVec4i32 p2, SoImageDataAdapter *image)

Detailed Description

ImageViz Profile line extractor

Define a profile line extractor based on the Bresenham's Line algorithm.

SEE ALSO


Constructor & Destructor Documentation

SbDiscreteLineProfile::SbDiscreteLineProfile ( SbVec2i32  p1,
SbVec2i32  p2,
SoImageDataAdapter image 
)

Constructor defining the profile line on the image.

Parameters:
p1 begin point of the profile. Can be a 2d, 3d and 3d+t point.
p2 end point of the profile. Can be a 2d, 3d and 3d+t point.
image image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
SbDiscreteLineProfile::SbDiscreteLineProfile ( SbVec3i32  p1,
SbVec3i32  p2,
SoImageDataAdapter image 
)

Constructor defining the profile line on the image.

Parameters:
p1 begin point of the profile. Can be a 2d, 3d and 3d+t point.
p2 end point of the profile. Can be a 2d, 3d and 3d+t point.
image image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
SbDiscreteLineProfile::SbDiscreteLineProfile ( SbVec4i32  p1,
SbVec4i32  p2,
SoImageDataAdapter image 
)

Constructor defining the profile line on the image.

Parameters:
p1 begin point of the profile. Can be a 2d, 3d and 3d+t point.
p2 end point of the profile. Can be a 2d, 3d and 3d+t point.
image image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
SbDiscreteLineProfile::~SbDiscreteLineProfile (  ) 

Destructor.


Member Function Documentation

const SbVec4i32& SbDiscreteLineProfile::getFirstPosition (  )  const

Returns the first point.

const SbVec4i32& SbDiscreteLineProfile::getLastPosition (  )  const

Returns the last point.

size_t SbDiscreteLineProfile::getLength (  )  const

Returns the length of extracted data (i.e.

the number of extracted voxels).

const SbVec4i32& SbDiscreteLineProfile::getPosition ( int  index  )  const

Returns the position along the line at specified displacement relatively to first point.

Range of index is between 0 and n-1 with n, the number of voxels in the segment (see getLength), Throws an SbException if index is out of bounds.

const double& SbDiscreteLineProfile::getValue ( int  index,
int  component = 0 
) const

Returns the value along the line at specified displacement relatively to first point.

Parameters:
index 
component choose the component of the voxel. Default is 0 which correspond to 1-component image. Range of index is between 0 and n-1 with n, the number of voxels in the segment (see getLength). Range of component is between 0 and c - 1 with c is the number of component of the image ( e.g c = 1 for grayscale, c = 3 for RGB, c = 4 for RGBA ). Throws an SbException if index is out of bounds.
const double* SbDiscreteLineProfile::getValues (  )  const

Returns the values buffer.

const double& SbDiscreteLineProfile::operator[] ( int  i  )  const

Accessor operator.

So you can do:

 val = profile[i];

Note:

  • profile[i] refers to profile.getValue( i, 0 ).
  • Range of index is between 0 and n-1 with n, the number of voxels in the segment (see getLength),
  • For performance reasons this is an unsafe accessor (bounds are not tested).
  • Applicable only for 1-component image or on the first component of image.

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/