<div>Actually, there is also another error here. NonpositiveMin() should replace min(). Also, it looks like the ConstrainedValueAddImageFilter is wrong. It assumes only overflow can occur. If the values are negative, then underflow can occur. 
</div>
<div>&nbsp;</div>
<div>I&#39;ll try to fix these before the upcoming release.</div><span class="sg">
<div>&nbsp;</div>
<div>Bill</div></span>
<div><span class="e" id="q_110e512210c8bf6f_2">
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 2/21/07, <b class="gmail_sendername">Marius Staring</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marius@isi.uu.nl" target="_blank">marius@isi.uu.nl</a>&gt; wrote:
</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>The implementation of the operator() in the functor of the<br>ConstrainedValueDifferenceImageFilter now reads: 
<br><br>&nbsp;&nbsp; const double dA = static_cast&lt;double&gt;( A );<br>&nbsp;&nbsp; const double dB = static_cast&lt;double&gt;( B );<br>&nbsp;&nbsp; const double diff = dA - dB;<br>&nbsp;&nbsp; const double cdiff = ( diff &gt; NumericTraits&lt;TOutput&gt;::min() ) ? diff 
<br>: NumericTraits&lt;TOutput&gt;::min();<br>&nbsp;&nbsp; return static_cast&lt;TOutput&gt;( cdiff );<br><br>I think that should be<br><br>&nbsp;&nbsp; const double dA = static_cast&lt;double&gt;( A );<br>&nbsp;&nbsp; const double dB = static_cast&lt;double&gt;( B ); 
<br>&nbsp;&nbsp; const double diff = dA - dB;<br>&nbsp;&nbsp; const double cdiff1 = ( diff &gt; NumericTraits&lt;TOutput&gt;::min() ) ?<br>diff : NumericTraits&lt;TOutput&gt;::min();<br>&nbsp;&nbsp; const double cdiff2 = ( cdiff1 &lt; NumericTraits&lt;TOutput&gt;::max() ) ? 
<br>diffc1 : NumericTraits&lt;TOutput&gt;::max();<br>&nbsp;&nbsp; return static_cast&lt;TOutput&gt;( cdiff2 );<br><br>or am I missing something?<br><br>Cheers,<br><br>--<br>Marius Staring<br>Image Sciences Institute<br>University Medical Centre Utrecht 
<br>Heidelberglaan 100, 3584 CX Utrecht, The Netherlands<br>phone: +31 (0)30 250 3186, fax: +31 (0)30 251 3399<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marius@isi.uu.nl" target="_blank">marius@isi.uu.nl
</a>, <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.isi.uu.nl/People/Marius" target="_blank">http://www.isi.uu.nl/People/Marius </a><br><br>_______________________________________________<br>Insight-users mailing list
<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br></span></div>