Isis 3 Programmer Reference
Isis::CameraFocalPlaneMap Class Reference

Convert between distorted focal plane and detector coordinates. More...

#include <CameraFocalPlaneMap.h>

Inheritance diagram for Isis::CameraFocalPlaneMap:
Inheritance graph
Collaboration diagram for Isis::CameraFocalPlaneMap:
Collaboration graph

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
 
double FocalPlaneY () const
 
double DetectorSample () const
 
double DetectorLine () const
 
double CenteredDetectorSample () const
 
double CenteredDetectorLine () const
 
void SetDetectorOrigin (const double sample, const double line)
 Set the detector origin.
 
double DetectorLineOrigin () const
 
double DetectorSampleOrigin () const
 
void SetDetectorOffset (const double sampleOffset, const double lineOffset)
 Set the detector offset.
 
double DetectorLineOffset () const
 
double DetectorSampleOffset () const
 
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
 
const double * TransS () const
 
const double * TransX () const
 
const double * TransY () const
 
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
 Camera of the image.
 
double p_detectorLineOrigin
 The origin line of the detector.
 
double p_detectorSampleOrigin
 The origin sample of the detector.
 
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
 Detector sample position.
 
double p_centeredDetectorLine
 Detector line position.
 
double p_detectorLineOffset
 Offset of the detector origin line from the average.
 
double p_detectorSampleOffset
 offset of the detector origin sample from the average
 
double p_transx [3]
 The x transition from detector to distorted.
 
double p_transy [3]
 The y transition from detector to distorted.
 
double p_itranss [3]
 The x transition from distorted to detector.
 
double p_itransl [3]
 The y transition from distorted to detector.
 

Private Member Functions

void Init (Camera *parent, const int naifIkCode)
 Initialize the focal plane map to its default state.
 

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
2005-02-05 Jeff Anderson
See also
Camera
History

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.

2017-08-30 Summer Stapleton - Updated documentation. References #4807.

Definition at line 85 of file CameraFocalPlaneMap.h.

Member Enumeration Documentation

◆ FocalPlaneXDependencyType

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 123 of file CameraFocalPlaneMap.h.

Constructor & Destructor Documentation

◆ CameraFocalPlaneMap() [1/3]

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

Construct mapping between detectors and focal plane x/y.

Parameters
parentparent camera that will use this map
naifIkCodecode of the naif instrument for reading coefficients

Definition at line 25 of file CameraFocalPlaneMap.cpp.

References Init().

◆ CameraFocalPlaneMap() [2/3]

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

Construct mapping between detectors and focal plane x/y.

Parameters
naifIkCodecode of the naif instrument for reading coefficients

Definition at line 35 of file CameraFocalPlaneMap.cpp.

References Init().

◆ CameraFocalPlaneMap() [3/3]

Isis::CameraFocalPlaneMap::CameraFocalPlaneMap ( Camera * parent,
Affine & affine )

Added new method to allow programmer to pass in affine coefficients.

Author
janderson (3/25/2014)
Parameters
parentParent camera
affineAffine transform containing the coefficients for both transforms to (samp,line) to (x,y) and reverse

Definition at line 49 of file CameraFocalPlaneMap.cpp.

References p_camera, p_detectorLineOffset, p_detectorLineOrigin, p_detectorSampleOffset, p_detectorSampleOrigin, p_itransl, p_itranss, p_transx, p_transy, and Isis::Camera::SetFocalPlaneMap().

◆ ~CameraFocalPlaneMap()

Isis::CameraFocalPlaneMap::~CameraFocalPlaneMap ( )
virtual

Destructor.

Definition at line 82 of file CameraFocalPlaneMap.cpp.

Member Function Documentation

◆ CenteredDetectorLine()

double Isis::CameraFocalPlaneMap::CenteredDetectorLine ( ) const
Returns
The centered detector line

Definition at line 279 of file CameraFocalPlaneMap.cpp.

