USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::CameraFocalPlaneMap Class Reference

#include <CameraFocalPlaneMap.h>

Inheritance diagram for Isis::CameraFocalPlaneMap:

Inheritance graph
[legend]
Collaboration diagram for Isis::CameraFocalPlaneMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

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:

 x = transx[0] + sample * transx[1] + line * transx[2];
 y = transy[0] + sample * transy[1] + line * transy[2];
 
 where, transx and transy are the coefficients from the naif kernel.
 The should be in the form of:
 
 INSxxxxxx_TRANSX = ( a, b, c)
 INSxxxxxx_TRANSY = ( d, e, f)
 
 where, xxxxxx is the NAIF instrument id code.

Likewise, the inverse transform is:

 samp = itranss[0] + x * itranss[1] + y * itranss[2];
 line = itransl[0] + x * itransl[1] + y * itransl[2];
 
 where, itranss and itranss are the coefficients from the naif kernel.
 The should be in the form of:
 
 INSxxxxxx_ITRANSS = ( a, b, c)
 INSxxxxxx_ITRANSL = ( d, e, f)
 
 where, xxxxxx is the NAIF instrument id code.

Author:
Jeff Anderson 2005-02-05
See also:
Camera

For internal use only.

History:
2007-02-13 Debbie A. Cook - Added methods SignMostSigX() and SignMostSigY()

Definition at line 77 of file CameraFocalPlaneMap.h.

Public Types

 Sample = 1
 Line = 2
enum  FocalPlaneXDependencyType { Sample = 1, Line = 2 }

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.
virtual ~CameraFocalPlaneMap ()
 Destructor.
virtual bool SetDetector (const double sample, const double line)
 Compute distorted focal plane coordinate from detector position.
virtual bool SetFocalPlane (const double dx, const double dy)
 Compute detector position from focal plane coordinate.
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.
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

Camerap_camera
double p_detectorLineOrigin
double p_detectorSampleOrigin
double p_focalPlaneX
double p_focalPlaneY
double p_detectorLine
double p_detectorSample
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)


Constructor & Destructor Documentation

Isis::CameraFocalPlaneMap::CameraFocalPlaneMap ( Camera parent,
const int  naifIkCode 
)

Construct mapping between detectors and focal plane x/y.

Parameters:
parent parent camera that will use this map
naifIkCode code of the naif instrument for reading coefficients

Definition at line 34 of file CameraFocalPlaneMap.cpp.

References Init().

Isis::CameraFocalPlaneMap::CameraFocalPlaneMap ( const int  naifIkCode  ) 

Construct mapping between detectors and focal plane x/y.

Parameters:
naifIkCode code of the naif instrument for reading coefficients

Definition at line 43 of file CameraFocalPlaneMap.cpp.

References Init().

virtual Isis::CameraFocalPlaneMap::~CameraFocalPlaneMap (  )  [inline, virtual]

Destructor.

Definition at line 83 of file CameraFocalPlaneMap.h.


Member Function Documentation

double Isis::CameraFocalPlaneMap::CenteredDetectorLine (  )  const [inline]

Return centered detector line.

Definition at line 105 of file CameraFocalPlaneMap.h.

References p_centeredDetectorLine.

double Isis::CameraFocalPlaneMap::CenteredDetectorSample (  )  const [inline]

Return centered detector sample.

Definition at line 102 of file CameraFocalPlaneMap.h.

References p_centeredDetectorSample.

void Isis::CameraFocalPlaneMap::ComputeCentered (  )  [inline, protected]

Convenience method to center detector origin (use when inheriting).

Definition at line 160 of file CameraFocalPlaneMap.h.

References p_centeredDetectorLine, p_centeredDetectorSample, p_detectorLine, p_detectorLineOrigin, p_detectorSample, and p_detectorSampleOrigin.

Referenced by SetDetector().

void Isis::CameraFocalPlaneMap::ComputeUncentered (  )  [inline, protected]

Convenience method to center detector origin (use when inheriting).

Definition at line 166 of file CameraFocalPlaneMap.h.

