Background and Barrel Distortion Correction: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
MIPAV>Olga Vovk
mNo edit summary
 
Line 1: Line 1:
'''In this section . . .<br />'''
== Background ==
*Background<br />
*References <br />
Designed specifically for medical researchers, MIPAV concentrates on providing those researchers with the tools needed to do their work. It reads image files of many different formats and allows images to be displayed and measured using the most meaningful method to achieve research goals. MIPAV's flexibility becomes apparent when its capabilities are expanded and fine tuned through the development of plug-in programs that tailor solutions to meet specific requirements.<br />


Using MIPAV to display, label, and measure brain components in Talairach space demonstrates both: MIPAV's native ability to display and measure brain images in Talairach space and the tailoring provided through the Talairach Transformation wizard and the FANTASM (Fuzzy and Noise Tolerant Adaptive Segmentation Method) plug-in programs, developed by the Johns Hopkins University.
Barrel distortion occurs when the magnification at the center of the lens is greater than at the edges. Fish eye lenses, which take hemispherical views, produce this type of distortion as a result of a hemispherical scene being projected onto a flat surface.  


== Background ==
Most commonly, barrel distortion appears when using  zoom lenses. This is even more common for lenses with large zoom ranges, or wide angle zoom lenses.
In 1988 Jean Talairach and Pierre Tournoux developed a three-dimensional proportional grid system that can be used to identify and measure brains from any number of patients despite the variability of brain sizes and proportions. The premise of the system is that brain components that cannot be seen or identified can be defined in relation to other anatomic cerebral structures. In the Talairach system, the anterior commissure (AC) and posterior commissure (PC) are the structures from which the system of reference is developed.<br />
 
Two types of distortion you will see are barrel and pincushion. Barrel distortion has a “bulging” effect, while pincushion distortion is a “sucking” effect that distorts images in an inward sense. Barrel distortion is like wrapping your image around a ball. If you look at it straight on, the center will be bulged out. Pincushion is like pressing your image into a bowl. If you look directly into the bowl, the center will look squeezed.
 
A higher quality lens can be used to correct for distortion; however, this will greatly rise the cost of the image capture system. A cost effective alternative to an expensive lens system is to algorithmically correct for barrel distortion using the presented method.
 
Barrel distortion is primarily radial in nature, therefore it can be corrected using a relatively simple model compensating for the most of the distortion.  
 
The correcting function M(a,b,c,d,r_corr) is a third order polynomial. It relates the distance of a pixel from the center of the source image (r_src) to the corresponding distance in the corrected image (r_corr):
 
==== Equation 1====
 
M = a *r3_corr + b * r2_corr + c * r_corr + d
 
and
 
r_src = (a * r3_corr + b * r2_corr + c * r_corr + d) * r_corr
 
Where r_src and r_corr are specified in units of the min((xDim-1)/2, (yDim-1)/2).
 
Parameters in equation 1 are as follows:
 
* a, b and c describe distortion of the image
* d describes the linear scaling of the image
 
Correcting using a affects only the outermost pixels of the image, while b correction is more uniform. Using negative values for a, b, and c shifts distant points away from the center. This counteracts barrel distortion, and forms the basis for the above corrections.
 
