In file contour/SliceActiveContour2D.h:

class SliceActiveContour2D : public ActiveContour2D

a 2D active contour that is attached to a given slice of a volumetric image

Inheritance:


Public Methods

SliceCamera::SLICE_ORIENTATION getSliceGeometry () const
get the slice geometry of the active contour
void setSliceGeometry (const SliceCamera::SLICE_ORIENTATION geometry)
set the slice geometry of the active contour
virtual void recompute (SliceCamera *cam)
slice changed callback
virtual void redraw (Camera2D *cam)
redraw the slice active contour : if the camera is a slice-camera then the contour is drawn only if the slice index is equal to the slice number of the slice active contour
void readSliceModule (GFInput &input)
the function that reads the slice geometry and number of the contour
void skipSliceModule (GFInput &input)
the function that skipss the slice geometry and number of the contour
void writeSliceModule (GFOutput &output)
the function that writes the slice geometry and number of the contour
void setSliceDistance (const double l)
set the slice distance of the slice contours in 3D
double getSliceDistance () const
returns the distance between two slices
Vec3 get3DPosition (Vec2 p, unsigned int sliceNumber)
returns a 3D position vector given the position of 2D vertex : this position depends on the slice number and slice geometry and the slice distance
virtual void computeExternalForce ()
compute the external force on all contour vertices
void moveSliceCameras (unsigned int _sliceNumber)
change the slice number of all the slice cameras in the same scene as the slice active contour 2D
virtual void selectLine (const Vec2& pixel, Camera2D *cam)
select the contour line closest from a given position and set the selectedLine variable
virtual void selectVertex (const Vec2& pixel, Camera2D *cam)
select the contour vertex closest from a given position and set the selectedVertex variable
virtual void grabVertex (const Vec2 pixel, Camera2D *cam)
applies an external force that attract the closest contour vertex towards a pixel position

Public

Constructors
SliceActiveContour2D (const TclString filename, Scene2D *scene=NULL, SliceCamera::SLICE_ORIENTATION geometry=SliceCamera::SLICE_Z)
Reads the slice active contour from a file
SliceActiveContour2D (const unsigned int nbLines, const unsigned int *nbVertices, Vec2 **array, const ContourLine::Topology *top, Scene2D *scene=NULL, int slice=0, SliceCamera::SLICE_ORIENTATION geometry=SliceCamera::SLICE_Z)
Builds a slice active contour given a set of lines
SliceActiveContour2D (const SliceActiveContour2D *_sliceContour, int slice=0)
Builds a slice active contour given another slice active contour
destructor
virtual ~SliceActiveContour2D ()
empty

Private Fields

SliceCamera::SLICE_ORIENTATION sliceGeometry
the geometry (along which axis) of the slice
double sliceDistance
the distance between two slices
SliceContour3D* interface3D
the 3D interface associated with a 2D slice active contour

Private Methods

void initGeneralFormat ()
initialize the general format routines

Inherited from ActiveContour2D:

Public Classes

class InvalidContour: public Exception
enum TimeDiscretizationScheme

Public Fields

typedef mtl::matrix , mtl::compressed<>, mtl::row_major> ::type SparseMatrix

Public Methods

