Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d5e74628f0e673bb8680aebce32b2c04 > files > 16871

itk-doc-3.12.0-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ITK: itkPhasedArray3DSpecialCoordinatesImage.h Source File</title>
<link href="DoxygenStyle.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">


<!--  Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 -->
<center>
<a href="index.html" class="qindex">Main Page</a>&nbsp;&nbsp; 
<a href="modules.html" class="qindex">Groups</a>&nbsp;&nbsp;
<a href="namespaces.html" class="qindex">Namespace List</a>&nbsp;&nbsp;
<a href="hierarchy.html" class="qindex">Class Hierarchy</a>&nbsp;&nbsp;
<a href="classes.html" class="qindex">Alphabetical List</a>&nbsp;&nbsp;
<a href="annotated.html" class="qindex">Compound List</a>&nbsp;&nbsp; 
<a href="files.html" class="qindex">File
List</a>&nbsp;&nbsp; 
<a href="namespacemembers.html" class="qindex">Namespace Members</a>&nbsp;&nbsp; 
<a href="functions.html" class="qindex">Compound Members</a>&nbsp;&nbsp; 
<a href="globals.html" class="qindex">File Members</a>&nbsp;&nbsp;
<a href="pages.html" class="qindex">Concepts</a></center>


<!-- Generated by Doxygen 1.5.9 -->
  <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a>
  </div>