References p_centeredDetectorLine, p_centeredDetectorSample, p_detectorLine, p_detectorLineOrigin, p_detectorSample, and p_detectorSampleOrigin.

Referenced by SetFocalPlane().

double Isis::CameraFocalPlaneMap::DetectorLine (  )  const [inline]

Return detector line.

Definition at line 99 of file CameraFocalPlaneMap.h.

References p_detectorLine.

Referenced by Isis::ControlPoint::ComputeErrors(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::LineScanCameraGroundMap::FindFocalPlane(), Isis::Camera::RawFocalPlanetoImage(), Isis::Lo::LoMediumDistortionMap::SetDistortion(), Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), Isis::LineScanCameraSkyMap::SetSky(), and Isis::Lo::LoMediumDistortionMap::SetUndistortedFocalPlane().

double Isis::CameraFocalPlaneMap::DetectorLineOffset (  )  const [inline]

Return detector line offset.

Definition at line 143 of file CameraFocalPlaneMap.h.

References p_detectorLineOffset.

Referenced by Isis::LineScanCameraGroundMap::FindFocalPlane(), Isis::VariableLineScanCameraDetectorMap::SetParent(), Isis::LineScanCameraDetectorMap::SetParent(), and Isis::LineScanCameraSkyMap::SetSky().

double Isis::CameraFocalPlaneMap::DetectorLineOrigin (  )  const [inline]

Return detector line origin.

Definition at line 122 of file CameraFocalPlaneMap.h.

References p_detectorLineOrigin.

Referenced by Isis::ReseauDistortionMap::SetFocalPlane(), and Isis::ReseauDistortionMap::SetUndistortedFocalPlane().

double Isis::CameraFocalPlaneMap::DetectorSample (  )  const [inline]

Return detector sample.

Definition at line 96 of file CameraFocalPlaneMap.h.

References p_detectorSample.

Referenced by Isis::ControlPoint::ComputeErrors(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::Camera::RawFocalPlanetoImage(), Isis::Lo::LoMediumDistortionMap::SetDistortion(), Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), and Isis::Lo::LoMediumDistortionMap::SetUndistortedFocalPlane().

double Isis::CameraFocalPlaneMap::DetectorSampleOffset (  )  const [inline]

Return detector sample offset.

Definition at line 146 of file CameraFocalPlaneMap.h.

References p_detectorSampleOffset.

double Isis::CameraFocalPlaneMap::DetectorSampleOrigin (  )  const [inline]

Return detector sample origin.

Definition at line 125 of file CameraFocalPlaneMap.h.

References p_detectorSampleOrigin.

Referenced by Isis::ReseauDistortionMap::SetFocalPlane(), and Isis::ReseauDistortionMap::SetUndistortedFocalPlane().

double Isis::CameraFocalPlaneMap::FocalPlaneX (  )  const [inline]

Return distorted focal plane x.

Definition at line 90 of file CameraFocalPlaneMap.h.

References p_focalPlaneX.

Referenced by Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::Lo::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.

Returns:
dependency variable

Definition at line 135 of file CameraFocalPlaneMap.cpp.

References p_transx.

double Isis::CameraFocalPlaneMap::FocalPlaneY (  )  const [inline]

Return distorted focal plane y.

Definition at line 93 of file CameraFocalPlaneMap.h.

References p_focalPlaneY.

Referenced by Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::Lo::LoMediumDistortionMap::SetUndistortedFocalPlane().

bool Isis::CameraFocalPlaneMap::SetDetector ( const double  sample,
const double  line 
) [virtual]

Compute distorted focal plane coordinate from detector position.

This method will compute both the distorted focal plane x/y and centered detector position given a detector position

Parameters:
sample undistorted focal plane x in millimeters
line undistorted focal plane y in millimeters
Returns:
conversion was successful

Definition at line 116 of file CameraFocalPlaneMap.cpp.

References ComputeCentered(), p_centeredDetectorLine, p_centeredDetectorSample, p_detectorLine, p_detectorSample, p_focalPlaneX, p_focalPlaneY, p_transx, and p_transy.

Referenced by Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), and Isis::Lo::LoMediumDistortionMap::SetUndistortedFocalPlane().