ActiveLine2DIterator firstLine(void) const
ActiveLine2DIterator lastLine(void) const
ActiveVertexContour2DIterator firstVertex() const
void computeEdgeDirection()
void computeSimplexAngle() throw(ContourLine2D::IllegalGeometry)
void computeCurvature() throw(ContourLine2D::IllegalGeometry)
void setSpringRestLengths()
void setMetricParameters()
void resetMetricParameters()
void topologyHasChanged()
void initInternalForce()
void computeMaximumRigidity()
ActiveContour2D::TimeDiscretizationScheme getTimeScheme(void) const
void setTimeScheme(const ActiveContour2D::TimeDiscretizationScheme ts)
void computeInternalForce()
void setInternalForce(InternalForceContour2D *ft)
void setInternalForce(char *forceName)
void updatePosition()
void iterate(const unsigned int n)
SparseMatrix* getRigidityMatrix() const
mtl::dense1D * getForceVector() const
bool hasTopologyChanged() const
double getMinimumEdgeLength() const
double getMedianEdgeLength() const
double getMeanEdgeLength() const
double getMeanEdgeSquareLength() const
InternalForceContour2D* getInternalForce() const
virtual bool continueDeformation()
virtual ContourLine* createLine(ContourLine::Topology top)
AContourLine2D* getFirstLine(void) const
void applyLine(void (AContourLine2D::*fn)(void))
void applyLine(void (AContourLine2D::*fn) (void) const)
void applyVertex(void (ActiveVertexContour2D::*fn)(void))
void applyVertex(void (ActiveVertexContour2D::*fn)(const double), const double v)
void applyVertexUInt(void (ActiveVertexContour2D::*fn)(const unsigned int), const unsigned int v)
void readMainModule(GFInput &input) throw(InvalidContour)
void skipMainModule(GFInput &input)
void writeMainModule(GFOutput &output)
void readInternalForceModule(GFInput &input)
void skipInternalForceModule(GFInput &input)
void writeInternalForceModule(GFOutput &output)
void readPositionConstraintModule(GFInput &input)
void skipPositionConstraintModule(GFInput &input)
void writePositionConstraintModule(GFOutput &output)
void readForceConstraintModule(GFInput &input)
void skipForceConstraintModule(GFInput &input)
void writeForceConstraintModule(GFOutput &output)
void readAlphaModule(GFInput &input)
void skipDoubleVertexModule(GFInput &input)
void writeAlphaModule(GFOutput &output)
void readBetaModule(GFInput &input)
void writeBetaModule(GFOutput &output)
void readRigidityModule(GFInput &input)
void skipIntVertexModule(GFInput &input)
void writeRigidityModule(GFOutput &output)
void readShapePositionModule(GFInput &input)
void skipVectorVertexModule(GFInput &input)
void writeShapePositionModule(GFOutput &output)
void readRangeInformation(GFInput &input)
void skipRangeInformation(GFInput &input)
void writeRangeInformation(GFOutput &output)
void readMobilityModule(GFInput &input)
void writeMobilityModule(GFOutput &output)
void addContour(const ActiveContour2D *contour)
RangeInformation* getRangeInformation() const
void setRangeInformation( RangeInformation * ri)
virtual void mergeEdges(EdgeActiveContour2D *e1, EdgeActiveContour2D *e2)
TclObject* getTclInterface() const
virtual void translate(const Vec2& t)
virtual void scale(const double scale)
virtual void rotate(const Rotation2D &rotation)
ActiveVertexContour2D* getSelectedActiveVertex() const
void getSelectedEdgeColor(float &r, float &g, float &b) const
float getSelectedEdgeWidth() const
EdgeActiveContour2D* getSelectedEdge() const
EdgeActiveContour2D* getPreviousSelectedEdge() const
void setSelectedEdgeColor(const float r, const float g, const float b)
void setSelectedEdgeWidth(const float w)
void setSelectedEdge(EdgeActiveContour2D *e)
void setShowClosestPoint(const bool b)
void setShowRangeDistance(const bool b)
bool getShowRangeDistance() const
bool getShowClosestPoint() const
ActiveVertexContour2D* getSelectedActiveVertex2D() const
AContourLine2D* getSelectedActiveLine2D() const
void selectEdge(const Vec2 &pixel, Camera2D *cam)
virtual void selectObject(const Vec2 pixel, Camera2D *cam)

Protected Fields

bool topologyChanged
RangeInformation* rangeInformation
SparseMatrix* rigidityMatrix
mtl::dense1D * forceVector
mtl::dense1D * resultVector
EdgeActiveContour2D* selectedEdge
EdgeActiveContour2D* previousSelectedEdge
float selectedEdgeColor[3]
static const float defaultSelectedEdgeColor[3]
float selectedEdgeWidth
static const float defaultSelectedEdgeWidth
static const bool defaultShowClosestPoint
bool showClosestPoint
static const bool defaultShowRangeDistance
bool showRangeDistance

