4.7.4 - Image Distortion Corrections - JdlDistortionCorrections

John W. Campbell

4.7.4.1 Introduction

This class provides an object to store the parameters required for making distortion corrections to image spot positions related to data for X-ray diffraction (esp. Protein Crystallography). A series of methods are available to apply/remove these corrections. Basically two forms of distortion correction are available, a standard form and one for use with images which have been scanned radially. The class has both methods for using internally stored distortion correction parameters and corresponding static methods which may be used without defining an object of the calss. The calculations are based on various CCP4 codes, MOSFLM etc. from up to 1999.

Class, constructors and methods:

Class Details
Accessible Fields
Constructor
Set Distortion Parameters
Convert Ideal to Real
Convert Real to Ideal

4.7.4.2 Class Details

Package:
Jdl.JdlPX;
Class name:
JdlDistortionCorrections
Class definition:
public class JdlDistortionCorrections
Extends:
Object
Implements:
none
Actions:
none

4.7.4.3 Accessible Fields

No fields with public, package or protected access defined.

4.7.4.4 Constructor

4.7.4.4.1 Introduction

A single constructor creates an empty JdlDistortionCorrections object. The required distortion correction parameters are then set using one of the two methods available depending on the type of distortion correction to be applied.

Constructors:

Constructor 1

4.7.4.4.2 Constructor 1

Sets up an empty JdlDistortionCorrections object.

Constructor Definition:
public JdlDistortionCorrections()
Parameters List:
none

4.7.4.5 Set Distortion Parameters

4.7.4.5.1 Introduction

This section has methods to set up the distortion corrections for the standard and radial scan cases.

Methods:

Set standard corrections - setStandardCorrectionFactors
Set radial scan corrections - setRadialCorrectionFactors

4.7.4.5.2 Set standard corrections - setStandardCorrectionFactors

This method sets the correction factors for the standard case.

Method Definition:
public void setStandardCorrectionFactors (double ctod, double x_c, double y_c, double w_c, double y_scale, double twist, double tilt)
Parameters List:
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
w_c
w_c.
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.

4.7.4.5.3 Set radial scan corrections - setRadialCorrectionFactors

This method sets the correction factors for the radial scan case.

Method Definition:
public void setRadialCorrectionFactors (double ctod, double x_c, double y_c, double w_c, double y_scale, double twist, double tilt, double xcmid, double ycmid, double roff, double toff)
Parameters List:
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
w_c
w_c.
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.
xcmid
Offset of image mid point from pattern centre in mm along x.
ycmid
Offset of image mid point from pattern centre in mm along y.
roff
The distortion radial offset correction.
toff
The distortion tangential offset correction.

4.7.4.6 Convert Ideal to Real

4.7.4.6.1 Introduction

This section has methods to transform an ideal set of detector coordinates to those actually observed on the real image.

Methods:

Ideal to real - idealToReal
Ideal to real - standardIdealToReal
Ideal to real - radialIdealToReal

4.7.4.6.2 Ideal to real - idealToReal

This method applies distortion correction parameters to a set of ideal detector coordinates in mm relative to the pattern centre to provide a set of 'real image' coordinates xd, yd in mm parallel to the detector axes (again relative to the pattern centre). The distortion correction parameters used are those currently stored in the JdlDistortionCorrections object

Method Definition:
public JdlXY idealToReal(double xideal, double yideal)
Parameters List:
xideal
The ideal detector 'x' coordinate in mm.
yideal
The ideal detector 'y' coordinate in mm.
Method Return:
the transformed coordinates xd, yd in JdlXY.x, JdlXY.y.

4.7.4.6.3 Ideal to real - standardIdealToReal

This static method applies standard distortion correction parameters to a set of ideal detector coordinates in mm relative to the pattern centre to provide a set of 'real image' coordinates xd, yd in mm parallel to the detector axes (again relative to the pattern centre).

Method Definition:
public static JdlXY standardIdealToReal (double xideal, double yideal, double ctod, double x_c, double y_c, double coswc, double sinwc, double y_scale, double twist, double tilt)
Parameters List:
xideal
The ideal detector 'x' coordinate in mm.
yideal
The ideal detector 'y' coordinate in mm.
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
coswc
cos(w_c).
sinwc
sin(w_c).
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.
Method Return:
the transformed coordinates xd, yd in JdlXY.x, JdlXY.y.

