/usr/include/ITK-4.5/itkFEMLoadLandmark.h is in libinsighttoolkit4-dev 4.5.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkFEMLoadLandmark_h
#define __itkFEMLoadLandmark_h
#include "itkFEMLoadElementBase.h"
#include "vnl/vnl_vector.h"
namespace itk
{
namespace fem
{
/**
* \class LoadLandmark
* \brief This load is derived from the motion of a specific landmark
*
* This load depends on the motion of a point from an undeformed
* configuration to a deformed configuration.
* \ingroup ITKFEM
*/
class LoadLandmark : public LoadElement
{
public:
/** Standard class typedefs. */
typedef LoadLandmark Self;
typedef LoadElement Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkSimpleNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(LoadLandmark, LoadElement);
/** CreateAnother method will clone the existing instance of this type,
* including its internal member variables. */
virtual::itk::LightObject::Pointer CreateAnother(void) const;
/**
* Methods to access the most recent solution vector
*/
void SetSolution(Solution::ConstPointer ptr)
{
m_Solution = ptr;
}
Solution::ConstPointer GetSolution()
{
return m_Solution;
}
Float GetSolution(unsigned int i, unsigned int v = 0)
{
return m_Solution->GetSolutionValue(i, v);
}
/**
* Access the location of the point load
*/
Element::VectorType & GetPoint()
{
return m_Point;
}
/**
* Set the force vector
*/
void SetPoint(const vnl_vector<Float> & pt)
{
m_Point = pt;
}
/**
* Access the location of the point load
*/
Element::VectorType & GetSource()
{
return m_Source;
}
const Element::VectorType & GetSource() const
{
return m_Source;
}
/**
* Get the force vector
*/
Element::VectorType & GetForce()
{
return m_Force;
}
const Element::VectorType & GetForce() const
{
return m_Force;
}
/**
* Set the force vector
*/
void SetForce(const vnl_vector<Float> & force)
{
if( m_Force.size() != force.size() )
{
m_Force.set_size( force.size() );
}
for( unsigned int i = 0; i < force.size(); i++ )
{
m_Force[i] = force[i];
}
}
/**
* Set the force vector
*/
void SetSource(const vnl_vector<Float> & source)
{
if( m_Source.size() != source.size() )
{
m_Source.set_size( source.size() );
}
for( unsigned int i = 0; i < source.size(); i++ )
{
m_Source[i] = source[i];
}
}
/**
* Access the location of the point load
*/
Element::VectorType & GetTarget()
{
return m_Target;
}
const Element::VectorType & GetTarget() const
{
return m_Target;
}
/**
* Set the force vector
*/
void SetTarget(const vnl_vector<Float> & target)
{
if( m_Target.size() != target.size() )
{
m_Target.set_size( target.size() );
}
for( unsigned int i = 0; i < target.size(); i++ )
{
m_Target[i] = target[i];
}
}
void ScalePointAndForce(double *spacing, double fwt)
{
for( unsigned int i = 0; i < m_Target.size(); i++ )
{
m_Target[i] /= spacing[i];
m_Source[i] /= spacing[i];
this->m_Eta *= fwt;
}
}
/**
* Set the element containing the landmark
*/
void SetContainedElement(const Element * e)
{
this->m_Element[0] = e;
}
/**
* Get the element containing the landmark
*/
const Element * GetContainedElement() const
{
return this->m_Element[0];
}
/**
* Assign the LoadLandmark to an element
*/
virtual bool AssignToElement(Element::ArrayType::Pointer elements);
virtual bool AssignToElement(Element::ArrayType1::Pointer elements);
virtual Element::ConstPointer GetAssignedElement(Element::ArrayType1::Pointer elements);
/**
* Default constructors
*/
LoadLandmark():
m_Eta(0),
m_Target(0),
m_Source(0),
m_Force(0),
m_Solution(0)
{
}
/** Get/Set the eta parameter, square root of the variance, for the load */
void SetEta(double e);
double GetEta() const;
/** Apply the load to the specified element */
virtual void ApplyLoad(Element::ConstPointer element, Element::VectorType & Fe);
protected:
virtual void PrintSelf(std::ostream& os, Indent indent) const;
/**
* Square root of the variance (eta)
*/
double m_Eta;
/**
* Point in __local coordinates__ in the undeformed configuration
*/
vnl_vector<Float> m_Point;
/**
* Point in __global coordinates__ in the deformed configuration
*/
vnl_vector<Float> m_Target;
vnl_vector<Float> m_Source;
vnl_vector<Float> m_Force;
/**
* Pointer to the element which contains the undeformed
* configuration of the landmark
*/
// Element::ConstPointer m_element;
/**
* Pointer to the solution object
*/
Solution::ConstPointer m_Solution;
};
}
} // end namespace itk::fem
#endif // #ifndef __itkFEMLoadLandmark_h
|