Protected Methods

void initActiveContour()
void initColor(void)

Private Fields

TimeDiscretizationScheme timeScheme
InternalForceContour2D* internalForce

Private Methods

void initGeometry()

Inherited from Contour2D:

Public Classes

class EdgeGridIntersection
enum IntersectionType
does the intersection corresponds to the intersection between a contour edge with a row or column ?
Vec2 position
the intersection position
IntersectionType type
the type of intersection
VertexContour2D* previousVertex
the previous vertex defining the edge
Vec2 getPosition() const
returns the intersection position
VertexContour2D* getPreviousVertex() const
returns the previous vertex defining the edge
Constructors
EdgeGridIntersection(IntersectionType t, Vec2 &pos, VertexContour2D *v)
Build an edge intersection knowing if it is occurs along a row or column edge, it position along the edge and the corresponding edge of the contour (through v->edge)
Destructor
virtual ~EdgeGridIntersection()
empty destructor
class EdgeGridPixel: public ListElement<EdgeGridPixel>
VertexContour2D* vertex
the vertex may be a VertexContour2D when it corresponds to the end of the contour
EdgeGridIntersection* edgeIntersection
the vertex may also be a EdgeGridIntersection
Constructors
GridPixelVertex(VertexContour2D *v)
Build a GridPixelVertex consisting of a single vertex
GridPixelVertex(EdgeGridIntersection *e)
Build a GridPixelVertex consisting of a grid intersection
GridPixelVertex()
Build a GridPixelVertex without any vertex
GridPixelVertex(GridPixelVertex &iv)
Build a GridPixelVertex given another GridPixelVertex
Destructor
virtual ~GridPixelVertex()
empty destructor
void setVertex(VertexContour2D *v)
set the vertex as a VertexContour2D
void setEdgeIntersection(EdgeGridIntersection *e)
set the vertex as a EdgeGridIntersection
VertexContour2D* getVertex() const
returns the vertex as a VertexContour2D (may be 0)
EdgeGridIntersection* getEdgeIntersection() const
returns the vertex as a EdgeGridIntersection (may be 0)
Vec2 getPosition() const
returns the position of the vertex
ContourLine* getLine() const
return the line where the pixel vertex belongs
GridPixelVertex vertex[2]
the 2 extremities of the edge
Constructors
EdgeGridPixel(GridPixelVertex &iv1, GridPixelVertex &iv2 )
Create a EdgeGridPixel given its 2 extremities
Destructor
virtual ~EdgeGridPixel()
empty destructor
bool isValid() const
test if the edge is valid i
Vec2 getPosition(unsigned int i) const
returns the position of the vertex
VertexContour2D* getVertex(unsigned int i) const
returns the VertexContour2D associated with one its extremity (may be 0)
EdgeGridIntersection* getEdgeIntersection(unsigned int i) const
returns the EdgeGridIntersection associated with one its extremity (may be 0)
class GridPixel
ObjectsList <EdgeGridPixel> edgeList
the list of grid edges
const int row
the row index of the pixel
const int col
the column index of the pixel
Constructors
GridPixel(const int r, const int c)
constructor based on the pixel row and column index
Destructor
virtual ~GridPixel()
empty destructor
int getRowIndex() const
returns the row index of the grid pixel
int getColumnIndex() const
returns the column index of the grid pixel
unsigned int getNbEdges() const
returns the number of edges in the pixel grid
ObjectsList <EdgeGridPixel> ::iterator firstEdge()
returns an iterator on the first edge
ObjectsList <EdgeGridPixel> ::iterator lastEdge()
returns an iterator on the last edge

Public Methods

