<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I'm attempting to overlay an image with color. &nbsp;I've had trouble finding documentation on this, either in ITK or VTK. &nbsp;The way I'm going about it is to scale the values of the image down and then use the add image filter to add the labels on top. &nbsp;I could then use VTK to create a corresponding colormap.</div><div><br></div><div>However, I'm getting stuck on something that should be very simple. &nbsp;My operations to combine the two images are failing. &nbsp;I think the problem is the&nbsp;<span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">SubtractConstantFromImageFilter. &nbsp;</span>I've checked the output and it looks like the constant is not being subtracted. &nbsp;The input to this filter is an image with a value of 0 for the background and 255 for the object. &nbsp;I'd like to change these to 0 and 1. &nbsp;The pixel type is unsigned char. &nbsp;I use the following:</div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>SubFilterType::Pointer subFilter = SubFilterType::New();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>InputPixelType subValue = <span style="color: #1c00cf">254</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>subFilter-&gt;SetConstant(subValue);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>subFilter-&gt;SetInput( imageInverter-&gt;GetOutput() );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>subFilter-&gt;Update();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">But the output image is still 0 - 255. &nbsp;Am I missing something simple? &nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Also, is there a better way to accomplish this task, or any examples showing something similar?</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Thanks,</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Sara</span></font></div></span></div></body></html>