cgImage trim [message #92287] |
Wed, 11 November 2015 00:10  |
amin farhang
Messages: 39 Registered: November 2010
|
Member |
|
|
Dear all,
I have an image in a specific range like bellow:
cgDisplay, 500, 500
cgplot,dist(200),xrange=[-300,300],yrange=[-300,300],/nodata
cgImage, cgDemoData(5), CTIndex=33,AlphaFGPos=[0.128, 0.126, 0.925,0.9],Transparent=20
How could i only display the region between xrange=[-100,100] and yrange=[-100,100]? i.e. the axis range show above ranges and image automatically zoom in that region?
Best regards,
|
|
|
Re: cgImage trim [message #92289 is a reply to message #92287] |
Wed, 11 November 2015 05:43   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Amin Farhang writes:
>
> Dear all,
>
> I have an image in a specific range like bellow:
>
> cgDisplay, 500, 500
> cgplot,dist(200),xrange=[-300,300],yrange=[-300,300],/nodata
> cgImage, cgDemoData(5), CTIndex=33,AlphaFGPos=[0.128, 0.126, 0.925,0.9],Transparent=20
>
> How could i only display the region between xrange=[-100,100] and yrange=[-100,100]? i.e. the axis range show above ranges and image automatically zoom in that region?
You determine which image indices correspond to those axis values and
subset your image appropriately. I like to use Value_Locate, usually in
conjunction with cgScaleVector, to determine the image indices
associated with particular values.
http://www.idlcoyote.com/code_tips/valuelocate.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|