X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 22 Mar 2011 09:00 AM by  anon
"Array has too many elements" error
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
22 Mar 2011 09:00 AM
    Hello, I have the following lines in my code for calculation of mean values in a ROI in a 3-colour image: TV, I_disp, TRUE=1 ROI=CW_DEFROI(WG_Window_I, IMAGE_SIZE=[500,500], OFFSET=[0,0]) ROI_X=ROI MOD 500 ROI_Y=ROI/500 M=mean(I_disp[2, ROI_X, ROI_Y]) When I select a large ROI (2500 points) in a 500x500 image with CW_DEFROI, IDL returns an "Array has too many elements" error in the last line "M=mean(I_disp[2, ROI_X, ROI_Y])" I would appreciate if anyone could explain me why do I get this error and how to solve this problem without consuming too much computer memory. Alexander.

    Deleted User



    New Member


    Posts:
    New Member


    --
    31 Mar 2011 11:12 AM
    Hi Alexander, Maybe this is obvious, but have you checked already the defined size of the image array "I_disp", and see if it differs from the new values ROI_X, ROI_Y that you are trying to use in that array? Cheers, Fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Apr 2011 05:43 AM
    Hello Fernando, From ITTVIS support I understood, that the command "I_disp(2,ROI_X,ROI_Y)" actually makes a huge array instead of producing an array of length equal to number of points in ROI (length of ROI_X) - something I normally do not expect! The solution they proposed was to use "(I_disp(2,*,*))[ROI]" Kind regards, Alexander.
    You are not authorized to post a reply.