References p_centeredDetectorLine.

◆ CenteredDetectorSample()

double Isis::CameraFocalPlaneMap::CenteredDetectorSample ( ) const
Returns
The centered detector sample

Definition at line 271 of file CameraFocalPlaneMap.cpp.

References p_centeredDetectorSample.

◆ ComputeCentered()

void Isis::CameraFocalPlaneMap::ComputeCentered ( )
protected

Convenience method to center detector origin (use when inheriting)

Definition at line 428 of file CameraFocalPlaneMap.cpp.

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

Referenced by SetDetector().

◆ ComputeUncentered()

void Isis::CameraFocalPlaneMap::ComputeUncentered ( )
protected

Convenience method to center detector origin (use when inheriting)

Definition at line 435 of file CameraFocalPlaneMap.cpp.

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

Referenced by SetFocalPlane().

◆ DetectorLine()

◆ DetectorLineOffset()

double Isis::CameraFocalPlaneMap::DetectorLineOffset ( ) const

◆ DetectorLineOrigin()

double Isis::CameraFocalPlaneMap::DetectorLineOrigin ( ) const

◆ DetectorSample()

◆ DetectorSampleOffset()

double Isis::CameraFocalPlaneMap::DetectorSampleOffset ( ) const
Returns
The detector sample offset

Definition at line 342 of file CameraFocalPlaneMap.cpp.

References p_detectorSampleOffset.

◆ DetectorSampleOrigin()

double Isis::CameraFocalPlaneMap::DetectorSampleOrigin ( ) const

◆ FocalPlaneX()

double Isis::CameraFocalPlaneMap::FocalPlaneX ( ) const

◆ FocalPlaneXDependency()

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 182 of file CameraFocalPlaneMap.cpp.

References Line, p_transx, and Sample.

◆ FocalPlaneY()

double Isis::CameraFocalPlaneMap::FocalPlaneY ( ) const

◆ Init()

void Isis::CameraFocalPlaneMap::Init ( Camera * parent,
const int naifIkCode )
private

Initialize the focal plane map to its default state.

Parameters
parentParent camera
naifIkCodecode of the naif instrument for reading coefficients

Definition at line 92 of file CameraFocalPlaneMap.cpp.

References Isis::Spice::getDouble(), p_camera, p_detectorLineOffset, p_detectorLineOrigin, p_detectorSampleOffset, p_detectorSampleOrigin, p_itransl, p_itranss, p_transx, p_transy, Isis::Camera::SetFocalPlaneMap(), and Isis::toString().

Referenced by CameraFocalPlaneMap(), and CameraFocalPlaneMap().

◆ SetDetector()

bool Isis::CameraFocalPlaneMap::SetDetector ( const double sample,
const double line )
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

Parameters
sampleundistorted focal plane x in millimeters
lineundistorted focal plane y in millimeters
Returns
conversion was successful

Definition at line 164 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::PushFrameCameraGroundMap::FindDistance(), Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetImage(), Isis::Camera::SetImage(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().

◆ SetDetectorOffset()

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

Parameters
sampleOffsetsample offset in pixels
lineOffsetsample offset in lines

Definition at line 324 of file CameraFocalPlaneMap.cpp.

References p_detectorLineOffset, and p_detectorSampleOffset.

Referenced by Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), and Isis::ThemisIrCamera::SetBand().

◆ SetDetectorOrigin()

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.

Parameters
sampledetector sample at the origin
linedetector line at the origin

Definition at line 293 of file CameraFocalPlaneMap.cpp.

References p_detectorLineOrigin, and p_detectorSampleOrigin.

Referenced by Isis::ApolloMetricCamera::ApolloMetricCamera(), Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::DawnVirCamera::DawnVirCamera(), Isis::HrscCamera::HrscCamera(), Isis::MarciCamera::MarciCamera(), Isis::RosettaVirtisCamera::RosettaVirtisCamera(), Isis::LroWideAngleCamera::SetBand(), and Isis::ThemisIrCamera::SetBand().

