Sophie

Sophie

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

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: itk::CacheableScalarFunction Class Reference</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="namespaceitk.html">itk</a>::<a class="el" href="classitk_1_1CacheableScalarFunction.html">CacheableScalarFunction</a>
  </div>
<div class="contents">
<h1>itk::CacheableScalarFunction Class Reference</h1><!-- doxytag: class="itk::CacheableScalarFunction" -->function cache implementation  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for itk::CacheableScalarFunction:</div>
<div class="dynsection">
<p><center><img src="classitk_1_1CacheableScalarFunction__inherit__graph.png" border="0" usemap="#itk_1_1CacheableScalarFunction__inherit__map" alt="Inheritance graph"></center>
<map name="itk_1_1CacheableScalarFunction__inherit__map">
<area shape="rect" id="node3" href="classitk_1_1CompositeValleyFunction.html" title="Multiple valley shaped curve function." alt="" coords="5,83,221,112"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<div class="dynheader">
Collaboration diagram for itk::CacheableScalarFunction:</div>
<div class="dynsection">
<p><center><img src="classitk_1_1CacheableScalarFunction__coll__graph.png" border="0" usemap="#itk_1_1CacheableScalarFunction__coll__map" alt="Collaboration graph"></center>
<map name="itk_1_1CacheableScalarFunction__coll__map">
<area shape="rect" id="node2" href="classitk_1_1Array.html" title="itk::Array\&lt; MeasureType \&gt;" alt="" coords="76,181,279,211"><area shape="rect" id="node4" href="classvnl__vector.html" title="vnl_vector\&lt; MeasureType &#160;\&gt;" alt="" coords="5,85,216,115"><area shape="rect" id="node6" href="classitk_1_1Array.html" title="Array class with size defined at construction time." alt="" coords="240,85,427,115"><area shape="rect" id="node8" href="classvnl__vector.html" title="vnl_vector\&lt; TValueType \&gt;" alt="" coords="235,5,432,35"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classitk_1_1CacheableScalarFunction-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="classitk_1_1Array.html">Array</a>&lt; <a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#e47e01c4f9242afa828ae8459fdbee15">MeasureArrayType</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a></td></tr>

<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#7945e436c1d88335776109b3163b61d3">CacheableScalarFunction</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#75e1d4a0b20464a80d73df54e4c33d1c">Evaluate</a> (<a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a> x)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#fc91ba796ec07c4a8318106acbc00b5f">GetCacheLowerBound</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#6d1670fee265e1cc6673e7b2c6915838">GetCacheUpperBound</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#b9afe43734dd5521d0e8e382528c7615">GetInterval</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#dea9e0cfb540c895c7ae02f09bdcae0b">GetNumberOfSamples</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#6d08a844aad2210ad812989586ec3d5b">IsCacheAvailable</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#13c7f7d6d855f6d8354150bafc6ca48e">~CacheableScalarFunction</a> ()</td></tr>

<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#4ae0a32e403ff42f78565fd1f38a4de3">GetCachedValue</a> (<a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a> x)</td></tr>

<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitk_1_1CacheableScalarFunction.html#56633055451c4c5718e668043df845da">CreateCache</a> (double lowerBound, double upperBound, long sampleSize)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
function cache implementation 
<p>
This is the base class for continuous scalar functions which needs cache for their pre-evaluated function returns.<p>
The internal cache is created using the upper- and lower-bound domain values of the functional form (f(x))of subclasses of this class. So the cache only stores pre-evaluated values between f(lower-bound) and f(upper-bound).<p>
To create a cache for continuous function, it uses sampling. With the given sample number , upper-bound, and lower-bound, it calculates interval within the ranges. It pre-evaluates and save f(x) where x = lower-bound + interval * [0 - sample number]<p>
If a subclass of this class want to use a cache, it should explicitly call CreateCache(...) member function. GetCachedValue(x) will return pre-evaluated f(x) value. However, the return value from GetCachedValue(x) might be different from the exact return value from f(x) which is Evaluate(x) member function of subclasses of this class, because The GetCachedValue(x) member function internally converts x to cache table index and the conversion involves with truncation. So, users can think the cached value as an approximate to exact function return.<p>
In some case, approximate values can be useful. For example, <a class="el" href="classitk_1_1CompositeValleyFunction.html" title="Multiple valley shaped curve function.">CompositeValleyFunction</a> can be used as an M-estimator and it is currently used for <a class="el" href="classitk_1_1MRIBiasFieldCorrectionFilter.html" title="corrects 3D MRI bias field">MRIBiasFieldCorrectionFilter</a> as an energy function. The bias field estimation requires calculation of energy values again and again for each iteration. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00055">55</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="e47e01c4f9242afa828ae8459fdbee15"></a><!-- doxytag: member="itk::CacheableScalarFunction::MeasureArrayType" ref="e47e01c4f9242afa828ae8459fdbee15" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classitk_1_1Array.html">Array</a>&lt;<a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a>&gt; <a class="el" href="classitk_1_1Array.html">itk::CacheableScalarFunction::MeasureArrayType</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="classitk_1_1CompositeValleyFunction.html#0121eac6e8bebe212574930b0342013a">itk::CompositeValleyFunction</a>.</p>