Using positive values for a, b, and c shifts distant points towards the center. This counteracts pincushion distortion which is opposite to barrel distortion. See Figure 2.
 
Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount. See [http://mipav.cit.nih.gov/documentation/HTML%20Algorithms/BarrelDistortionCorrection.html Figure 2].
 
==== Correcting pincushion and/or barrel distortion ====


The Talairach system establishes the maximal dimensions of the brain in three planes of space: <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">x, y</font>''</span> and <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">z</font>''</span><nowiki>: </nowiki>
Finally, you may correct pincushion and barrel distortions simultaneously in the same image: if the outer regions exhibit barrel distortion, and the inner parts pincushion, you should use negative a and positive b values. If you do not want to scale the image, you should set d so that a +b + c + d = 1.


<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">AC-PC line (X axis)</font>''</span>-A horizontal line running through the anterior and posterior commissures. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">VCA line (verticofrontal line, or Y axis)</font>''</span>-A vertical line passing through the anterior commissure<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Midline (Z axis)</font>''</span>-A line forming the interhemispheric sagittal plane<br /></font></div>
== Image types ==


Often referred to as the "origin," the anterior commissure is commonly used to describe structures. For example, a structure is described as "AC 13 mm" for the frontal lobe or "AC - 35 mm" for the occipital pole. These descriptions assume that the anterior commissure is in the positive direction. However, the Talairach system does not use positive and negative directions. Instead, it labels quadrants according to number and letters ([TechGuide_Background.html#1005540 Figure 15]A). The AC-PC line defines the horizontal plane, the VCA line defines the vertical plane, and the midline defines the depth plane. Because the anterior commissure and posterior commissure do not occur in the same axial slice, reslicing is necessary to put the brain into Talairach space.
The algorithm can be applied to RGB and gray 2D images.


{| align="left"
== Barrel Distortion Correction dialog box ==
|
[[Image:TechGuide_Backgrounda.gif]]
|}


<br clear="all" />Jean Talairach and Pierre Tournoux, <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Co-Planar Stereotaxic Atlas of the Human Brain</font>''</span>, Thieme Medical Publishers, New York, 1988.<br />
[[File:BarrelDistDB.jpg|400px|thumb|right|The Barrel/Pincushion Distortion Correction dialog box]]


This technical guide explains how to install and use two MIPAV plug-in programs-the Talairach Transformation wizard and FANTASM to:
* '''a, b, c, d''' - Correcting using a affects only the outermost pixels of the image. b and c parameters should be used for more uniform correction.
* Using negative values for a, b, and c shifts distant points away from the center of the image. This negates barrel distortions.
* Using positive values for a, b, and c shifts distant points towards the center. This negates pincushion distortions.
* Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount.
* '''Set d=1-a-b-c''' - Activate this option if you do not want to scale the image, e.g. you set d so that a +b + c + d = 1.
* '''OK''' - Applies the parameters that you specified to the image.
* '''Cancel''' - Disregards any changes you made in this dialog box and closes the dialog box.
* '''Help''' - Displays online help for this dialog box.


<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  Create the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">x, y,</font>''</span> and <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">z</font>''</span> planes of space in an image of a brain<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  Transfer Talairach labels to an image of a brain<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  Measure brain components in Talairach space<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">
== Applying barrel distortion correction algorithm ==


{| border="1" cellpadding="5"
* Open an image of interest.
|+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 15. Talairach space: (A) Quadrants labeled by number and letters and (B) horizontal, vertical, and depth planes<br /></font>'''</div>
* Select Algorithms > Transformation tools > Barrel Distortion Correction. The Barrel/Pincushion Distortion Correction dialog box opens.
|-
* Complete the dialog box and click OK.  
|
[[Image:exampleTalairachCubeBrain.gif]]
|}
=== Talairach Transformation wizard ===
The Talairach Transformation wizard is a plug-in program for MIPAV that performs a semimanual transformation of image datasets of the brain to Talairach (stereotaxic) coordinates, providing atlas-based labeling. The Talairach coordinates allow researchers to easily identify subregions of the brain and measure their volume. It includes labels for 148 different substructures of the brain at various scales, obtained from the <span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">[ http://ric.uthscsa.edu/projects/talairachdaemon.html ]</font></u></span><span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">Talairach Daemon database</font></span>, along with a set of volumetric images of the labels.<br /></font></div>


=== FANTASM ===
The corrected image appears in a new image frame.
The FANTASM plug-in program<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> is a different version of the Fuzzy C-mean algorithm for segmenting 2D and 3D images. It incorporates a spatial constraint that requires neighboring pixels to be similar and reduces the noise effect obtained with the Fuzzy C-mean algorithm. It can deal with outliers. Plans for a future version of FANTASM incorporates inhomogeneity correction. </font></span><br />


== References ==
[[Category:Help:Stub]]
ICBM atlas created by the International Consortium on Brain Mapping (ICBM), automatic <br />(<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">http://www.loni.ucla.edu/ICBM/ICBM_BrainTemplate.html</font></u></span>).<br />
[[Category:Help:Algorithms]]
<div style="font-style: normal; font-weight: normal; margin-bottom: 4pt; margin-left: 0pt; margin-right: 0pt; margin-top: 11pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Jean Talairach and Pierre Tournoux, <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Co-Planar Stereotaxic Atlas of the Human Brain</font>''</span>, Thieme Medical Publishers, New York, 1988. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 4pt; margin-left: 0pt; margin-right: 0pt; margin-top: 11pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Neva Chernizasky, <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Medical Imaging: Orientation</font>''</span>, Paper prepared for Matthew McAuliiffe, Ph.D. Center for Information Technology, National Institutes of Health, August 31, 2001.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 4pt; margin-left: 0pt; margin-right: 0pt; margin-top: 11pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Dzung L. Pham, "Spatial Models for Fuzzy Clustering," <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Computer Vision and Image Understanding</font>''</span>, vol. 84, pp. 285-297, 2001.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 4pt; margin-left: 0pt; margin-right: 0pt; margin-top: 11pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Pierre-Louis Bazin, Dzung L. Pham, William Gandler, and Matthew McAuliffe. "Free Software Tools for Atlas-based Volumetric Neuroimage Analysis," to be published in the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">Proceedings of the SPIE Medical Image 2005 Conference</font>''</span>, The International Society for Optical Engineering (SPIE), Bellingham, Washington, 2005.<br /></font></div>

Revision as of 20:13, 10 September 2013

Background

Barrel distortion occurs when the magnification at the center of the lens is greater than at the edges. Fish eye lenses, which take hemispherical views, produce this type of distortion as a result of a hemispherical scene being projected onto a flat surface.

Most commonly, barrel distortion appears when using zoom lenses. This is even more common for lenses with large zoom ranges, or wide angle zoom lenses.

Two types of distortion you will see are barrel and pincushion. Barrel distortion has a “bulging” effect, while pincushion distortion is a “sucking” effect that distorts images in an inward sense. Barrel distortion is like wrapping your image around a ball. If you look at it straight on, the center will be bulged out. Pincushion is like pressing your image into a bowl. If you look directly into the bowl, the center will look squeezed.

A higher quality lens can be used to correct for distortion; however, this will greatly rise the cost of the image capture system. A cost effective alternative to an expensive lens system is to algorithmically correct for barrel distortion using the presented method.

Barrel distortion is primarily radial in nature, therefore it can be corrected using a relatively simple model compensating for the most of the distortion.

The correcting function M(a,b,c,d,r_corr) is a third order polynomial. It relates the distance of a pixel from the center of the source image (r_src) to the corresponding distance in the corrected image (r_corr):

Equation 1

M = a *r3_corr + b * r2_corr + c * r_corr + d

and

r_src = (a * r3_corr + b * r2_corr + c * r_corr + d) * r_corr

Where r_src and r_corr are specified in units of the min((xDim-1)/2, (yDim-1)/2).

Parameters in equation 1 are as follows:

  • a, b and c describe distortion of the image
  • d describes the linear scaling of the image

Correcting using a affects only the outermost pixels of the image, while b correction is more uniform. Using negative values for a, b, and c shifts distant points away from the center. This counteracts barrel distortion, and forms the basis for the above corrections.

Using positive values for a, b, and c shifts distant points towards the center. This counteracts pincushion distortion which is opposite to barrel distortion. See Figure 2.

Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount. See Figure 2.

Correcting pincushion and/or barrel distortion

Finally, you may correct pincushion and barrel distortions simultaneously in the same image: if the outer regions exhibit barrel distortion, and the inner parts pincushion, you should use negative a and positive b values. If you do not want to scale the image, you should set d so that a +b + c + d = 1.

Image types

The algorithm can be applied to RGB and gray 2D images.

Barrel Distortion Correction dialog box

The Barrel/Pincushion Distortion Correction dialog box
  • a, b, c, d - Correcting using a affects only the outermost pixels of the image. b and c parameters should be used for more uniform correction.
  • Using negative values for a, b, and c shifts distant points away from the center of the image. This negates barrel distortions.
  • Using positive values for a, b, and c shifts distant points towards the center. This negates pincushion distortions.
  • Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount.
  • Set d=1-a-b-c - Activate this option if you do not want to scale the image, e.g. you set d so that a +b + c + d = 1.
  • OK - Applies the parameters that you specified to the image.
  • Cancel - Disregards any changes you made in this dialog box and closes the dialog box.
  • Help - Displays online help for this dialog box.

Applying barrel distortion correction algorithm

  • Open an image of interest.
  • Select Algorithms > Transformation tools > Barrel Distortion Correction. The Barrel/Pincushion Distortion Correction dialog box opens.
  • Complete the dialog box and click OK.

The corrected image appears in a new image frame.