<div class="contents">
<h1>itkPhasedArray3DSpecialCoordinatesImage.h</h1><a href="itkPhasedArray3DSpecialCoordinatesImage_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span>
<a name="l00002"></a>00002 <span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">  Program:   Insight Segmentation &amp; Registration Toolkit</span>
<a name="l00004"></a>00004 <span class="comment">  Module:    $RCSfile: itkPhasedArray3DSpecialCoordinatesImage.h,v $</span>
<a name="l00005"></a>00005 <span class="comment">  Language:  C++</span>
<a name="l00006"></a>00006 <span class="comment">  Date:      $Date: 2009-02-19 19:41:23 $</span>
<a name="l00007"></a>00007 <span class="comment">  Version:   $Revision: 1.22 $</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">  Copyright (c) Insight Software Consortium. All rights reserved.</span>
<a name="l00010"></a>00010 <span class="comment">  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment">     This software is distributed WITHOUT ANY WARRANTY; without even</span>
<a name="l00013"></a>00013 <span class="comment">     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span>
<a name="l00014"></a>00014 <span class="comment">     PURPOSE.  See the above copyright notices for more information.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span>
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef __itkPhasedArray3DSpecialCoordinatesImage_h</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkPhasedArray3DSpecialCoordinatesImage_h</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkSpecialCoordinatesImage_8h.html">itkSpecialCoordinatesImage.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkImageRegion_8h.html">itkImageRegion.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="itkPoint_8h.html">itkPoint.h</a>"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkContinuousIndex_8h.html">itkContinuousIndex.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "vnl/vnl_math.h"</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">namespace </span>itk
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 
<a name="l00090"></a>00090 <span class="keyword">template</span> &lt;<span class="keyword">class</span> TPixel&gt;
<a name="l00091"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html">00091</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html" title="Templated 3D nonrectilinear-coordinate image class for phased-array &amp;quot;range&amp;quot;...">PhasedArray3DSpecialCoordinatesImage</a> :
<a name="l00092"></a>00092 <span class="keyword">public</span> <a class="code" href="classitk_1_1SpecialCoordinatesImage.html" title="Templated n-dimensional nonrectilinear-coordinate image base class.">SpecialCoordinatesImage</a>&lt;TPixel,3&gt;
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 <span class="keyword">public</span>:
<a name="l00096"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#14af1dfeeb89bd4e919d6838359de183">00096</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html" title="Templated 3D nonrectilinear-coordinate image class for phased-array &amp;quot;range&amp;quot;...">PhasedArray3DSpecialCoordinatesImage</a> <a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">Self</a>;
<a name="l00097"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#549024aa5e466b7ce49bc4964e2985ef">00097</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SpecialCoordinatesImage.html">SpecialCoordinatesImage&lt;TPixel,3&gt;</a>    <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Superclass</a>;
<a name="l00098"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#d010aecc837fb0338c9afa5ad2ab81c9">00098</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer&lt;Self&gt;</a>                   <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>;
<a name="l00099"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#46aefae8a8c6371e419b56a45e35c874">00099</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer&lt;const Self&gt;</a>             <a class="code" href="classitk_1_1SmartPointer.html">ConstPointer</a>;
<a name="l00100"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#689534f349788b288625cb75b5725c3f">00100</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1WeakPointer.html" title="Implements a weak reference to an object.">WeakPointer&lt;const Self&gt;</a>              <a class="code" href="classitk_1_1WeakPointer.html" title="Implements a weak reference to an object.">ConstWeakPointer</a>;
<a name="l00101"></a>00101 
<a name="l00103"></a>00103   <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>(<a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">Self</a>);
<a name="l00104"></a>00104 
<a name="l00106"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#694eb037e0883e85f083fa6718c9c5f9">00106</a>   <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>(<a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html" title="Templated 3D nonrectilinear-coordinate image class for phased-array &amp;quot;range&amp;quot;...">PhasedArray3DSpecialCoordinatesImage</a>, <a class="code" href="classitk_1_1SpecialCoordinatesImage.html" title="Templated n-dimensional nonrectilinear-coordinate image base class.">SpecialCoordinatesImage</a>);
<a name="l00107"></a>00107 
<a name="l00110"></a>00110   <span class="keyword">typedef</span> TPixel PixelType;
<a name="l00111"></a>00111 
<a name="l00113"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#eaa67827f9501cd122c5cebd7b1c1830">00113</a>   <span class="keyword">typedef</span> TPixel ValueType;
<a name="l00114"></a>00114 
<a name="l00119"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#39417c6ed40d7e070224a6028cdc9b5f">00119</a>   <span class="keyword">typedef</span> TPixel InternalPixelType;
<a name="l00120"></a>00120 
<a name="l00121"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#1e75baed52a0f64b3be2910988498eec">00121</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::IOPixelType   IOPixelType;
<a name="l00122"></a>00122   
<a name="l00125"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#d5aa6988bb3307eafaca95a74a9295d4">00125</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1DefaultPixelAccessor.html" title="Give access to partial aspects a type.">DefaultPixelAccessor&lt; PixelType &gt;</a> <a class="code" href="classitk_1_1DefaultPixelAccessor.html" title="Give access to partial aspects a type.">AccessorType</a>;
<a name="l00126"></a>00126 
<a name="l00130"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#13a8fc8e5b09c220d15e86a1670a0b8b">00130</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1DefaultPixelAccessorFunctor.html" title="This class provides a common API for pixel accessors for Image and VectorImage. (between...">DefaultPixelAccessorFunctor&lt; Self &gt;</a> <a class="code" href="classitk_1_1DefaultPixelAccessorFunctor.html" title="This class provides a common API for pixel accessors for Image and VectorImage. (between...">AccessorFunctorType</a>;
<a name="l00131"></a>00131 
<a name="l00136"></a>00136   <a class="code" href="itkMacro_8h.html#1905cf6b2e88235996fa7ff73b2fb0eb">itkStaticConstMacro</a>(ImageDimension, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, 3);
<a name="l00137"></a>00137 
<a name="l00139"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#9aec2c1fbe46db313716c8b181196afa">00139</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImportImageContainer.html">ImportImageContainer&lt;unsigned long, PixelType&gt;</a> <a class="code" href="classitk_1_1ImportImageContainer.html">PixelContainer</a>;
<a name="l00140"></a>00140 
<a name="l00142"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#1bef017f0faf8a3355b4abbfcdc37a1c">00142</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">Superclass::IndexType</a>      <a class="code" href="classitk_1_1Index.html">IndexType</a>;
<a name="l00143"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#e3da7980457ec9da8e3116bb9710999d">00143</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::IndexValueType IndexValueType;
<a name="l00144"></a>00144 
<a name="l00146"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#13e0178d6d7483ee3a8c9e51bdf228c1">00146</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::OffsetType <a class="code" href="classitk_1_1Offset.html" title="Represent the offset between two n-dimensional indexes in a n-dimensional image.">OffsetType</a>;
<a name="l00147"></a>00147 
<a name="l00149"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#e5d409cd66197edd3db61b8580e989ba">00149</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">Superclass::SizeType</a>   <a class="code" href="classitk_1_1Size.html">SizeType</a>;
<a name="l00150"></a>00150 
<a name="l00154"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#f9adef9bcd8e5910ab74e910fd5d347b">00154</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">Superclass::RegionType</a> <a class="code" href="classitk_1_1ImageRegion.html" title="An image region represents a structured region of data.">RegionType</a>;
<a name="l00155"></a>00155 
<a name="l00162"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#26cdf0f772c613105b445c5fa1163a13">00162</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::SpacingType <a class="code" href="classitk_1_1Vector.html">SpacingType</a>;
<a name="l00163"></a>00163 
<a name="l00168"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#4cd0b08d1b004497cca14ba3216123c6">00168</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::PointType <a class="code" href="classitk_1_1Point.html">PointType</a>;
<a name="l00169"></a>00169 
<a name="l00171"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#b641f5148a4a35cecf6965335cdec587">00171</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1SmartPointer.html">PixelContainer::Pointer</a>      <a class="code" href="classitk_1_1SmartPointer.html">PixelContainerPointer</a>;
<a name="l00172"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#10790584609999a5975451acfbbf0080">00172</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1SmartPointer.html">PixelContainer::ConstPointer</a> <a class="code" href="classitk_1_1SmartPointer.html">PixelContainerConstPointer</a>;
<a name="l00173"></a>00173 
<a name="l00178"></a>00178   <span class="keyword">template</span>&lt;<span class="keyword">class</span> TCoordRep&gt;
<a name="l00179"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#a20553ad29e96398e942eed831f56b53">00179</a>   <span class="keywordtype">bool</span> TransformPhysicalPointToContinuousIndex(
<a name="l00180"></a>00180               <span class="keyword">const</span> <a class="code" href="classitk_1_1Point.html" title="A templated class holding a geometric point in n-Dimensional space.">Point&lt;TCoordRep, 3&gt;</a>&amp; point,
<a name="l00181"></a>00181               <a class="code" href="classitk_1_1ContinuousIndex.html" title="A templated class holding a point in n-Dimensional image space.">ContinuousIndex&lt;TCoordRep, 3&gt;</a>&amp; index   )<span class="keyword"> const</span>
<a name="l00182"></a>00182 <span class="keyword">    </span>{
<a name="l00183"></a>00183     <a class="code" href="classitk_1_1ImageRegion.html" title="An image region represents a structured region of data.">RegionType</a> region = this-&gt;GetLargestPossibleRegion();
<a name="l00184"></a>00184     <span class="keywordtype">double</span> maxAzimuth =    region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(0) - 1;
<a name="l00185"></a>00185     <span class="keywordtype">double</span> maxElevation =  region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(1) - 1;
<a name="l00186"></a>00186     
<a name="l00187"></a>00187     <span class="comment">// Convert Cartesian coordinates into angular coordinates</span>
<a name="l00188"></a>00188     TCoordRep azimuth   = vcl_atan(point[0] / point[2]);
<a name="l00189"></a>00189     TCoordRep elevation = vcl_atan(point[1] / point[2]);
<a name="l00190"></a>00190     TCoordRep radius    = vcl_sqrt(point[0] * point[0]
<a name="l00191"></a>00191                               + point[1] * point[1]
<a name="l00192"></a>00192                               + point[2] * point[2] );
<a name="l00193"></a>00193     
<a name="l00194"></a>00194     <span class="comment">// Convert the "proper" angular coordinates into index format</span>
<a name="l00195"></a>00195     index[0] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( (azimuth/m_AzimuthAngularSeparation)
<a name="l00196"></a>00196                                        + (maxAzimuth/2.0)   );
<a name="l00197"></a>00197     index[1] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( (elevation/m_ElevationAngularSeparation)
<a name="l00198"></a>00198                                        + (maxElevation/2.0) );
<a name="l00199"></a>00199     index[2] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( ( (radius-m_FirstSampleDistance)
<a name="l00200"></a>00200                                               / m_RadiusSampleSize) );
<a name="l00201"></a>00201     
<a name="l00202"></a>00202     <span class="comment">// Now, check to see if the index is within allowed bounds</span>
<a name="l00203"></a>00203     <span class="keyword">const</span> <span class="keywordtype">bool</span> isInside = region.<a class="code" href="classitk_1_1ImageRegion.html#915f081743742ec14ca69c876e98fac4">IsInside</a>( index );
<a name="l00204"></a>00204 
<a name="l00205"></a>00205     <span class="keywordflow">return</span> isInside;
<a name="l00206"></a>00206     }
<a name="l00207"></a>00207 
<a name="l00212"></a>00212   <span class="keyword">template</span>&lt;<span class="keyword">class</span> TCoordRep&gt;
<a name="l00213"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#8a7e796f3252bd5b364e3571e7303e2c">00213</a>   <span class="keywordtype">bool</span> TransformPhysicalPointToIndex(
<a name="l00214"></a>00214             <span class="keyword">const</span> <a class="code" href="classitk_1_1Point.html" title="A templated class holding a geometric point in n-Dimensional space.">Point&lt;TCoordRep, 3&gt;</a>&amp; point,
<a name="l00215"></a>00215             <a class="code" href="classitk_1_1Index.html">IndexType</a> &amp; index                                )<span class="keyword"> const</span>
<a name="l00216"></a>00216 <span class="keyword">    </span>{
<a name="l00217"></a>00217     <a class="code" href="classitk_1_1ImageRegion.html" title="An image region represents a structured region of data.">RegionType</a> region = this-&gt;GetLargestPossibleRegion();
<a name="l00218"></a>00218     <span class="keywordtype">double</span> maxAzimuth =    region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(0) - 1;
<a name="l00219"></a>00219     <span class="keywordtype">double</span> maxElevation =  region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(1) - 1;
<a name="l00221"></a>00221 
<a name="l00222"></a>00222     <span class="comment">// Convert Cartesian coordinates into angular coordinates</span>
<a name="l00223"></a>00223     TCoordRep azimuth   = vcl_atan(point[0] / point[2]);
<a name="l00224"></a>00224     TCoordRep elevation = vcl_atan(point[1] / point[2]);
<a name="l00225"></a>00225     TCoordRep radius    = vcl_sqrt(point[0] * point[0]
<a name="l00226"></a>00226                                 + point[1] * point[1]
<a name="l00227"></a>00227                                 + point[2] * point[2] );
<a name="l00228"></a>00228     
<a name="l00229"></a>00229     <span class="comment">// Convert the "proper" angular coordinates into index format</span>
<a name="l00230"></a>00230     index[0] = <span class="keyword">static_cast&lt;</span>IndexValueType<span class="keyword">&gt;</span>(
<a name="l00231"></a>00231       (azimuth/m_AzimuthAngularSeparation)
<a name="l00232"></a>00232       + (maxAzimuth/2.0) );
<a name="l00233"></a>00233     index[1] = <span class="keyword">static_cast&lt;</span>IndexValueType<span class="keyword">&gt;</span>(
<a name="l00234"></a>00234       (elevation/m_ElevationAngularSeparation)
<a name="l00235"></a>00235       + (maxElevation/2.0) );
<a name="l00236"></a>00236     index[2] = <span class="keyword">static_cast&lt;</span>IndexValueType<span class="keyword">&gt;</span>(
<a name="l00237"></a>00237       ((radius-m_FirstSampleDistance)
<a name="l00238"></a>00238        / m_RadiusSampleSize ) );
<a name="l00239"></a>00239     
<a name="l00240"></a>00240     <span class="comment">// Now, check to see if the index is within allowed bounds</span>
<a name="l00241"></a>00241     <span class="keyword">const</span> <span class="keywordtype">bool</span> isInside = region.<a class="code" href="classitk_1_1ImageRegion.html#915f081743742ec14ca69c876e98fac4">IsInside</a>( index );
<a name="l00242"></a>00242 
<a name="l00243"></a>00243     <span class="keywordflow">return</span> isInside;
<a name="l00244"></a>00244     }
<a name="l00245"></a>00245 
<a name="l00250"></a>00250   <span class="keyword">template</span>&lt;<span class="keyword">class</span> TCoordRep&gt;
<a name="l00251"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#317826f470c3ebe935418d570dbca03a">00251</a>   <span class="keywordtype">void</span> TransformContinuousIndexToPhysicalPoint(
<a name="l00252"></a>00252             <span class="keyword">const</span> <a class="code" href="classitk_1_1ContinuousIndex.html" title="A templated class holding a point in n-Dimensional image space.">ContinuousIndex&lt;TCoordRep, 3&gt;</a>&amp; index,
<a name="l00253"></a>00253             <a class="code" href="classitk_1_1Point.html" title="A templated class holding a geometric point in n-Dimensional space.">Point&lt;TCoordRep, 3&gt;</a>&amp; point        )<span class="keyword"> const</span>
<a name="l00254"></a>00254 <span class="keyword">    </span>{
<a name="l00255"></a>00255     <a class="code" href="classitk_1_1ImageRegion.html" title="An image region represents a structured region of data.">RegionType</a> region = this-&gt;GetLargestPossibleRegion();
<a name="l00256"></a>00256     <span class="keywordtype">double</span> maxAzimuth =    region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(0) - 1;
<a name="l00257"></a>00257     <span class="keywordtype">double</span> maxElevation =  region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(1) - 1;
<a name="l00259"></a>00259 
<a name="l00260"></a>00260     <span class="comment">// Convert the index into proper angular coordinates</span>
<a name="l00261"></a>00261     TCoordRep azimuth   = ( index[0] - (maxAzimuth/2.0) )
<a name="l00262"></a>00262                           * m_AzimuthAngularSeparation;
<a name="l00263"></a>00263     TCoordRep elevation = ( index[1] - (maxElevation/2.0) )
<a name="l00264"></a>00264                           * m_ElevationAngularSeparation;
<a name="l00265"></a>00265     TCoordRep radius    = (index[2]*m_RadiusSampleSize)+m_FirstSampleDistance;
<a name="l00266"></a>00266     
<a name="l00267"></a>00267     <span class="comment">// Convert the angular coordinates into Cartesian coordinates</span>
<a name="l00268"></a>00268     TCoordRep tanOfAzimuth    = vcl_tan(azimuth);
<a name="l00269"></a>00269     TCoordRep tanOfElevation  = vcl_tan(elevation);
<a name="l00270"></a>00270     point[2] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( radius /
<a name="l00271"></a>00271            vcl_sqrt(1 +
<a name="l00272"></a>00272                     tanOfAzimuth*tanOfAzimuth +
<a name="l00273"></a>00273                     tanOfElevation*tanOfElevation));
<a name="l00274"></a>00274     point[1] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( point[2] * tanOfElevation );
<a name="l00275"></a>00275     point[0] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( point[2] * tanOfAzimuth );
<a name="l00276"></a>00276     }
<a name="l00277"></a>00277 
<a name="l00283"></a>00283   <span class="keyword">template</span>&lt;<span class="keyword">class</span> TCoordRep&gt;
<a name="l00284"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#82e6b1e3e166ef36a45bab4df18adf23">00284</a>   <span class="keywordtype">void</span> TransformIndexToPhysicalPoint(
<a name="l00285"></a>00285                       <span class="keyword">const</span> <a class="code" href="classitk_1_1Index.html">IndexType</a> &amp; index,
<a name="l00286"></a>00286                       <a class="code" href="classitk_1_1Point.html" title="A templated class holding a geometric point in n-Dimensional space.">Point&lt;TCoordRep, 3&gt;</a>&amp; point )<span class="keyword"> const</span>
<a name="l00287"></a>00287 <span class="keyword">    </span>{
<a name="l00288"></a>00288     <a class="code" href="classitk_1_1ImageRegion.html" title="An image region represents a structured region of data.">RegionType</a> region = this-&gt;GetLargestPossibleRegion();
<a name="l00289"></a>00289     <span class="keywordtype">double</span> maxAzimuth =    region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(0) - 1;
<a name="l00290"></a>00290     <span class="keywordtype">double</span> maxElevation =  region.<a class="code" href="classitk_1_1ImageRegion.html#13a537aaa496a4994491d91312b29079">GetSize</a>(1) - 1;
<a name="l00292"></a>00292 
<a name="l00293"></a>00293     <span class="comment">// Convert the index into proper angular coordinates</span>
<a name="l00294"></a>00294     TCoordRep azimuth = 
<a name="l00295"></a>00295       (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(index[0]) - (maxAzimuth/2.0) )
<a name="l00296"></a>00296       * m_AzimuthAngularSeparation;
<a name="l00297"></a>00297     TCoordRep elevation =
<a name="l00298"></a>00298       (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(index[1]) - (maxElevation/2.0) )
<a name="l00299"></a>00299       * m_ElevationAngularSeparation;
<a name="l00300"></a>00300     TCoordRep radius =
<a name="l00301"></a>00301       (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(index[2]) * m_RadiusSampleSize)
<a name="l00302"></a>00302       + m_FirstSampleDistance;
<a name="l00303"></a>00303     
<a name="l00304"></a>00304     <span class="comment">// Convert the angular coordinates into Cartesian coordinates</span>
<a name="l00305"></a>00305     TCoordRep tanOfAzimuth    = vcl_tan(azimuth);
<a name="l00306"></a>00306     TCoordRep tanOfElevation  = vcl_tan(elevation);
<a name="l00307"></a>00307     point[2] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>(
<a name="l00308"></a>00308       radius / vcl_sqrt(
<a name="l00309"></a>00309         1.0 + tanOfAzimuth*tanOfAzimuth + tanOfElevation*tanOfElevation) );
<a name="l00310"></a>00310     point[1] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( point[2] * tanOfElevation );
<a name="l00311"></a>00311     point[0] = <span class="keyword">static_cast&lt;</span>TCoordRep<span class="keyword">&gt;</span>( point[2] * tanOfAzimuth );
<a name="l00312"></a>00312     }
<a name="l00313"></a>00313   
<a name="l00314"></a>00314   
<a name="l00316"></a>00316   <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(AzimuthAngularSeparation, <span class="keywordtype">double</span>);
<a name="l00317"></a>00317 
<a name="l00319"></a>00319   <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(ElevationAngularSeparation, <span class="keywordtype">double</span>);
<a name="l00320"></a>00320 
<a name="l00322"></a>00322   <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(RadiusSampleSize, <span class="keywordtype">double</span>);
<a name="l00323"></a>00323 
<a name="l00325"></a>00325   <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(FirstSampleDistance, <span class="keywordtype">double</span>);
<a name="l00326"></a>00326 
<a name="l00327"></a>00327 <span class="preprocessor">#ifdef ITK_USE_ORIENTED_IMAGE_DIRECTION</span>
<a name="l00328"></a>00328 <span class="preprocessor"></span>  <span class="keyword">template</span>&lt;<span class="keyword">class</span> TCoordRep&gt;
<a name="l00329"></a>00329   <span class="keywordtype">void</span> TransformLocalVectorToPhysicalVector(
<a name="l00330"></a>00330     <span class="keyword">const</span> <a class="code" href="classitk_1_1FixedArray.html" title="Simulate a standard C array with copy semnatics.">FixedArray&lt;TCoordRep, 3&gt;</a> &amp; inputGradient,
<a name="l00331"></a>00331           <a class="code" href="classitk_1_1FixedArray.html" title="Simulate a standard C array with copy semnatics.">FixedArray&lt;TCoordRep, 3&gt;</a> &amp; outputGradient )<span class="keyword"> const</span>
<a name="l00332"></a>00332 <span class="keyword">    </span>{
<a name="l00333"></a>00333     }
<a name="l00334"></a>00334 <span class="preprocessor">#endif</span>
<a name="l00335"></a>00335 <span class="preprocessor"></span><span class="keyword">protected</span>:
<a name="l00336"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#95d8b72ea4507a64a6d843ca4440812f">00336</a>   <a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html" title="Templated 3D nonrectilinear-coordinate image class for phased-array &amp;quot;range&amp;quot;...">PhasedArray3DSpecialCoordinatesImage</a>()
<a name="l00337"></a>00337     {
<a name="l00338"></a>00338     m_RadiusSampleSize = 1;
<a name="l00339"></a>00339     m_AzimuthAngularSeparation   =  1 * (2.0*vnl_math::pi/360.0); <span class="comment">// 1 degree</span>
<a name="l00340"></a>00340     m_ElevationAngularSeparation =  1 * (2.0*vnl_math::pi/360.0); <span class="comment">// 1 degree</span>
<a name="l00341"></a>00341     m_FirstSampleDistance = 0;
<a name="l00342"></a>00342     }
<a name="l00343"></a><a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#e55658d5d4e8470689612a1bc16e389c">00343</a>   <span class="keyword">virtual</span> <a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html#e55658d5d4e8470689612a1bc16e389c">~PhasedArray3DSpecialCoordinatesImage</a>() {};
<a name="l00344"></a>00344   <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">PrintSelf</a>(std::ostream&amp; os, <a class="code" href="classitk_1_1Indent.html" title="Control indentation during Print() invocation.">Indent</a> indent) <span class="keyword">const</span>;
<a name="l00345"></a>00345   
<a name="l00346"></a>00346 <span class="keyword">private</span>:
<a name="l00347"></a>00347   <a class="code" href="classitk_1_1PhasedArray3DSpecialCoordinatesImage.html" title="Templated 3D nonrectilinear-coordinate image class for phased-array &amp;quot;range&amp;quot;...">PhasedArray3DSpecialCoordinatesImage</a>(<span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a>&amp;);<span class="comment">//purposely not implemented</span>
<a name="l00348"></a>00348   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a>&amp;); <span class="comment">//purposely not implemented</span>
<a name="l00349"></a>00349   
<a name="l00350"></a>00350   <span class="keywordtype">double</span>  m_AzimuthAngularSeparation;   <span class="comment">// in radians</span>
<a name="l00351"></a>00351   <span class="keywordtype">double</span>  m_ElevationAngularSeparation; <span class="comment">// in radians</span>
<a name="l00352"></a>00352   <span class="keywordtype">double</span>  m_RadiusSampleSize;
<a name="l00353"></a>00353   <span class="keywordtype">double</span>  m_FirstSampleDistance;
<a name="l00354"></a>00354   
<a name="l00355"></a>00355 };
<a name="l00356"></a>00356 } <span class="comment">// end namespace itk</span>
<a name="l00357"></a>00357 
<a name="l00358"></a>00358 <span class="comment">// Define instantiation macro for this template.</span>
<a name="l00359"></a><a class="code" href="itkPhasedArray3DSpecialCoordinatesImage_8h.html#95b6ed81d9f380e580646196e8ebc572">00359</a> <span class="preprocessor">#define ITK_TEMPLATE_PhasedArray3DSpecialCoordinatesImage(_, EXPORT, x, y) namespace itk { \</span>
<a name="l00360"></a>00360 <span class="preprocessor">  _(1(class EXPORT PhasedArray3DSpecialCoordinatesImage&lt; ITK_TEMPLATE_1 x &gt;)) \</span>
<a name="l00361"></a>00361 <span class="preprocessor">  namespace Templates { typedef PhasedArray3DSpecialCoordinatesImage&lt; ITK_TEMPLATE_1 x &gt; \</span>
<a name="l00362"></a>00362 <span class="preprocessor">                                         PhasedArray3DSpecialCoordinatesImage##y; } \</span>
<a name="l00363"></a>00363 <span class="preprocessor">  }</span>
<a name="l00364"></a>00364 <span class="preprocessor"></span>
<a name="l00365"></a>00365 <span class="preprocessor">#if ITK_TEMPLATE_EXPLICIT</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span><span class="preprocessor"># include "Templates/itkPhasedArray3DSpecialCoordinatesImage+-.h"</span>
<a name="l00367"></a>00367 <span class="preprocessor">#endif</span>
<a name="l00368"></a>00368 <span class="preprocessor"></span>
<a name="l00369"></a>00369 <span class="preprocessor">#if ITK_TEMPLATE_TXX</span>
<a name="l00370"></a>00370 <span class="preprocessor"></span><span class="preprocessor"># include "itkPhasedArray3DSpecialCoordinatesImage.txx"</span>
<a name="l00371"></a>00371 <span class="preprocessor">#endif</span>
<a name="l00372"></a>00372 <span class="preprocessor"></span>
<a name="l00373"></a>00373 <span class="preprocessor">#endif</span>
<a name="l00374"></a>00374 <span class="preprocessor"></span>
</pre></div></div>
<hr><address><small>
Generated at Thu May 7 23:51:00 2009 for ITK  by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img 
src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen"
align="middle" border=0 width=110 height=53>
</a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2000</small></address>
</body>
</html>