Package com.openinventor.imageviz
Class SbDiscreteLineProfile
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.imageviz.SbDiscreteLineProfile
-
public class SbDiscreteLineProfile extends Inventor
Profile line extractor. Define a profile line extractor based on the Bresenham's Line algorithm.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SbDiscreteLineProfile(SbVec2i32 p1, SbVec2i32 p2, SoImageDataAdapter image)
Constructor defining the profile line on the image.SbDiscreteLineProfile(SbVec3i32 p1, SbVec3i32 p2, SoImageDataAdapter image)
Constructor defining the profile line on the image.SbDiscreteLineProfile(SbVec4i32 p1, SbVec4i32 p2, SoImageDataAdapter image)
Constructor defining the profile line on the image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SbVec4i32
getFirstPosition()
Returns the first point.SbVec4i32
getLastPosition()
Returns the last point.long
getLength()
Returns the length of extracted data (i.e.SbVec4i32
getPosition(int index)
Returns the position along the line at specified displacement relatively to first point.double
getValue(int index)
Calls getValue(index, (int)0).double
getValue(int index, int component)
Returns the value along the line at specified displacement relatively to first point.double
getValueAt(int i)
void
setValue(SbDiscreteLineProfile copyFrom)
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SbDiscreteLineProfile
public 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 anSbException
if any p1 or p2 are out of image. Throws anSbException
if image is NULL.
-
SbDiscreteLineProfile
public 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 anSbException
if any p1 or p2 are out of image. Throws anSbException
if image is NULL.
-
SbDiscreteLineProfile
public 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 anSbException
if any p1 or p2 are out of image. Throws anSbException
if image is NULL.
-
-
Method Detail
-
getValue
public double getValue(int index)
Calls getValue(index, (int)0).
-
setValue
public void setValue(SbDiscreteLineProfile copyFrom)
-
getValue
public double getValue(int index, int component)
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 (seegetLength
). 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 anSbException
if index is out of bounds.
-
getFirstPosition
public SbVec4i32 getFirstPosition()
Returns the first point.
-
getLength
public long getLength()
Returns the length of extracted data (i.e. the number of extracted voxels).
-
getPosition
public SbVec4i32 getPosition(int index)
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 (seegetLength
), Throws anSbException
if index is out of bounds.
-
getValueAt
public double getValueAt(int i)
-
getLastPosition
public SbVec4i32 getLastPosition()
Returns the last point.
-
-