<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<style><!--.hmmessage P{margin:0px;padding:0px}body.hmmessage{font-size: 10pt;font-family:Tahoma}--></style>My code is:<br><br>[...]<br><br>&nbsp; OutputImageType::Pointer D = OutputImageType::New();<br>&nbsp; OutputImageType::Pointer Daverage = OutputImageType::New();<br>&nbsp;<br>&nbsp; D=filter-&gt;GetOutput();<br>&nbsp; Daverage=filterM-&gt;GetOutput();<br><br>&nbsp; OutputImageType::Pointer Dfinal = OutputImageType::New();<br>&nbsp; Dfinal-&gt;SetBufferedRegion( Dfinal-&gt;GetRequestedRegion() );<br>&nbsp; Dfinal-&gt;Allocate();<br><br>&nbsp; typedef itk::ImageRegionIterator&lt;OutputImageType&gt; IteratorType;<br>&nbsp; typedef itk::ImageRegionConstIterator&lt;OutputImageType&gt; ConstIteratorType;<br>&nbsp;<br>&nbsp; IteratorType DfinalIt (Dfinal, Dfinal-&gt;GetRequestedRegion());<br>&nbsp; ConstIteratorType DaverageIt (Daverage, Daverage-&gt;GetRequestedRegion());<br>&nbsp; ConstIteratorType DIt (D, D-&gt;GetRequestedRegion());<br>&nbsp;<br>for (DfinalIt.GoToBegin(), DaverageIt.GoToBegin(), DIt.GoToBegin();!DaverageIt.IsAtEnd(); ++DfinalIt, ++DaverageIt, ++DIt)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DfinalIt.Set(DaverageIt.Get() &lt; (DIt.Get() - 0.55) ? 1 : 0);<br>&nbsp;<br>//After this code Dfinal image will have "1" value at voxels where Daverage &lt; D - 0.5.<br>&nbsp;<br>&nbsp; WriterType::Pointer writer3 = WriterType::New();<br><br>&nbsp;<br>&nbsp; writer3-&gt;SetFileName("Final.dcm");<br>&nbsp;<br>&nbsp; writer3-&gt;SetInput(Dfinal);<br>&nbsp; writer3-&gt;Update();<br><br>[...]<br><br>Thanks for your time...<br><br><br>&gt; Date: Fri, 6 Aug 2010 08:32:35 -0700<br>&gt; From: volkovych@gmail.com<br>&gt; To: insight-users@itk.org<br>&gt; Subject: Re: [Insight-users] itkDifferenceImageFilter: Comparison between        two images<br>&gt; <br>&gt; <br>&gt; Could you put here the corresponding part of your code?<br>&gt; It's hard to analyze the reason without any code.<br>&gt; Sergiy.<br>&gt; -- <br>&gt; View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itkDifferenceImageFilter-Comparison-between-two-images-tp5380586p5381029.html<br>&gt; Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>&gt; _____________________________________<br>&gt; Powered by www.kitware.com<br>&gt; <br>&gt; Visit other Kitware open-source projects at<br>&gt; http://www.kitware.com/opensource/opensource.html<br>&gt; <br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; http://www.kitware.com/products/protraining.html<br>&gt; <br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; http://www.itk.org/Wiki/ITK_FAQ<br>&gt; <br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; http://www.itk.org/mailman/listinfo/insight-users<br>                                               </body>
</html>