X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 22 Feb 2015 01:51 AM by  anon
error with Texture_Cooccur_Doit
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
22 Feb 2015 01:51 AM
    I am building an IDL script to calculate several co-occurrence texture measures and keep getting this error: % Attempt to subscript METHOD with is out of range. % Execution halted at: TEXTURE_COOCCUR_DOIT 311 % ENVI_DOIT 3130 % $MAIN$ The input file is a single band of SAR intensity data. Note that when I use an example code from ENVIPROGRAMGENERATOR or for example the online manual for the ADAPTIVE_FILTER, the examples work find but when I change to Texture_Cooccur_Doit and replicate all the syntax it fails. ***PROGRAM*** pro MGH_texture compile_opt IDL2 on_error, 2 ; General error handler Catch, error if (error ne 0) then begin Catch, /CANCEL if obj_valid(envi) then $ envi.ReportError, "Error: " + !error_state.msg message, /RESET return endif e=envi(/current) if e eq !null then begin e=envi() must_exit = 1B endif else must_exit = 0B envi, /restore_base_save_files ; Launch the application e = ENVI() infile = envi_pickfile(title='Select one input files') if (infile[0] eq '') then return f_count = n_elements(infile) base = widget_auto_base(title='Output parameters') wo = widget_outf(base, uvalue='outd', /auto, /directory, default=' ', $ prompt='Select output DIRECTORY') ; open input file and gather necessary parameters infile = e.OpenRaster(infile) FID = ENVIRasterToFID(infile) envi_file_query, FID, ns=ns, nl=nl, r_fid = fid, dims=dims, nb=nb ; run the Co-Occurance Texture program envi_doit, 'Texture_Cooccur_DoIt', $ FID=fid, $ R_fid=R_fid, $ dims=dims, $ Method=1, $ direction=[1,1], $ pos=Lindgen(nb), $ KX=3, $ KY=3, $ G_levels=64, $ out_Bname ='variance', $ out_name = 'test.dat' ;clean up / close memory files envi_file_mng, id=fid, /remove print, 'Done: ', systime() end

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    23 Feb 2015 06:24 AM
    The error states it is with the METHOD keyword, which according to the help is an 8-element array: METHOD Use this keyword to specify an eight-element array of integers indicating which texture measure to compute. METHOD[0]: Compute the co-occurrence mean METHOD[1]: Compute the co-occurrence variance METHOD[2]: Compute the co-occurrence homogeneity METHOD[3]: Compute the co-occurrence contrast METHOD[4]: Compute the co-occurrence dissimilarity METHOD[5]: Compute the co-occurrence entropy METHOD[6]: Compute the co-occurrence second moment METHOD[7]: Compute the co-occurrence correlation This means you have to set each method with a 0 or 1 for 'off' or 'on'.

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Feb 2015 01:58 PM
    Fantastic, I didn't notice that. The Devil's in the details... Thank you.
    You are not authorized to post a reply.