SourceXtractorPlusPlus
0.10
Please provide a description of the project.
SEImplementation
src
lib
Plugin
WorldCentroid
WorldCentroidTask.cpp
Go to the documentation of this file.
1
17
/*
18
* WorldCentroidTask.cpp
19
*
20
* Created on: Nov 21, 2016
21
* Author: mschefer
22
*/
23
24
#include "
SEFramework/Property/DetectionFrame.h
"
25
26
#include "
SEImplementation/Property/PixelCoordinateList.h
"
27
#include "
SEImplementation/Plugin/DetectionFramePixelValues/DetectionFramePixelValues.h
"
28
#include "
SEImplementation/Plugin/PixelCentroid/PixelCentroid.h
"
29
#include "
SEImplementation/Plugin/WorldCentroid/WorldCentroid.h
"
30
31
#include "
SEImplementation/Plugin/WorldCentroid/WorldCentroidTask.h
"
32
33
namespace
SourceXtractor
{
34
35
void
WorldCentroidTask::computeProperties
(
SourceInterface
& source)
const
{
36
auto
coordinate_system = source.
getProperty
<
DetectionFrame
>().getFrame()->getCoordinateSystem();
37
38
ImageCoordinate
image_coordinate(
39
source.
getProperty
<
PixelCentroid
>().
getCentroidX
(), source.
getProperty
<
PixelCentroid
>().getCentroidY());
40
41
auto
world_coordinate = coordinate_system->imageToWorld(image_coordinate);
42
43
source.
setProperty
<
WorldCentroid
>(world_coordinate.m_alpha, world_coordinate.m_delta);
44
}
45
46
}
47
SourceXtractor::ImageCoordinate
Definition:
CoordinateSystem.h:42
PixelCoordinateList.h
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition:
SourceInterface.h:72
SourceXtractor::WorldCentroidTask::computeProperties
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition:
WorldCentroidTask.cpp:35
WorldCentroid.h
SourceXtractor::PixelCentroid
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values.
Definition:
PixelCentroid.h:37
SourceXtractor::DetectionFrame
Definition:
DetectionFrame.h:33
SourceXtractor::PixelCentroid::getCentroidX
SeFloat getCentroidX() const
X coordinate of centroid.
Definition:
PixelCentroid.h:48
PixelCentroid.h
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
DetectionFrame.h
SourceXtractor::WorldCentroid
Definition:
WorldCentroid.h:32
DetectionFramePixelValues.h
WorldCentroidTask.h
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
Generated by
1.8.15