[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rotate an image using objects




We try to do geometric transformation a 2D flat image (e.g
findgen(128,128)) including in a model.
It works fine with the translation (mymodel->Translate) and scaling
(mymodel->Scale) but
it doesn't for the rotation (mymodel-> rotate). Our goal is to rotate
the image at the center of image.

See the above code.

Anyone has an idea why it doesn't work.

Thank you

pro test

mywindow = obj_new('IdlgrWindow', dimensions=[512,512])
myview = obj_new('IDLgrView', view=[-256,-256,512,512])
mymodel = obj_new('IDLgrModel')
image=findgen(128,128)
myimage = obj_new('idlgrimage', image)
myImage->SetProperty, Location=[-64,-64]
myview-> Add, mymodel
mymodel-> Add, myimage
mymodel-> rotate, [0,0,1], 5                 ; DO NOT WORK
mymodel-> translate, -10, -10, 0.0        ; WORK
mywindow -> Draw, myview

end

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Daniel Sage
Swiss Federal Institute of Technology Lausanne (EPFL)
Biomedical Imaging Group (BIG)

Addr.: EPFL, DMT/IOA, BM-Ecublens, CH-1015 Lausanne, Switzerland
Tel  : +41 21 693 5189
Fax  : +41 21 693 3701
Email: daniel.sage@epfl.ch
Url  : http://bigwww.epfl.ch/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-