Re: xroi with regions_in problem [message #94853 is a reply to message #94851] |
Tue, 07 November 2017 07:03   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den tisdag 7 november 2017 kl. 14:28:18 UTC+1 skrev Mats Löfdahl:
> Hi,
>
> I'm trying to use the regions_in keyword with xroi but it seems I can't make it work.
>
> The purpose is to have a pre-defined region of interest, that the user can move or size scale in the GUI.
>
> This call, without regions_in, works fine:
>
> IDL> xroi, dispim, regions_out = roi, /block
>
> But when I do
>
> IDL> xroi, dispim, regions_in = [roi_in], regions_out = roi, /block
>
> The display image (dispim) is not shown properly (I get just a black image) and the call is terminated with the error message:
>
> IDLGRMODEL::ADD: Argument 1 should be of class type IDLgrModel or IDLgrGraphic or IDL_Container
>
>
> If I repeat the call, the image is displayed nicely but I see no defined ROI in the ROI information window.
>
>
> The roi_in object is created like this:
>
> IDL> roi_in = OBJ_NEW('IDLanROI', X_in, Y_in)
>
> where X_in and Y_in define a rectangle:
>
> IDL> help,X_in,Y_in & print, X_in & print,Y_in
> X_IN LONG = Array[4]
> Y_IN LONG = Array[4]
> 35 65 65 35
> 35 35 65 65
>
> The roi_in object at least passes the simplest of tests but could probably be wrong anyway:
>
> IDL> roi_in -> getproperty, roi_xrange = xx & print, xx
> 35.000000 65.000000
>
> I'm using regions_in = [roi_in] because the documentation says it should be an array but regions_in = roi_in gives the same error.
>
> Any advice?
I should add that dispim is a 100 by 100 byte array, so the rectangle should be within bounds.
|
|
|