4.7.4.6.4 Ideal to real - radialIdealToReal

This static method applies radial scan distortion correction parameters to a set of ideal detector coordinates in mm relative to the pattern centre to provide a set of 'real image' coordinates xd, yd in mm parallel to the detector axes (again relative to the pattern centre).

Method Definition:
public static JdlXY radialIdealToReal (double xideal, double yideal, double ctod, double x_c, double y_c, double coswc, double sinwc, double y_scale, double twist, double tilt, double xcmid, double ycmid, double roff, double toff)
Parameters List:
xideal
The ideal detector 'x' coordinate in mm.
yideal
The ideal detector 'y' coordinate in mm.
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
coswc
cos(w_c).
sinwc
sin(w_c).
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.
xcmid
Offset of image mid point from pattern centre in mm along x.
ycmid
Offset of image mid point from pattern centre in mm along y.
roff
The distortion radial offset correction.
toff
The distortion tangential offset correction.
Method Return:
the transformed coordinates xd, yd in JdlXY.x, JdlXY.y.

4.7.4.7 Convert Real to Ideal

4.7.4.7.1 Introduction

This section has methods to convert the real observed detector positions back to a set of ideal detector coordinates.

Methods:

Real to ideal - realToIdeal
Real to ideal - standardRealToIdeal
Real to ideal - radialRealToIdeal

4.7.4.7.2 Real to ideal - realToIdeal

This method applies distortion corrections to a set of detector coordinates in mm relative to the pattern centre to provide a set of 'ideal' coordinates xf, yf in mm parallel to the detector axes (again relative to the pattern centre). The distortion correction parameters used are those currently stored in the JdlDistortionCorrections object

Method Definition:
public JdlXY realToIdeal(double xfd, double yfd)
Parameters List:
xfd
The measured detector 'x' coordinate in mm.
yfd
The measured detector 'y' coordinate in mm.
Method Return:
the transformed coordinates xf, yf in JdlXY.x, JdlXY.y.

4.7.4.7.3 Real to ideal - standardRealToIdeal

This static method applies standard distortion corrections to a set of detector coordinates in mm relative to the pattern centre to provide a set of 'ideal' coordinates xf, yf in mm parallel to the detector axes (again relative to the pattern centre).

Method Definition:
public static JdlXY standardRealToIdeal (double xfd, double yfd, double ctod, double x_c, double y_c, double coswc, double sinwc, double y_scale, double twist, double tilt)
Parameters List:
xfd
The measured detector 'x' coordinate in mm.
yfd
The measured detector 'y' coordinate in mm.
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
coswc
cos(w_c).
sinwc
sin(w_c).
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.
Method Return:
the transformed coordinates xf, yf in JdlXY.x, JdlXY.y.

4.7.4.7.4 Real to ideal - radialRealToIdeal

This static method applies radial scan distortion corrections to a set of detector coordinates in mm relative to the pattern centre to provide a set of 'ideal' coordinates xf, yf in mm parallel to the detector axes (again relative to the pattern centre). This calculation requires an iterative procedure.

Method Definition:
public static JdlXY radialRealToIdeal (double xfd, double yfd, double ctod, double x_c, double y_c, double coswc, double sinwc, double y_scale, double twist, double tilt, double xcmid, double ycmid, double roff, double toff)
Parameters List:
xfd
The measured detector 'x' coordinate in mm.
yfd
The measured detector 'y' coordinate in mm.
ctod
Crystal to detector distance in mm.
x_c
Centre 'x' correction in mm.
y_c
Centre 'y' correction in mm.
coswc
cos(w_c).
sinwc
sin(w_c).
y_scale
Correction factor to 'y' pixel size. Corrected value = (y pixel size)/y_scale
twist
The distortion twist correction.
tilt
The distortion tilt correction.
xcmid
Offset of image mid point from pattern centre in mm along x.
ycmid
Offset of image mid point from pattern centre in mm along y.
roff
The distortion radial offset correction.
toff
The distortion tangential offset correction.
Method Return:
the transformed coordinates xf, yf in JdlXY.x, JdlXY.y.

⇑ Up 2   ⇑ Up 1   ⇑ Top of this