void Isis::CameraFocalPlaneMap::SetDetectorOffset ( const double  sampleOffset,
const double  lineOffset 
) [inline]

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

Parameters:
sampleOffset sample offset in pixels
lineOffset sample offset in lines

Definition at line 136 of file CameraFocalPlaneMap.h.

References p_detectorLineOffset, and p_detectorSampleOffset.

Referenced by Isis::Mro::CTXCamera::CTXCamera(), Isis::Mro::HiriseCamera::HiriseCamera(), Isis::Lro::LroNarrowAngleCamera::LroNarrowAngleCamera(), Isis::Mgs::MocNarrowAngleCamera::MocNarrowAngleCamera(), Isis::Mgs::MocWideAngleCamera::MocWideAngleCamera(), Isis::Odyssey::ThemisIrCamera::SetBand(), and Isis::Odyssey::ThemisIrCamera::ThemisIrCamera().

void Isis::CameraFocalPlaneMap::SetDetectorOrigin ( const double  sample,
const double  line 
) [inline]

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.

Parameters:
sample detector sample at the origin
line detector line at the origin

Definition at line 116 of file CameraFocalPlaneMap.h.

References p_detectorLineOrigin, and p_detectorSampleOrigin.

Referenced by Isis::Mro::CTXCamera::CTXCamera(), Clementine::HiresCamera::HiresCamera(), Isis::Mro::HiriseCamera::HiriseCamera(), Isis::Mex::HrscCamera::HrscCamera(), Isis::IdealCamera::IdealCamera(), Cassini::IssNACamera::IssNACamera(), Cassini::IssWACamera::IssWACamera(), Isis::Lo::LoHighCamera::LoHighCamera(), Isis::Lo::LoMediumCamera::LoMediumCamera(), Isis::Lro::LroNarrowAngleCamera::LroNarrowAngleCamera(), Isis::Lro::LroWideAngleCamera::LroWideAngleCamera(), Clementine::LwirCamera::LwirCamera(), Isis::Mro::MarciCamera::MarciCamera(), Isis::Messenger::MdisCamera::MdisCamera(), Isis::Mgs::MocNarrowAngleCamera::MocNarrowAngleCamera(), Isis::Mgs::MocWideAngleCamera::MocWideAngleCamera(), Clementine::NirCamera::NirCamera(), Isis::Odyssey::ThemisIrCamera::SetBand(), Galileo::SsiCamera::SsiCamera(), Isis::Odyssey::ThemisIrCamera::ThemisIrCamera(), Isis::Odyssey::ThemisVisCamera::ThemisVisCamera(), Clementine::UvvisCamera::UvvisCamera(), and Isis::VikingCamera::VikingCamera().

bool Isis::CameraFocalPlaneMap::SetFocalPlane ( const double  dx,
const double  dy 
) [virtual]

Compute detector position from focal plane coordinate.

This method will compute both the centered and normal detector position given a distorted focal plane coordinate.

Parameters:
dx distorted focal plane x in millimeters
dy distorted focal plane y in millimeters
Returns:
conversion was successful

Definition at line 94 of file CameraFocalPlaneMap.cpp.

References ComputeUncentered(), p_centeredDetectorLine, p_centeredDetectorSample, p_focalPlaneX, p_focalPlaneY, p_itransl, and p_itranss.

Referenced by Isis::ControlPoint::ComputeErrors(), Isis::PushFrameCameraGroundMap::FindDistance(), Isis::LineScanCameraGroundMap::FindFocalPlane(), Isis::Camera::RawFocalPlanetoImage(), Isis::Lo::LoMediumDistortionMap::SetDistortion(), Isis::Lo::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), Isis::LineScanCameraSkyMap::SetSky(), and Isis::Lo::LoMediumDistortionMap::SetUndistortedFocalPlane().

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.

Returns:
sign of most significant coefficient

Definition at line 154 of file CameraFocalPlaneMap.cpp.

References p_transx.

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.

Returns:
sign of most significant coefficient

Definition at line 177 of file CameraFocalPlaneMap.cpp.

References p_transy.


The documentation for this class was generated from the following files: