X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Oct 2010 07:56 PM by  anon
ENVI_GET_ROI_INFORMATION, about the parameter of NL and NS
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:17
New Member


--
06 Oct 2010 07:56 PM
    Hi, everybody, I want to retrive the NL and NS of ROI, the following is the description information of ENVI_GET_ROI_INFORMATION function that got from ENVI help. ENVI_GET_ROI_INFORMATION, ROI_IDS [, /LONG_NAME] [, NL=variable] [, NPTS=variable] [, NS=variable] [, ROI_COLORS=variable] [, ROI_NAMES=variable] [, /SHORT_NAME ] NL (optional) Use this keyword to specify a named variable containing the number of lines associated with the desired ROIs. NS (optional) Use this keyword to specify the number of samples associated with the desired ROIs. However, In my program, the returned NL and NS were not from the ROI but the orginal image? It sames as the NL and NS of orginal image, the other parameters such as NPTS was fine. I don't know this was my misunderstanding or a bug of this function. Thank you.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    07 Oct 2010 08:24 AM
    NS and NL are the samples and lines from the image that the ROIs are associated with, not the ROI itself. An actual ROI could have a variable number of lines and samples due to its shape.

    Deleted User



    New Member


    Posts:17
    New Member


    --
    07 Oct 2010 07:46 PM
    Thank you for your replying. However, I want to know how to get the minimize rect of ROI when I subset a image, otherwise, the subseted image has same dimension with the orgin image. Here is my codes. ... ENVI_GET_ROI_INFORMATION,roi_ids[0],NL=nl,NPTS=npts,NS=ns,ROI_NAMES=roiname dims= [-1,0,ns-1,0,nl-1] ;The ns and nl is not from ROI but the image. maskfile = ENVI_PICKFILE(TITLE='Set ROI Mask File',DEFAULT=defaultPath+'testData\maskfile.img',/OUTPUT) class_values = LINDGEN(N_ELEMENTS(roi_ids))+1 ; Create Mask file ENVI_DOIT, 'ENVI_ROI_TO_IMAGE_DOIT', FID=fid, ROI_IDS=roi_ids, OUT_NAME=maskfile, CLASS_VALUES=class_values ENVI_OPEN_FILE,maskfile,R_FID=m_fid ;ENVI_FILE_QUERY,FID=m_fid,NB=m_nb m_pos=[0] ; Subset image, the output dimension is same as the orgin file. outputimg = ENVI_PICKFILE(TITLE='Set Subset Image File',DEFAULT=defaultPath+'testData\subset.img',/OUTPUT) ENVI_MASK_APPLY_DOIT, FID = fid, POS = pos, DIMS = dims, $ M_FID = m_fid, M_POS = m_pos, VALUE = -999, OUT_NAME = outputimg, $ IN_MEMORY = 0, R_FID = r_fid ...
    You are not authorized to post a reply.