Isis 3.0 Object Programmers' Reference |
Home |
Convert between distorted focal plane and detector coordinates. More...
#include <CameraFocalPlaneMap.h>
Public Types | |
enum | FocalPlaneXDependencyType { Sample = 1, Line = 2 } |
Focal plane x dependency indicates whether the x value of the focal plane coordinate maps to a sample or a line. More... | |
Public Member Functions | |
CameraFocalPlaneMap (Camera *parent, const int naifIkCode) | |
Construct mapping between detectors and focal plane x/y. | |
CameraFocalPlaneMap (const int naifIkCode) | |
Construct mapping between detectors and focal plane x/y. | |
CameraFocalPlaneMap (Camera *parent, Affine &affine) | |
Added new method to allow programmer to pass in affine coefficients. | |
virtual | ~CameraFocalPlaneMap () |
Destructor. | |
virtual bool | SetDetector (const double sample, const double line) |
Compute distorted focal plane coordinate from detector position (sampel,line) | |
virtual bool | SetFocalPlane (const double dx, const double dy) |
Compute detector position (sample,line) from focal plane coordinates. | |
double | FocalPlaneX () const |
Return distorted focal plane x. | |
double | FocalPlaneY () const |
Return distorted focal plane y. | |
double | DetectorSample () const |
Return detector sample. | |
double | DetectorLine () const |
Return detector line. | |
double | CenteredDetectorSample () const |
Return centered detector sample. | |
double | CenteredDetectorLine () const |
Return centered detector line. | |
void | SetDetectorOrigin (const double sample, const double line) |
Set the detector origin. | |
double | DetectorLineOrigin () const |
Return detector line origin. | |
double | DetectorSampleOrigin () const |
Return detector sample origin. | |
void | SetDetectorOffset (const double sampleOffset, const double lineOffset) |
Set the detector offset. | |
double | DetectorLineOffset () const |
Return detector line offset. | |
double | DetectorSampleOffset () const |
Return detector sample offset. | |
void | SetTransL (const QVector< double > transL) |
Set the affine coefficients for converting destorted (x,y) to a detector Line. | |
void | SetTransS (const QVector< double > transS) |
Set the affine coefficients for converting destorted (x,y) to a detector Sample. | |
void | SetTransX (const QVector< double > transX) |
Set the affine coefficients for converting detector (sample,line) to a distorted X. | |
void | SetTransY (const QVector< double > transY) |
Set the affine coefficients for converting detector (sample,line) to a distorted Y. | |
const double * | TransL () const |
Return the affine coefficients for converting distorted (x,y) to a detector Line. | |
const double * | TransS () const |
Return the affine coefficients for converting distorted (x,y) to a detector Sample. | |
const double * | TransX () const |
Return the affine coefficients for converting detector (sample,line) to a distorted X. | |
const double * | TransY () const |
Return the affine coefficients for converting detector (sample,line) to distorted Y. | |
int | FocalPlaneXDependency () |
Return the focal plane x dependency variable. | |
double | SignMostSigX () |
Return the sign of the p_transx coefficient with the greatest magnitude. | |
double | SignMostSigY () |
Return the sign of the p_transy coefficient with the greatest magnitude. | |
Protected Member Functions | |
void | ComputeCentered () |
Convenience method to center detector origin (use when inheriting) | |
void | ComputeUncentered () |
Convenience method to center detector origin (use when inheriting) | |
Protected Attributes | |
Camera * | p_camera |
double | p_detectorLineOrigin |
double | p_detectorSampleOrigin |
double | p_focalPlaneX |
x value of focal plane coordinate | |
double | p_focalPlaneY |
y value of focal plane coordinate | |
double | p_detectorLine |
line value of the detector | |
double | p_detectorSample |
sample value of the detector | |
double | p_centeredDetectorSample |
double | p_centeredDetectorLine |
double | p_detectorLineOffset |
double | p_detectorSampleOffset |
double | p_transx [3] |
double | p_transy [3] |
double | p_itranss [3] |
double | p_itransl [3] |
Private Member Functions | |
void | Init (Camera *parent, const int naifIkCode) |
Initialize the focal plane map to its default state. | |
Convert between distorted focal plane and detector coordinates.
This base class is used to convert between distorted focal plane coordinates (x/y) in millimeters and detector coordinates in pixels. The class expects to find a set of coefficients in the naif instrument (or instrument addendum) kernel that describe the transform from detector to focal plane and vice versa. The transform from detector to focal plane is:
Likewise, the inverse transform is:
2007-02-13 Debbie A. Cook - Added methods SignMostSigX() and SignMostSigY()
2011-05-25 Janet Barrett and Steven Lambright - Spice::GetDouble is no longer static.
2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.
2012-11-21 Jeannie Backer - Added accesssor methods: TransX(), TransY(), TransS(), and TransL(). These are tested by application hideal2pds since no unitTest exists. Fixed indentation of history entries, order of includes, moved method implementations to cpp, and fixed control statement padding to be more compliant with Isis standards. Added documentation to member variables.References #678.
2014-03-27 Jeff Anderson - Added constructor which takes an Affine transform instead of only reading from NAIF kernels to obtain the transform. This is required for non-NAIF instruments such as Aerial photos.
Definition at line 100 of file CameraFocalPlaneMap.h.
Focal plane x dependency indicates whether the x value of the focal plane coordinate maps to a sample or a line.
Enumerator | |
---|---|
Sample |
The x value of the focal plane maps to a sample. |
Line |
The x value of the focal plane maps to a line. |
Definition at line 138 of file CameraFocalPlaneMap.h.
Isis::CameraFocalPlaneMap::CameraFocalPlaneMap | ( | Camera * | parent, |
const int | naifIkCode | ||
) |
Construct mapping between detectors and focal plane x/y.
parent | parent camera that will use this map |
naifIkCode | code of the naif instrument for reading coefficients |
Definition at line 41 of file CameraFocalPlaneMap.cpp.
References Init().
Isis::CameraFocalPlaneMap::CameraFocalPlaneMap | ( | const int | naifIkCode | ) |
Construct mapping between detectors and focal plane x/y.
naifIkCode | code of the naif instrument for reading coefficients |
Definition at line 51 of file CameraFocalPlaneMap.cpp.
References Init().
Added new method to allow programmer to pass in affine coefficients.
parent | Parent camera |
affine | Affine transform containing the coefficients for both transforms to (samp,line) to (x,y) and reverse |
Definition at line 65 of file CameraFocalPlaneMap.cpp.
References Isis::Affine::Coefficients(), Isis::Affine::InverseCoefficients(), and Isis::Camera::SetFocalPlaneMap().
|
virtual |
Destructor.
Definition at line 98 of file CameraFocalPlaneMap.cpp.
double Isis::CameraFocalPlaneMap::CenteredDetectorLine | ( | ) | const |
Return centered detector line.
Definition at line 283 of file CameraFocalPlaneMap.cpp.
double Isis::CameraFocalPlaneMap::CenteredDetectorSample | ( | ) | const |
Return centered detector sample.
Definition at line 277 of file CameraFocalPlaneMap.cpp.
|
protected |
Convenience method to center detector origin (use when inheriting)
Definition at line 400 of file CameraFocalPlaneMap.cpp.
References p_detectorLine, and p_detectorSample.
Referenced by SetDetector().
|
protected |
Convenience method to center detector origin (use when inheriting)
Definition at line 407 of file CameraFocalPlaneMap.cpp.
References p_detectorLine, and p_detectorSample.
Referenced by SetFocalPlane().
double Isis::CameraFocalPlaneMap::DetectorLine | ( | ) | const |
Return detector line.
Definition at line 271 of file CameraFocalPlaneMap.cpp.
References p_detectorLine.
Referenced by Isis::ControlPoint::ComputeResiduals(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::Camera::RawFocalPlanetoImage(), Isis::LoMediumDistortionMap::SetDistortion(), Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), Isis::LineScanCameraSkyMap::SetSky(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
double Isis::CameraFocalPlaneMap::DetectorLineOffset | ( | ) | const |
Return detector line offset.
Definition at line 332 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::VariableLineScanCameraDetectorMap::SetParent(), Isis::LineScanCameraDetectorMap::SetParent(), and Isis::LineScanCameraSkyMap::SetSky().
double Isis::CameraFocalPlaneMap::DetectorLineOrigin | ( | ) | const |
Return detector line origin.
Definition at line 304 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::ReseauDistortionMap::SetFocalPlane(), and Isis::ReseauDistortionMap::SetUndistortedFocalPlane().
double Isis::CameraFocalPlaneMap::DetectorSample | ( | ) | const |
Return detector sample.
Definition at line 265 of file CameraFocalPlaneMap.cpp.
References p_detectorSample.
Referenced by Isis::ControlPoint::ComputeResiduals(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::Camera::RawFocalPlanetoImage(), Isis::LoMediumDistortionMap::SetDistortion(), Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
double Isis::CameraFocalPlaneMap::DetectorSampleOffset | ( | ) | const |
Return detector sample offset.
Definition at line 338 of file CameraFocalPlaneMap.cpp.
double Isis::CameraFocalPlaneMap::DetectorSampleOrigin | ( | ) | const |
Return detector sample origin.
Definition at line 310 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::ReseauDistortionMap::SetFocalPlane(), and Isis::ReseauDistortionMap::SetUndistortedFocalPlane().
double Isis::CameraFocalPlaneMap::FocalPlaneX | ( | ) | const |
Return distorted focal plane x.
Definition at line 253 of file CameraFocalPlaneMap.cpp.
References p_focalPlaneX.
Referenced by Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
int Isis::CameraFocalPlaneMap::FocalPlaneXDependency | ( | ) |
Return the focal plane x dependency variable.
This method returns the image variable (sample or line) on which the focal plane x depends.
Definition at line 198 of file CameraFocalPlaneMap.cpp.
double Isis::CameraFocalPlaneMap::FocalPlaneY | ( | ) | const |
Return distorted focal plane y.
Definition at line 259 of file CameraFocalPlaneMap.cpp.
References p_focalPlaneY.
Referenced by Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
|
private |
Initialize the focal plane map to its default state.
parent | Parent camera |
naifIkCode | code of the naif instrument for reading coefficients |
Definition at line 108 of file CameraFocalPlaneMap.cpp.
References Isis::Spice::getDouble(), Isis::Camera::SetFocalPlaneMap(), and Isis::toString().
Referenced by CameraFocalPlaneMap().
|
virtual |
Compute distorted focal plane coordinate from detector position (sampel,line)
This method will compute both the distorted focal plane x/y and centered detector position given a detector position
sample | undistorted focal plane x in millimeters |
line | undistorted focal plane y in millimeters |
Definition at line 180 of file CameraFocalPlaneMap.cpp.
References ComputeCentered(), p_detectorLine, p_detectorSample, p_focalPlaneX, and p_focalPlaneY.
Referenced by Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
void Isis::CameraFocalPlaneMap::SetDetectorOffset | ( | const double | sampleOffset, |
const double | lineOffset | ||
) |
Set the detector offset.
This is used to set the offset between the detector origin and the average location in detector pixels where the image is being viewed. If not set the offset are both 0.0
sampleOffset | sample offset in pixels |
lineOffset | sample offset in lines |
Definition at line 324 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::Chandrayaan1M3Camera::Chandrayaan1M3Camera(), Isis::CrismCamera::CrismCamera(), Isis::CTXCamera::CTXCamera(), Isis::HiriseCamera::HiriseCamera(), Isis::KaguyaMiCamera::KaguyaMiCamera(), Isis::LroNarrowAngleCamera::LroNarrowAngleCamera(), Isis::MocNarrowAngleCamera::MocNarrowAngleCamera(), Isis::MocWideAngleCamera::MocWideAngleCamera(), Isis::ThemisIrCamera::SetBand(), and Isis::ThemisIrCamera::ThemisIrCamera().
void Isis::CameraFocalPlaneMap::SetDetectorOrigin | ( | const double | sample, |
const double | line | ||
) |
Set the detector origin.
This is used to set the origin of the detector. Typically the middle of the detector. For example, a 512x512 dectector would have the origin at (256.5,256.5). If not set both are 0.
sample | detector sample at the origin |
line | detector line at the origin |
Definition at line 297 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::AmicaCamera::AmicaCamera(), Isis::ApolloMetricCamera::ApolloMetricCamera(), Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::Chandrayaan1M3Camera::Chandrayaan1M3Camera(), Isis::CrismCamera::CrismCamera(), Isis::CTXCamera::CTXCamera(), Isis::DawnFcCamera::DawnFcCamera(), Isis::HiresCamera::HiresCamera(), Isis::HiriseCamera::HiriseCamera(), Isis::HrscCamera::HrscCamera(), Isis::IdealCamera::IdealCamera(), Isis::IssNACamera::IssNACamera(), Isis::IssWACamera::IssWACamera(), Isis::KaguyaMiCamera::KaguyaMiCamera(), Isis::LoHighCamera::LoHighCamera(), Isis::LoMediumCamera::LoMediumCamera(), Isis::LroNarrowAngleCamera::LroNarrowAngleCamera(), Isis::LwirCamera::LwirCamera(), Isis::MarciCamera::MarciCamera(), Isis::Mariner10Camera::Mariner10Camera(), Isis::MdisCamera::MdisCamera(), Isis::MocNarrowAngleCamera::MocNarrowAngleCamera(), Isis::MocWideAngleCamera::MocWideAngleCamera(), Isis::MsiCamera::MsiCamera(), Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera(), Isis::NewHorizonsLorriCamera::NewHorizonsLorriCamera(), Isis::NewHorizonsMvicFrameCamera::NewHorizonsMvicFrameCamera(), Isis::NewHorizonsMvicTdiCamera::NewHorizonsMvicTdiCamera(), Isis::NirCamera::NirCamera(), Isis::ThemisIrCamera::SetBand(), Isis::LroWideAngleCamera::SetBand(), Isis::SsiCamera::SsiCamera(), Isis::ThemisIrCamera::ThemisIrCamera(), Isis::ThemisVisCamera::ThemisVisCamera(), Isis::UvvisCamera::UvvisCamera(), Isis::VikingCamera::VikingCamera(), and Isis::VoyagerCamera::VoyagerCamera().
|
virtual |
Compute detector position (sample,line) from focal plane coordinates.
NOTE: This is detector (sample, line) not necessarily image (sample, line). If the image was reformatted from what was collected the two differ. See the New Horizons LEISA camera for an example (LEISA is a frame camera being treated as a line scan camera).
This method will compute both the centered and normal detector position given a distorted focal plane coordinate.
dx | distorted focal plane x in millimeters |
dy | distorted focal plane y in millimeters |
Definition at line 159 of file CameraFocalPlaneMap.cpp.
References ComputeUncentered(), p_focalPlaneX, and p_focalPlaneY.
Referenced by Isis::ControlPoint::ComputeResiduals(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::Camera::RawFocalPlanetoImage(), Isis::LoMediumDistortionMap::SetDistortion(), Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), Isis::LineScanCameraSkyMap::SetSky(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().
void Isis::CameraFocalPlaneMap::SetTransL | ( | const QVector< double > | transL | ) |
Set the affine coefficients for converting destorted (x,y) to a detector Line.
Definition at line 344 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::SetBand().
void Isis::CameraFocalPlaneMap::SetTransS | ( | const QVector< double > | transS | ) |
Set the affine coefficients for converting destorted (x,y) to a detector Sample.
Definition at line 352 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::SetBand().
void Isis::CameraFocalPlaneMap::SetTransX | ( | const QVector< double > | transX | ) |
Set the affine coefficients for converting detector (sample,line) to a distorted X.
Definition at line 360 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::SetBand().
void Isis::CameraFocalPlaneMap::SetTransY | ( | const QVector< double > | transY | ) |
Set the affine coefficients for converting detector (sample,line) to a distorted Y.
Definition at line 368 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::SetBand().
double Isis::CameraFocalPlaneMap::SignMostSigX | ( | ) |
Return the sign of the p_transx coefficient with the greatest magnitude.
This method returns a +1. or -1. based on the sign of the p_transx coefficient with the greatest magnitude. Only p_transx[1] and p_transx[2] are compared since p_transx[0] is used as a constant in the affine transformation.
Definition at line 217 of file CameraFocalPlaneMap.cpp.
double Isis::CameraFocalPlaneMap::SignMostSigY | ( | ) |
Return the sign of the p_transy coefficient with the greatest magnitude.
This method returns a +1 or -1 based on the sign of the p_transy coefficient with the greatest magnitude. Only p_transy[1] and p_transy[2] are compared since p_transy[0] is used as a constant in the affine transformation.
Definition at line 239 of file CameraFocalPlaneMap.cpp.
const double * Isis::CameraFocalPlaneMap::TransL | ( | ) | const |
Return the affine coefficients for converting distorted (x,y) to a detector Line.
Definition at line 394 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera().
const double * Isis::CameraFocalPlaneMap::TransS | ( | ) | const |
Return the affine coefficients for converting distorted (x,y) to a detector Sample.
Definition at line 388 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera().
const double * Isis::CameraFocalPlaneMap::TransX | ( | ) | const |
Return the affine coefficients for converting detector (sample,line) to a distorted X.
Definition at line 376 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera().
const double * Isis::CameraFocalPlaneMap::TransY | ( | ) | const |
Return the affine coefficients for converting detector (sample,line) to distorted Y.
Definition at line 382 of file CameraFocalPlaneMap.cpp.
Referenced by Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera().
|
protected |
line value of the detector
Definition at line 159 of file CameraFocalPlaneMap.h.
Referenced by ComputeCentered(), ComputeUncentered(), DetectorLine(), and SetDetector().
|
protected |
sample value of the detector
Definition at line 160 of file CameraFocalPlaneMap.h.
Referenced by ComputeCentered(), ComputeUncentered(), DetectorSample(), and SetDetector().
|
protected |
x value of focal plane coordinate
Definition at line 157 of file CameraFocalPlaneMap.h.
Referenced by FocalPlaneX(), SetDetector(), and SetFocalPlane().
|
protected |
y value of focal plane coordinate
Definition at line 158 of file CameraFocalPlaneMap.h.
Referenced by FocalPlaneY(), SetDetector(), and SetFocalPlane().