[vtkusers] How to get a complement image?

Chen Fu novalet at yahoo.com.cn
Thu Apr 24 01:28:44 EDT 2003


Hi!
Is there any filter in vtk for a complement image? i
mean turn black to white and white to black.

I try to test it by using vtkImageMathematics twice.
My tcl code list below:

================================================
package require vtk

vtkTIFFReader reader1
reader1 SetFileName d:/chenfu/pearlite.tif

vtkImageCast cast
cast SetOutputScalarTypeToInt
cast SetInput [ reader1 GetOutput]

vtkImageMathematics math
math SetOperationToAddConstant
math SetConstantC -255
math SetInput1 [cast GetOutput]

vtkImageMathematics math2
math2 SetOperationToAbsoluteValue
math2 SetInput1 [math GetOutput]

vtkImageViewer2 viewer
viewer SetInput [ math2 GetOutput ]
viewer Render

wm withdraw .
===========================================

The algorithm first substract the original image by
255, then have a abs operation. Is it the right way?

Any idea?


=====
Remote Scensing Satellite Ground Station
Chinese Academy of Science

_________________________________________________________
Do You Yahoo!? 
下载免费即时聊天软件“雅虎通”感受动感聊天魅力,赶快用你的雅虎电邮帐号登陆吧~
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com/



More information about the vtkusers mailing list