[Insight-users] Subtracting Images - A Possible Pixel-Type Issue

M. Wirtzfeld wirtzfeld at rogers.com
Sun Apr 27 11:29:29 EDT 2008


Hello all,

I am relative new to ITK, so bare with me...


I am working on a registration project and I would like to take the  
difference between an image slice and a resulting image taken from a  
volume after registration done.  In essence, a pixel-by-pixel  
subtraction.


The itk::SquaredDifferenceImageFilter is currently being used to  
determine the difference image.  However, when pixel-values are  
reviewed in the resulting image, large negative values are found.  It  
is believed these negative values are due to the use of the SHORT  
data-type to represent the pixel-type.  The squared-operation of the  
filter obviously handles negative subtraction results;  likely to  
occur regardless of the order in which the two images are given to  
this filter.

Is the use of the SHORT data-type likely responsible for these  
negative pixel-values?  Changing the type is not an option.


Reading through the ITK Software Guide (Version 2.4), I came across  
the itk::SubtractImageFilter topic in Section 8.2, "Hello World"  
Registration, page 323.  In this section it says,


"... the use of subtraction as a method for comparing the images is  
appropriate here because we chose to represent the images using a  
pixel type float.  A different filter would have been used if the  
pixel type of the images were any of the unsigned integer type."



The difference is defined, with reference to respective class  
documentation, as "Output = Input1 - Input2" for the  
itk::SubtractImageFilter.  With this in mind, and the fact that the  
pixel-values across the entire image for "Input2" will likely not be  
less than the respective pixels in "Input1", can I directly apply the  
itk::SubtractImageFilter in this case?



Thank you,

Michael.
Robarts Research.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080427/b746c3fa/attachment-0001.htm>


More information about the Insight-users mailing list