<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>This is mostly for Bradley Lowenkamp and Matt McCormick, but at some point the wider developer community will be affected and input solicited.</div>
<div><br>
</div>
<div>The MatrixOffsetTransformBase has 3 values in its FixedParameters, which is the values of the center of rotation.</div>
<div><br>
</div>
<div>There was a mystery as to why MatrixOffsetTransformBase starts out with 12 fixed parameters, when it only really has 3.</div>
<div><br>
</div>
<div>The reason is in the constructor for Transform, which initializes the FixedParameters to have the same number of values as the Parameters.</div>
<div><br>
</div>
<div>This is a design flaw; it represents the Anti-Pattern “Initialize a member/variable to a default that is almost always wrong.”</div>
<div><br>
</div>
<div>This leads to most Transform classes resizing the FixedParameters when GetFixedParameters is called, and assigning their value based on the actual fixed parameters for that Transform class.</div>
<div><br>
</div>
<div>This is thread-unsafe, since resizing m_FixedParameters involves a free/allocate pair.</div>
<div><br>
</div>
<div>
<div>template <typename TScalar,</div>
<div> unsigned int NInputDimensions,</div>
<div> unsigned int NOutputDimensions></div>
<div>Transform<TScalar, NInputDimensions, NOutputDimensions></div>
<div>::Transform(NumberOfParametersType numberOfParameters) :</div>
<div> m_Parameters(numberOfParameters),</div>
<div> m_FixedParameters(numberOfParameters)</div>
<div>#ifdef ITKV3_COMPATIBILITY</div>
<div> , m_SharedLocalJacobian(NOutputDimensions, numberOfParameters)</div>
<div>#endif</div>
<div>{</div>
<div>}</div>
</div>
<div><br>
</div>
<br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
<hr>
</body>
</html>