<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>I too have had trouble using the Invert Image filter. By default it just performs:</div><div><br></div><div>NumericTraits< TInput >::max() - X</div><div><br></div><div>for each pixel element. This definition make sense for unsigned integers but is problematic for signed and real numbers. Of course there are different interpretations of inversion for these pixel types. But for floating and double this will more often then not, result in an image full of zeros due to numeric imprecision.</div><div><br></div><div>For floats, setting the maximum value to 0, will invert the sign. This may be the type of inversion you are talking about. </div><div><br></div><div>I would suggest that the filter should be changed so that for real types the default should be 0, as the current value results in poor outputs more often then not in this case. </div><div><div><br></div></div><br><div><div>On Aug 9, 2009, at 5:50 PM, Gaëtan Lehmann wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>Le 9 août 09 à 22:58, <a href="mailto:lynx.abraxas@freenet.de">lynx.abraxas@freenet.de</a> a écrit :<br><br>You have to give the maximum value in your image to <br>InvertIntensityImageFilter to have it inversed.<br>Dirk has recently proposed to enhance InvertIntensityImageFilter to <br>let it compute that value automatically. Maybe he has already <br>implemented that feature...<br></div></blockquote><div><br></div><div>I think we may need 2 different inversion filters:</div><div><br></div><div>1) inverts on the values of the range of the image, this would need the automatic computation of these values, or the user setting the minimum and maximum</div><div><br></div><div>Note: the problem with automatically computing the range is that it requires the full image and therefor the filter will not be able to stream any more</div><div><br></div><div>2) inverts on the range of the pixel type, or about zero for reals. Again care needs to be take as to not result in overflow.</div><div><br></div><div><br></div><div>It is amazing that such an apparent simple filter becomes rather complicated when any pixel type can be used. BTW, I just use ShiftScale for this type of operation, since it's more logical then setting max to zero.</div><div><br></div><div><br></div><div>Brad</div></div><div><br></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin </span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span> </div><br></body></html>