<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I am a complete itk/vtk noob. &nbsp;Please excuse the vague title, I am absolutely baffled as to exactly where my code is going wrong. &nbsp;For this reason, I am also unsure how to search the insight-users archive for similar issues (although I have tried). &nbsp;I admit, it's been a while since I was regularly coding in c++, so there is probably a very simple mistake somewhere. &nbsp;I am trying to do something I think is fairly simple and getting results I was not expecting. &nbsp;The code, input, and output screenshots are attached. &nbsp;I'm running this on a Mac (OS 10.8.4), with ITK version 4.4.1, VTK6.0.0. &nbsp;Here is a rundown of what I'm trying to do and what's unexpected.</div><div><br></div><div>The goal is to produce a vtkRenderWindow with 2 images as follows. &nbsp;</div><div>Image1:</div><div>1) loaded from jpeg as an rgb image</div><div>2) run through ImageToVTKImageFilter (with a flip filter to get the orientation right)</div><div>3) rendered and displayed (as the "raw" input data)</div><div><br></div><div>Image2:</div><div>1) loaded from jpeg as an rgb image</div><div>2) run through an RGBToLuminanceFilter</div><div>3) cast back into RGB with CastImageFilter</div><div>4) run through&nbsp;&nbsp;ImageToVTKImageFilter (with a flip filter to get the orientation right)</div><div>5) rendered and displayed (as the "processed" output data)</div><div><br></div><div>I expect that Image1 will look like the original jpg, while Image2 will just be a greyscale version of the original. &nbsp;This happens as expected when the input files contain different pictures (attached "GoodOutput.png"). &nbsp;However, if I load the same jpg file in step 1 for both images, then what I see is the expected (greyscale) output in the Image2 slot, and a flipped version of the greyscale image in the Image1 slot ("BadOutput.png"). &nbsp;This same result holds if I duplicate the file and pass in the two different (but identical) input files. &nbsp;Any idea where I have gone wrong? &nbsp;</div><div><br></div><div>I set this up as a simple test case, my ultimate goal is to extract an ROI from an RGB image, processing it as grayscale, then placing the result back into the original (color) image. &nbsp;If there is a better way to go about this, I'd love to know!</div><div><br></div><div>Thank you for your time,</div><div>-Rishi.</div><div><br></div><div></div></body></html>