<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">Hi David,</div></div><div class="im">
<br>
You must get the output and pass it back.<br>
If you want to disconnect the output from the pipeline use<br>
image-&gt;DisconnectPipeline();<br>
<br>
Try this:<br>
<br>
void ApplyThresholding(ImageType::Pointer &amp;image)<br>
{<br>
  typedef itk::BinaryThresholdImageFilter &lt;ImageType, ImageType&gt;<br>
          BinaryThresholdImageFilterType;<br>
<br>
  BinaryThresholdImageFilterType::Pointer thresholdFilter<br>
          = BinaryThresholdImageFilterType::New();<br>
  thresholdFilter-&gt;SetInput(image);<br>
  thresholdFilter-&gt;SetLowerThreshold(10);<br>
  thresholdFilter-&gt;SetUpperThreshold(50);<br>
  thresholdFilter-&gt;SetInsideValue(255);<br>
  thresholdFilter-&gt;SetOutsideValue(0);<br>
  thresholdFilter-&gt;InPlaceOn();<br>
  thresholdFilter-&gt;Update();<br>
  image = thresholdFilter-&gt;GetOutput();<br>
  // OPTIONAL:<br>
  // image-&gt;DisconnectPipeline();<br>
}<br>
<br>
PS: I am not 100% sure if this is the &quot;best practice&quot;.<br>
<br>
Hope that helps,<br>
Markus<br></div></blockquote><div><br></div>Hi Markus,<div><br></div><div>You are right, if I change the function signature to pass the &#39;image&#39; pointer by reference:</div><div><br></div><div>void ApplyThresholding(ImageType::Pointer &amp;image)</div>
<div><br></div><div>and then assign &#39;image&#39; to the pointer that is the output of the filter:</div><div><br></div><div>image = thresholdFilter-&gt;GetOutput();</div><div><br></div><div>the thresholded image is displayed. However, this works whether or not InPlaceOn has been called. What this has done is simply change &#39;image&#39; in the calling function to point to a different image, rather than modify the image that &#39;image&#39; was pointing to originally.</div>
<div><br clear="all">Can anyone clarify the idea/usage of the InPlaceOn option?<br><br></div><div>Thanks,</div><div><br></div><div>David</div></div></div>