- All Implemented Interfaces:
ParallelLineGenerator
All the lines pass through a point on a d * d plane, where d = the longest diagonal of a 3D interval. The lines are also normal to the plane.
The plane is d * d so that it's big enough that normal lines passing through it cover the entire interval, regardless of the orientation of the plane. However, this means that nextLine() might return a line that entirely misses the interval.
- Author:
- Richard Domander
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bonej.ops.mil.ParallelLineGenerator
ParallelLineGenerator.Line -
Constructor Summary
ConstructorsConstructorDescriptionPlaneParallelLineGenerator(I interval, org.joml.Quaterniondc direction, net.imagej.ops.special.hybrid.BinaryHybridCFI1<org.joml.Vector3d, org.joml.Quaterniondc, org.joml.Vector3d> rotateOp, long sections) Creates and initializes an instance for generating lines. -
Method Summary
-
Constructor Details
-
PlaneParallelLineGenerator
public PlaneParallelLineGenerator(I interval, org.joml.Quaterniondc direction, net.imagej.ops.special.hybrid.BinaryHybridCFI1<org.joml.Vector3d, org.joml.Quaterniondc, throws IllegalArgumentExceptionorg.joml.Vector3d> rotateOp, long sections) Creates and initializes an instance for generating lines.- Type Parameters:
I- type of the interval.- Parameters:
interval- a 3D interval through which the lines pass.direction- the direction of the lines through the interval described as a rotation.rotateOp- an op the generator needs for rotating vectorssections- number of sections each line point coordinate is generated from.- Throws:
IllegalArgumentException- if sections is not positive, or interval is not 3D.
-
-
Method Details
-
nextLine
Generates the next random line.If the class is initialised with more than one section, then lines pass the plane cyclically through each section. For example, if sections == 2 then the next four lines come from the four different quadrants of the plane. Calling nextLine() for the fifth time resets the cycle. Each line has the same random offset within its section. This offset is randomized when the cycle resets. The order of the quadrants is randomised as well.
NB: the line might miss the interval the class was initialised with!
- Specified by:
nextLinein interfaceParallelLineGenerator- Returns:
- a line passing through a point on a plane described by the class.
-
getDirection
Returns the direction of the lines this generator creates- Specified by:
getDirectionin interfaceParallelLineGenerator- Returns:
- direction as a unit vector
-
setSeed
public void setSeed(long seed) Sets the seed of the underlying random number generator- Parameters:
seed- seed value- See Also:
-
reset
public void reset()Resets the cycle of the line generation- See Also:
-