<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. I've had trouble finding documentation on this, either in ITK or VTK. 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. 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. My operations to combine the two images are failing. I think the problem is the <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">SubtractConstantFromImageFilter. </span>I've checked the output and it looks like the constant is not being subtracted. The input to this filter is an image with a value of 0 for the background and 255 for the object. I'd like to change these to 0 and 1. The pixel type is unsigned char. 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->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->SetInput( imageInverter->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->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. Am I missing something simple? </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>