◆ SetFocalPlane()

bool Isis::CameraFocalPlaneMap::SetFocalPlane ( const double dx,
const double dy )
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.

Parameters
dxdistorted focal plane x in millimeters
dydistorted focal plane y in millimeters
Returns
conversion was successful

Definition at line 143 of file CameraFocalPlaneMap.cpp.

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

Referenced by LineOffsetFunctor::operator()(), Isis::Camera::RawFocalPlanetoImage(), Isis::LoMediumDistortionMap::SetDistortion(), Isis::LoMediumDistortionMap::SetFocalPlane(), Isis::Camera::SetRightAscensionDeclination(), and Isis::LoMediumDistortionMap::SetUndistortedFocalPlane().

◆ SetTransL()

void Isis::CameraFocalPlaneMap::SetTransL ( const QVector< double > transL)

Set the affine coefficients for converting destorted (x,y) to a detector Line.

Parameters
transLVector of the affine coefficients

Definition at line 352 of file CameraFocalPlaneMap.cpp.

References p_itransl.

Referenced by Isis::NewHorizonsLeisaCamera::SetBand().

◆ SetTransS()

void Isis::CameraFocalPlaneMap::SetTransS ( const QVector< double > transS)

Set the affine coefficients for converting destorted (x,y) to a detector Sample.

Parameters
transSVector of the affine coefficients

Definition at line 364 of file CameraFocalPlaneMap.cpp.

References p_itranss.

Referenced by Isis::NewHorizonsLeisaCamera::SetBand().

◆ SetTransX()

void Isis::CameraFocalPlaneMap::SetTransX ( const QVector< double > transX)

Set the affine coefficients for converting detector (sample,line) to a distorted X.

Parameters
transXVector of the affine coefficients

Definition at line 376 of file CameraFocalPlaneMap.cpp.

References p_transx.

Referenced by Isis::NewHorizonsLeisaCamera::SetBand().

◆ SetTransY()

void Isis::CameraFocalPlaneMap::SetTransY ( const QVector< double > transY)

Set the affine coefficients for converting detector (sample,line) to a distorted Y.

Parameters
transYVector of the affine coefficients

Definition at line 388 of file CameraFocalPlaneMap.cpp.

References p_transy.

Referenced by Isis::NewHorizonsLeisaCamera::SetBand().

◆ SignMostSigX()

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 201 of file CameraFocalPlaneMap.cpp.

References p_transx.

◆ SignMostSigY()

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 223 of file CameraFocalPlaneMap.cpp.

References p_transy.

◆ TransL()

const double * Isis::CameraFocalPlaneMap::TransL ( ) const
Returns
The affine coefficients for converting distorted (x,y) to a detector Line

Definition at line 422 of file CameraFocalPlaneMap.cpp.

References p_itransl.

◆ TransS()

const double * Isis::CameraFocalPlaneMap::TransS ( ) const
Returns
The affine coefficients for converting distorted (x,y) to a detector Sample

Definition at line 414 of file CameraFocalPlaneMap.cpp.

References p_itranss.

◆ TransX()

const double * Isis::CameraFocalPlaneMap::TransX ( ) const
Returns
The affine coefficients for converting detector (sample,line) to a distorted X

Definition at line 398 of file CameraFocalPlaneMap.cpp.

References p_transx.

◆ TransY()

const double * Isis::CameraFocalPlaneMap::TransY ( ) const
Returns
The affine coefficients for converting detector (sample,line) to distorted Y

Definition at line 406 of file CameraFocalPlaneMap.cpp.

References p_transy.

Member Data Documentation

◆ p_camera

Camera* Isis::CameraFocalPlaneMap::p_camera
protected

◆ p_centeredDetectorLine

double Isis::CameraFocalPlaneMap::p_centeredDetectorLine
protected