void read(TclString filename)
void write(TclString filename)
std::map GridPixel *, std::less > & getPixelTable()
Vec2 computeCenter() const
void updateCenter(Vec2& center, unsigned int& n)
double updateRadius(const Vec2& center)
virtual void translateLine(const Vec2& t)
virtual void scaleLine(const double scale)
virtual void rotateLine(const Rotation2D &rotation)
void computeBoundingBox(double &minx, double &maxx, double &miny, double &minz) const
void buildGridIntersection(double distance)
void removeGridIntersectionInformation(void)
void readModule(GFInput &input) throw(ContourLine2D::EmptyLine)
void skipModule(GFInput &input)
void writeModule(GFOutput &output)
void computeTangent()
void saveAsMapleFile(const char *name)
VertexContour2D* getSelectedVertex() const
ContourLine2D* getSelectedLine() const
void updateBoundingBox()
void drawLine(Camera2D *c, TclCamera2D *cam, ContourLine2D *l)
double computeClosestDistance(DataTypes::MouseClick& mc) const
virtual void moveVertex(const Vec2& pixel, Camera2D *cam)
virtual void addVertex(const Vec2& pixel, Camera2D *cam)
virtual void insertVertex(const Vec2& pixel, Camera2D *cam)
void setSelectedLine(ContourLine2D *l)
void setSelectedVertex(VertexContour2D *v)

Public

Destructor

virtual ~Contour2D()
destructor of a 2D contour

Protected Fields

std::list <EdgeGridIntersection *> edgeIntersectionList
std::map GridPixel *, std::less > pixelTable
VertexContour2D* selectedVertex
ContourLine2D* selectedLine

Private Methods

void initFormat()

Inherited from Contour:

Public Classes

template class VertexIterator
const Contour* contour
the contour where are the vertices
ObjectsList <ContourLine> :: iterator currentLine
the current Line pointed by the iterator
ObjectsList <VertexContour> :: iterator currentVertex
the current vertex pointed by the iterator
constructor
VertexIterator(const Contour *c)
Build a VertexIterator given a Contour
T* operator++(int) throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator ++ that pre-increment the iterator
T* operator++(void) throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator ++ that post-increment the iterator
T* operator *(void) const throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator () that returns the pointed element
void first(void)
set the iterator to point on the first vertex
bool isAtEnd(void)
returns true if list end was reached and there is no current element anymore
enum DisplayMode
enum VertexDisplayMode
enum SelectionMode

Public Methods

ObjectsList <ContourLine> ::iterator firstLineContour() const
ObjectsList <ContourLine> ::iterator lastLineContour() const
void addLine(ContourLine *l)
unsigned int getNbLines() const
unsigned int getNbVertices() const
void getLineColor(float &r, float &g, float &b) const
void getSelectedLineColor(float &r, float &g, float &b) const
void getVertexColor(float &r, float &g, float &b) const
void getSelectedVertexColor(float &r, float &g, float &b) const
float getLineWidth() const
float getVertexSize() const
DisplayMode getDisplayMode() const
SelectionMode getSelectionMode() const
VertexDisplayMode getVertexDisplayMode() const
void setLineColor(const float r, const float g, const float b)
void setSelectedLineColor(const float r, const float g, const float b)
void setVertexColor(const float r, const float g, const float b)
void setSelectedVertexColor(const float r, const float g, const float b)
void setLineWidth(const float w)
void setVertexSize(const float s)
void setDisplayMode(const DisplayMode mode)
void setVertexDisplayMode(const VertexDisplayMode mode)
void setSelectionMode(const SelectionMode mode)

Public

constructor

Contour()
Build a contour

Protected Fields

ObjectsList <ContourLine> lineList
float lineColor[3]
static const float defaultLineColor[3]
float selectedLineColor[3]
static const float defaultSelectedLineColor[3]
float selectedVertexColor[3]
static const float defaultSelectedVertexColor[3]
float vertexColor[3]
static const float defaultVertexColor[3]
float lineWidth
static const float defaultLineWidth
float vertexSize
static const float defaultVertexSize
DisplayMode displayMode
VertexDisplayMode vertexDisplayMode
SelectionMode selectionMode