<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00066">66</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="3e6333600aacf7275e6e0311cbedbdb6"></a><!-- doxytag: member="itk::CacheableScalarFunction::MeasureType" ref="3e6333600aacf7275e6e0311cbedbdb6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef double <a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">itk::CacheableScalarFunction::MeasureType</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Function's input and output value type. 
<p>Reimplemented in <a class="el" href="classitk_1_1CompositeValleyFunction.html#ebef7c7dec580890bca3d22149ee4751">itk::CompositeValleyFunction</a>.</p>

<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00065">65</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="7945e436c1d88335776109b3163b61d3"></a><!-- doxytag: member="itk::CacheableScalarFunction::CacheableScalarFunction" ref="7945e436c1d88335776109b3163b61d3" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">itk::CacheableScalarFunction::CacheableScalarFunction           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
</div>
</div><p>
<a class="anchor" name="13c7f7d6d855f6d8354150bafc6ca48e"></a><!-- doxytag: member="itk::CacheableScalarFunction::~CacheableScalarFunction" ref="13c7f7d6d855f6d8354150bafc6ca48e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual itk::CacheableScalarFunction::~CacheableScalarFunction           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00062">62</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="56633055451c4c5718e668043df845da"></a><!-- doxytag: member="itk::CacheableScalarFunction::CreateCache" ref="56633055451c4c5718e668043df845da" args="(double lowerBound, double upperBound, long sampleSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void itk::CacheableScalarFunction::CreateCache           </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>lowerBound</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>upperBound</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>sampleSize</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create the internal cache table and fill it with pre-evaluated values. 
</div>
</div><p>
<a class="anchor" name="75e1d4a0b20464a80d73df54e4c33d1c"></a><!-- doxytag: member="itk::CacheableScalarFunction::Evaluate" ref="75e1d4a0b20464a80d73df54e4c33d1c" args="(MeasureType x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a> itk::CacheableScalarFunction::Evaluate           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a>&nbsp;</td>
          <td class="paramname"> <em>x</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
y = f(x) Subclasses of this class should override this member function to provide their own functional operation . 
<p>Reimplemented in <a class="el" href="classitk_1_1CompositeValleyFunction.html#10d0e29980ed7e24d5a905aabe187758">itk::CompositeValleyFunction</a>.</p>

<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00084">84</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="4ae0a32e403ff42f78565fd1f38a4de3"></a><!-- doxytag: member="itk::CacheableScalarFunction::GetCachedValue" ref="4ae0a32e403ff42f78565fd1f38a4de3" args="(MeasureType x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a> itk::CacheableScalarFunction::GetCachedValue           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classitk_1_1CacheableScalarFunction.html#3e6333600aacf7275e6e0311cbedbdb6">MeasureType</a>&nbsp;</td>
          <td class="paramname"> <em>x</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
y = f(x) = (approximately) cache_table(index(x)) Get the function return using the internal cache table NOTE: Since the index calculation needs conversion from double to int, truncation happens. As a result, the return values from Evaluate(x) and GetCachedValue(x) may not be same for the same x. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00096">96</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

<p>Referenced by <a class="el" href="itkCompositeValleyFunction_8h_source.html#l00122">itk::CompositeValleyFunction::operator()()</a>.</p>

</div>
</div><p>
<a class="anchor" name="fc91ba796ec07c4a8318106acbc00b5f"></a><!-- doxytag: member="itk::CacheableScalarFunction::GetCacheLowerBound" ref="fc91ba796ec07c4a8318106acbc00b5f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double itk::CacheableScalarFunction::GetCacheLowerBound           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the lower-bound of domain that is used for filling the cache table. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00079">79</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="6d1670fee265e1cc6673e7b2c6915838"></a><!-- doxytag: member="itk::CacheableScalarFunction::GetCacheUpperBound" ref="6d1670fee265e1cc6673e7b2c6915838" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double itk::CacheableScalarFunction::GetCacheUpperBound           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the upper-bound of domain that is used for filling the cache table. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00076">76</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="b9afe43734dd5521d0e8e382528c7615"></a><!-- doxytag: member="itk::CacheableScalarFunction::GetInterval" ref="b9afe43734dd5521d0e8e382528c7615" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double itk::CacheableScalarFunction::GetInterval           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gets the interval of each cell between the upper and lower bound 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00088">88</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="dea9e0cfb540c895c7ae02f09bdcae0b"></a><!-- doxytag: member="itk::CacheableScalarFunction::GetNumberOfSamples" ref="dea9e0cfb540c895c7ae02f09bdcae0b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long itk::CacheableScalarFunction::GetNumberOfSamples           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the number of samples between the lower-bound and upper-bound of the cache table. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00070">70</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="6d08a844aad2210ad812989586ec3d5b"></a><!-- doxytag: member="itk::CacheableScalarFunction::IsCacheAvailable" ref="6d08a844aad2210ad812989586ec3d5b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool itk::CacheableScalarFunction::IsCacheAvailable           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Check if the internal cache table and its values are valid. 
<p>Definition at line <a class="el" href="itkCacheableScalarFunction_8h_source.html#l00073">73</a> of file <a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a>.</p>

<p>Referenced by <a class="el" href="itkCompositeValleyFunction_8h_source.html#l00122">itk::CompositeValleyFunction::operator()()</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="itkCacheableScalarFunction_8h_source.html">itkCacheableScalarFunction.h</a></ul>
</div>
<hr><address><small>
Generated at Fri May 8 01:50:49 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>