Detector line position.

Definition at line 147 of file CameraFocalPlaneMap.h.

Referenced by CenteredDetectorLine(), ComputeCentered(), ComputeUncentered(), SetDetector(), and SetFocalPlane().

◆ p_centeredDetectorSample

double Isis::CameraFocalPlaneMap::p_centeredDetectorSample
protected

Detector sample position.

Definition at line 146 of file CameraFocalPlaneMap.h.

Referenced by CenteredDetectorSample(), ComputeCentered(), ComputeUncentered(), SetDetector(), and SetFocalPlane().

◆ p_detectorLine

double Isis::CameraFocalPlaneMap::p_detectorLine
protected

line value of the detector

Definition at line 144 of file CameraFocalPlaneMap.h.

Referenced by ComputeCentered(), ComputeUncentered(), DetectorLine(), and SetDetector().

◆ p_detectorLineOffset

double Isis::CameraFocalPlaneMap::p_detectorLineOffset
protected

Offset of the detector origin line from the average.

Definition at line 149 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), DetectorLineOffset(), Init(), and SetDetectorOffset().

◆ p_detectorLineOrigin

double Isis::CameraFocalPlaneMap::p_detectorLineOrigin
protected

The origin line of the detector.

Definition at line 139 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), ComputeCentered(), ComputeUncentered(), DetectorLineOrigin(), Init(), and SetDetectorOrigin().

◆ p_detectorSample

double Isis::CameraFocalPlaneMap::p_detectorSample
protected

sample value of the detector

Definition at line 145 of file CameraFocalPlaneMap.h.

Referenced by ComputeCentered(), ComputeUncentered(), DetectorSample(), and SetDetector().

◆ p_detectorSampleOffset

double Isis::CameraFocalPlaneMap::p_detectorSampleOffset
protected

offset of the detector origin sample from the average

Definition at line 150 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), DetectorSampleOffset(), Init(), and SetDetectorOffset().

◆ p_detectorSampleOrigin

double Isis::CameraFocalPlaneMap::p_detectorSampleOrigin
protected

The origin sample of the detector.

Definition at line 140 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), ComputeCentered(), ComputeUncentered(), DetectorSampleOrigin(), Init(), and SetDetectorOrigin().

◆ p_focalPlaneX

double Isis::CameraFocalPlaneMap::p_focalPlaneX
protected

x value of focal plane coordinate

Definition at line 142 of file CameraFocalPlaneMap.h.

Referenced by FocalPlaneX(), SetDetector(), and SetFocalPlane().

◆ p_focalPlaneY

double Isis::CameraFocalPlaneMap::p_focalPlaneY
protected

y value of focal plane coordinate

Definition at line 143 of file CameraFocalPlaneMap.h.

Referenced by FocalPlaneY(), SetDetector(), and SetFocalPlane().

◆ p_itransl

double Isis::CameraFocalPlaneMap::p_itransl[3]
protected

The y transition from distorted to detector.

Definition at line 155 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), Init(), Isis::LroWideAngleCameraFocalPlaneMap::setBand(), SetFocalPlane(), SetTransL(), and TransL().

◆ p_itranss

double Isis::CameraFocalPlaneMap::p_itranss[3]
protected

The x transition from distorted to detector.

Definition at line 154 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), Init(), Isis::LroWideAngleCameraFocalPlaneMap::setBand(), SetFocalPlane(), SetTransS(), and TransS().

◆ p_transx

double Isis::CameraFocalPlaneMap::p_transx[3]
protected

◆ p_transy

double Isis::CameraFocalPlaneMap::p_transy[3]
protected

The y transition from detector to distorted.

Definition at line 153 of file CameraFocalPlaneMap.h.

Referenced by CameraFocalPlaneMap(), Init(), Isis::LroWideAngleCameraFocalPlaneMap::setBand(), SetDetector(), SetTransY(), SignMostSigY(), and TransY().


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