Documentation

a 2D active contour that is attached to a given slice of a volumetric image
SliceCamera::SLICE_ORIENTATION sliceGeometry
the geometry (along which axis) of the slice

double sliceDistance
the distance between two slices

SliceContour3D* interface3D
the 3D interface associated with a 2D slice active contour

SliceCamera::SLICE_ORIENTATION getSliceGeometry() const
get the slice geometry of the active contour

void setSliceGeometry(const SliceCamera::SLICE_ORIENTATION geometry)
set the slice geometry of the active contour

virtual void recompute(SliceCamera *cam)
slice changed callback
Parameters:
cam - camera whose slice changed

virtual void redraw(Camera2D *cam)
redraw the slice active contour : if the camera is a slice-camera then the contour is drawn only if the slice index is equal to the slice number of the slice active contour. Otherwise, the contour is always displayed
Parameters:
cam - camera where the contour should be drawn

Constructors

SliceActiveContour2D(const TclString filename, Scene2D *scene=NULL, SliceCamera::SLICE_ORIENTATION geometry=SliceCamera::SLICE_Z)
Reads the slice active contour from a file
Parameters:
filename - the name of the file where is described the contour
scene - : the Scene2D where the contour should be placed (since it is a Data2D and DeformableModel2D)
slice - the slice number (may be overriden by reading the file)
geometry - the geometry of the slice (may be overidden by reading the file)

SliceActiveContour2D(const unsigned int nbLines, const unsigned int *nbVertices, Vec2 **array, const ContourLine::Topology *top, Scene2D *scene=NULL, int slice=0, SliceCamera::SLICE_ORIENTATION geometry=SliceCamera::SLICE_Z)
Builds a slice active contour given a set of lines
Parameters:
nbLines - the number of lines that compose the active contour
nbVertices - the number of the vertices of each line. It is an array of size nbLines
array - the array of 2D vertices that are in each line. The first index of the array "lineIndex" is the index of the line (lineIndextop - the array describing the topology of each line (either closed or opened)
scene - : the Scene2D where the contour should be placed (since it is a Data2D and DeformableModel2D)
slice - the slice number (may be overriden by reading the file)
geometry - the geometry of the slice (may be overidden by reading the file)

SliceActiveContour2D(const SliceActiveContour2D *_sliceContour, int slice=0)
Builds a slice active contour given another slice active contour
Parameters:
_sliceContour - a given slice active contour
slice - the slice number

destructor

virtual ~SliceActiveContour2D()
empty

void readSliceModule(GFInput &input)
the function that reads the slice geometry and number of the contour

void skipSliceModule(GFInput &input)
the function that skipss the slice geometry and number of the contour

void writeSliceModule(GFOutput &output)
the function that writes the slice geometry and number of the contour

void setSliceDistance(const double l)
set the slice distance of the slice contours in 3D

double getSliceDistance() const
returns the distance between two slices

Vec3 get3DPosition(Vec2 p, unsigned int sliceNumber)
returns a 3D position vector given the position of 2D vertex : this position depends on the slice number and slice geometry and the slice distance
Parameters:
p - 2D position of a vertex within a slice
sliceNumber - the slice number of the vertex

void initGeneralFormat()
initialize the general format routines

virtual void computeExternalForce()
compute the external force on all contour vertices

void moveSliceCameras(unsigned int _sliceNumber)
change the slice number of all the slice cameras in the same scene as the slice active contour 2D

virtual void selectLine(const Vec2& pixel, Camera2D *cam)
select the contour line closest from a given position and set the selectedLine variable
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 2D camera

virtual void selectVertex(const Vec2& pixel, Camera2D *cam)
select the contour vertex closest from a given position and set the selectedVertex variable
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 2D camera

virtual void grabVertex(const Vec2 pixel, Camera2D *cam)
applies an external force that attract the closest contour vertex towards a pixel position
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 2D camera


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de