<!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: itkFEMLoadLandmark.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> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <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> » <a class="el" href="dir_2c33022d19e8077162952ea9ed57656d.html">Numerics</a> » <a class="el" href="dir_316e5ab5c8a9cb56a9dce1c9fc454a23.html">FEM</a> </div> <div class="contents"> <h1>itkFEMLoadLandmark.h</h1><a href="itkFEMLoadLandmark_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 & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkFEMLoadLandmark.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-01-30 21:10:18 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.12 $</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 <a name="l00018"></a>00018 <span class="preprocessor">#ifndef __itkFEMLoadLandmark_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __itkFEMLoadLandmark_h</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkFEMLoadElementBase_8h.html">itkFEMLoadElementBase.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "vnl/vnl_vector.h"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="keyword">namespace </span>itk { <a name="l00025"></a>00025 <span class="keyword">namespace </span>fem { <a name="l00026"></a>00026 <a name="l00034"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html">00034</a> <span class="keyword">class </span><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html" title="This load is derived from the motion of a specific landmark.">LoadLandmark</a> : <span class="keyword">public</span> <a class="code" href="classitk_1_1fem_1_1LoadElement.html" title="Virtual element load base class.">LoadElement</a> { <a name="l00035"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#0bbe30612b129fe23a76f3d26a8838b9">00035</a> <a class="code" href="itkFEMMacro_8h.html#a6412b85156702b319322aa9a908209d" title="Defines typedefs for pointers to class.">FEM_CLASS</a>(<a class="code" href="classitk_1_1fem_1_1LoadLandmark.html" title="This load is derived from the motion of a specific landmark.">LoadLandmark</a>,<a class="code" href="classitk_1_1fem_1_1LoadElement.html" title="Virtual element load base class.">LoadElement</a>) <a name="l00036"></a>00036 public: <a name="l00037"></a>00037 <a name="l00041"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#f106e02282547c1c454c6b38a80300ed">00041</a> <span class="keywordtype">double</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#f106e02282547c1c454c6b38a80300ed">eta</a>; <a name="l00042"></a>00042 <a name="l00046"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#48bfec5106643b986c8579f17219003c">00046</a> <a class="code" href="classvnl__vector.html">vnl_vector</a><<a class="code" href="classitk_1_1fem_1_1LoadElement.html#51741f42d87b412338c29f5393deb498">Float</a>> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#48bfec5106643b986c8579f17219003c">m_pt</a>; <a name="l00047"></a>00047 <a name="l00051"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">00051</a> <a class="code" href="classvnl__vector.html">vnl_vector</a><<a class="code" href="classitk_1_1fem_1_1LoadElement.html#51741f42d87b412338c29f5393deb498">Float</a>> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>; <a name="l00052"></a>00052 <a name="l00053"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">00053</a> <a class="code" href="classvnl__vector.html">vnl_vector</a><<a class="code" href="classitk_1_1fem_1_1LoadElement.html#51741f42d87b412338c29f5393deb498">Float</a>> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>; <a name="l00054"></a>00054 <a name="l00055"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">00055</a> <a class="code" href="classvnl__vector.html">vnl_vector</a><<a class="code" href="classitk_1_1fem_1_1LoadElement.html#51741f42d87b412338c29f5393deb498">Float</a>> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">m_force</a>; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <a name="l00062"></a>00062 <span class="comment">//Element::ConstPointer m_element;</span> <a name="l00063"></a>00063 <a name="l00067"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#300849464adf84c1f5ccce0990f7b95e">00067</a> <a class="code" href="classitk_1_1fem_1_1Solution.html" title="Provides functions to access the values of the solution vector.">Solution</a>::<a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">ConstPointer</a> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#300849464adf84c1f5ccce0990f7b95e">m_Solution</a>; <a name="l00068"></a>00068 <a name="l00072"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#721dc10568240800e10dd88d37a1dac1">00072</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#721dc10568240800e10dd88d37a1dac1">SetSolution</a>(<a class="code" href="classitk_1_1fem_1_1Solution.html" title="Provides functions to access the values of the solution vector.">Solution</a>::<a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">ConstPointer</a> ptr) { m_Solution = ptr; } <a name="l00073"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#abf53117c002b6dd214f57549ee679b1">00073</a> <a class="code" href="classitk_1_1fem_1_1Solution.html" title="Provides functions to access the values of the solution vector.">Solution::ConstPointer</a> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#abf53117c002b6dd214f57549ee679b1">GetSolution</a>() { <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#300849464adf84c1f5ccce0990f7b95e">m_Solution</a>; } <a name="l00074"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#4c07316dc5ce670ca5afaaa71f51a603">00074</a> <a class="code" href="classitk_1_1fem_1_1LoadElement.html#51741f42d87b412338c29f5393deb498">Float</a> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#4c07316dc5ce670ca5afaaa71f51a603">GetSolution</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> v=0) { <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#300849464adf84c1f5ccce0990f7b95e">m_Solution</a>-><a class="code" href="classitk_1_1fem_1_1Solution.html#4d4ea59c159d3d809bd5f7cb83f44818">GetSolutionValue</a>(i,v); } <a name="l00076"></a>00076 <a name="l00080"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#856d7f1c69da6c5dd9587f8eca475141">00080</a> <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">Element::VectorType</a>& <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#856d7f1c69da6c5dd9587f8eca475141">GetPoint</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#48bfec5106643b986c8579f17219003c">m_pt</a>; } <a name="l00081"></a>00081 <a name="l00085"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#08d0638f87c7746d518e0bc0f4bf8305">00085</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#08d0638f87c7746d518e0bc0f4bf8305">SetPoint</a>( <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">vnl_vector<Float></a>& pt) { <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#48bfec5106643b986c8579f17219003c">m_pt</a>=pt; } <a name="l00086"></a>00086 <a name="l00090"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#51ff19d571f63035db897017c9041d03">00090</a> <a class="code" href="classvnl__vector.html">Element::VectorType</a>& <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#51ff19d571f63035db897017c9041d03">GetSource</a>() <a name="l00091"></a>00091 { <a name="l00092"></a>00092 <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>; <a name="l00093"></a>00093 } <a name="l00094"></a>00094 <a name="l00095"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#b027a0b9e0de955e08d445561e6f4124">00095</a> <a class="code" href="classvnl__vector.html">Element::VectorType</a>& <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#b027a0b9e0de955e08d445561e6f4124">GetForce</a>() <a name="l00096"></a>00096 { <a name="l00097"></a>00097 <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">m_force</a>; <a name="l00098"></a>00098 } <a name="l00099"></a>00099 <a name="l00103"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#218b9af95f70b27c549ab1a3fe0934a2">00103</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#218b9af95f70b27c549ab1a3fe0934a2">SetForce</a>( <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">vnl_vector<Float></a>& force) <a name="l00104"></a>00104 { <a name="l00105"></a>00105 <span class="keywordflow">if</span> (<a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">m_force</a>.size() != force.size()) <a name="l00106"></a>00106 { <a name="l00107"></a>00107 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">m_force</a>.set_size(force.size()); <a name="l00108"></a>00108 } <a name="l00109"></a>00109 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<force.size(); i++) <a name="l00110"></a>00110 { <a name="l00111"></a>00111 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#e3daf132ca8e29d33f63ccf6b0d1c1c9">m_force</a>[i]=force[i]; <a name="l00112"></a>00112 } <a name="l00113"></a>00113 } <a name="l00115"></a>00115 <a name="l00116"></a>00116 <a name="l00120"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#a2b0972355b3f1ebb019f668794983ae">00120</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#a2b0972355b3f1ebb019f668794983ae">SetSource</a>( <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">vnl_vector<Float></a>& source) <a name="l00121"></a>00121 { <a name="l00122"></a>00122 <span class="keywordflow">if</span> (<a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>.size() != source.size()) <a name="l00123"></a>00123 { <a name="l00124"></a>00124 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>.set_size(source.size()); <a name="l00125"></a>00125 } <a name="l00126"></a>00126 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<source.size(); i++) <a name="l00127"></a>00127 { <a name="l00128"></a>00128 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>[i]=source[i]; <a name="l00129"></a>00129 } <a name="l00130"></a>00130 } <a name="l00132"></a>00132 <a name="l00136"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#cb8573f43dcf16d86d18232b81960e4a">00136</a> <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">Element::VectorType</a>& <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#cb8573f43dcf16d86d18232b81960e4a">GetTarget</a>()<span class="keyword"> const</span> <a name="l00137"></a>00137 <span class="keyword"> </span>{ <a name="l00138"></a>00138 <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>; <a name="l00139"></a>00139 } <a name="l00140"></a>00140 <a name="l00144"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#dd4e93b186ad4c5aa7a7822b81301109">00144</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#dd4e93b186ad4c5aa7a7822b81301109">SetTarget</a>( <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">vnl_vector<Float></a>& target) <a name="l00145"></a>00145 { <a name="l00146"></a>00146 <span class="keywordflow">if</span> (<a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>.size() != target.size()) <a name="l00147"></a>00147 { <a name="l00148"></a>00148 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>.set_size(target.size()); <a name="l00149"></a>00149 } <a name="l00150"></a>00150 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<target.size(); i++) <a name="l00151"></a>00151 { <a name="l00152"></a>00152 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>[i]=target[i]; <a name="l00153"></a>00153 } <a name="l00154"></a>00154 } <a name="l00156"></a>00156 <a name="l00157"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#a58bc5492a2d5d7de9ad5f950f8f2ec2">00157</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#a58bc5492a2d5d7de9ad5f950f8f2ec2">ScalePointAndForce</a>( <span class="keywordtype">double</span>* spacing, <span class="keywordtype">double</span> fwt) <a name="l00158"></a>00158 { <a name="l00159"></a>00159 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<<a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>.size(); i++) <a name="l00160"></a>00160 { <a name="l00161"></a>00161 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#1faac505729b7f9f91c4596a3b5793f0">m_target</a>[i] /= spacing[i]; <a name="l00162"></a>00162 <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#95577c76bfaf4a0338571a0f8b92c013">m_source</a>[i] /= spacing[i]; <a name="l00163"></a>00163 this-><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#f106e02282547c1c454c6b38a80300ed">eta</a> *= fwt; <a name="l00164"></a>00164 } <a name="l00165"></a>00165 } <a name="l00166"></a>00166 <a name="l00170"></a>00170 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#0f63a2ef35fff7d0148376bfb313391d">Read</a>( std::istream& f, <span class="keywordtype">void</span>* info ); <a name="l00171"></a>00171 <a name="l00175"></a>00175 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#60c0a73ab17fc6307798511d01c40423">AssignToElement</a>( <a class="code" href="classitk_1_1fem_1_1FEMPArray.html" title="Array for FEMP objects.">Element::ArrayType::Pointer</a> elements ); <a name="l00176"></a>00176 <a name="l00180"></a>00180 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#ef93070a17d370731bbbb68989c0bed3">Write</a>( std::ostream& f ) <span class="keyword">const</span>; <a name="l00181"></a>00181 <a name="l00185"></a><a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#965192ad502b2828e2fbcf0bc530e739">00185</a> <a class="code" href="classitk_1_1fem_1_1LoadLandmark.html#965192ad502b2828e2fbcf0bc530e739">LoadLandmark</a>() {} <a name="l00186"></a>00186 }; <a name="l00187"></a>00187 <a name="l00188"></a>00188 <a class="code" href="itkFEMMacro_8h.html#8e28ecb22695169b30a5c5e18f1ecf90" title="Perform any initialization tasks for a class.">FEM_CLASS_INIT</a>(LoadLandmark) <a name="l00189"></a>00189 <a name="l00190"></a>00190 }} <span class="comment">// end namespace itk::fem</span> <a name="l00191"></a>00191 <a name="l00192"></a>00192 <span class="preprocessor">#endif // #ifndef __itkFEMLoadLandmark_h</span> <a name="l00193"></a>00193 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 22:41:59 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>, © 1997-2000</small></address> </body> </html>