SciDAVis
1.D4
|
Plot tool for calculating intensity profiles of image markers along a line. More...
#include <LineProfileTool.h>
Signals | |
void | createTablePlot (const QString &, const QString &, QList< Column * >) |
void | statusText (const QString &) |
Public Member Functions | |
void | calculateLineProfile (const QPoint &start, const QPoint &end) |
LineProfileTool (Graph *graph, int average_pixels) | |
Standard constructor. | |
virtual RTTI | rtti () const |
Public Member Functions inherited from PlotToolInterface | |
PlotToolInterface (Graph *graph) | |
virtual | ~PlotToolInterface () |
Protected Member Functions | |
void | addLineMarker (const QPoint &start, const QPoint &end) |
int | averageImagePixel (const QImage &image, int px, int py, bool moreHorizontal) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
Mouse movements need to be monitored for updating the line during operation. | |
virtual void | mousePressEvent (QMouseEvent *e) |
Pressing the left mouse button starts line selection. | |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
Mouse releases end line selection and cause the profile to be displayed. | |
virtual void | paintEvent (QPaintEvent *e) |
Draw line during operation (replaced by a LineMarker at the end). |
Private Attributes | |
int | d_average_pixels |
Number of image pixels over which to average. | |
QPoint | d_op_dp |
Difference between current and start position during operation. | |
QPoint | d_op_start |
Mouse position where an operation started. | |
ImageMarker * | d_target |
The image marker to operate on. |
Additional Inherited Members | |
Public Types inherited from PlotToolInterface | |
enum | RTTI { DataPicker, ScreenPicker, LineProfile, MultiPeak, RangeSelector, TranslateCurve } |
Protected Attributes inherited from PlotToolInterface | |
Graph * | d_graph |
Plot tool for calculating intensity profiles of image markers along a line.
It is assumed that on the parent Graph an ImageMarker is selected. During initialization, a pointer to this marker is stored and the selection is removed. The LineProfileTool adds itself as a full-sized child widget to the Graph's canvas, allowing for fast redraws while selection of the line is in progress. Once the line is selected (mouse button is released), the profile is calculate and displayed, a new LineMarker denoting the selected profile line is added to the Graph and the LineProfileTool deletes itself by setting the Graph's active tool to NULL.
Actually, image analysis doesn't fit terribly well into the Graph framework. A cleaner approach would be to add a new MyWidget subclass (Image?) that operates on a single image, providing things like line profiles, intensity tables and measuring points on scanned graphs (simple g3data-like functionality). There could be facilities for making an Image from an ImageMarker and vice versa (if that's really needed). [ postponed until after the redesign of project handling ]
LineProfileTool::LineProfileTool | ( | Graph * | graph, |
int | average_pixels | ||
) |
Standard constructor.
References d_average_pixels, PlotToolInterface::d_graph, d_op_dp, d_op_start, d_target, Graph::deselectMarker(), and Graph::selectedMarkerPtr().
|
protected |
References Graph::addArrow(), PlotToolInterface::d_graph, ArrowMarker::drawEndArrow(), ArrowMarker::drawStartArrow(), Graph::plotWidget(), Graph::replot(), ArrowMarker::setColor(), ArrowMarker::setEndPoint(), ArrowMarker::setStartPoint(), ArrowMarker::setStyle(), and ArrowMarker::setWidth().
Referenced by mouseReleaseEvent().
|
protected |
References d_average_pixels.
Referenced by calculateLineProfile().
void LineProfileTool::calculateLineProfile | ( | const QPoint & | start, |
const QPoint & | end | ||
) |
References averageImagePixel(), createTablePlot(), PlotToolInterface::d_graph, d_target, SciDAVis::Numeric, ImageMarker::origin(), ImageMarker::pixmap(), ImageMarker::rect(), Column::setPlotDesignation(), Column::setValueAt(), sgn, ImageMarker::size(), SciDAVis::X, and SciDAVis::Y.
Referenced by mouseReleaseEvent().
|
signal |
Referenced by calculateLineProfile().
|
protectedvirtual |
Mouse movements need to be monitored for updating the line during operation.
References d_op_dp, and d_op_start.
|
protectedvirtual |
Pressing the left mouse button starts line selection.
Clicks with anything else than the left button are propagated to the parent as usual.
References d_op_start.
|
protectedvirtual |
Mouse releases end line selection and cause the profile to be displayed.
References addLineMarker(), calculateLineProfile(), PlotToolInterface::d_graph, d_op_start, and Graph::setActiveTool().
|
protectedvirtual |
Draw line during operation (replaced by a LineMarker at the end).
References d_op_dp, and d_op_start.
|
inlinevirtual |
Implements PlotToolInterface.
References PlotToolInterface::LineProfile.
|
signal |
Emitted whenever a new message should be presented to the user.
You don't have to connect to this signal if you alreay specified a reciever during initialization.
|
private |
Number of image pixels over which to average.
Referenced by averageImagePixel(), and LineProfileTool().
|
private |
Difference between current and start position during operation.
Referenced by LineProfileTool(), mouseMoveEvent(), and paintEvent().
|
private |
Mouse position where an operation started.
Referenced by LineProfileTool(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and paintEvent().
|
private |
The image marker to operate on.
Referenced by calculateLineProfile(), and LineProfileTool().