function c1 = calc_indices2(file_name, uid, fieldid)

       	mainPath = strcat(uid, "/");
mainPath = strcat(mainPath,fieldid);
        mask_file_name = strcat(uid,"/");
        mask_file_name = strcat(mask_file_name,"mask_img.png");
        mask_image = imread(mask_file_name);
        index_image = imread(file_name)
        
	mask_image = single(mask_image);
	size_mask_img = size(mask_image)
        unmarked_pixels = 0;
        mask_pixels = 0;
        index_val =0
        for i = 1:size_mask_img(1)
                for j = 1:size_mask_img(2)
                        if mask_image(i,j) ==1
                            mask_pixels = mask_pixels + 1
                            if index_image(i,j,1) == 171 && index_image(i,j,2) == 5 && index_image == 53
                                index_val = index_val + 0.1
                            elseif index_image(i,j,1) == 234 && index_image(i,j,2) == 79 && index_image == 59
                                index_val = index_val + 0.2
                            elseif index_image(i,j,1) == 247 && index_image(i,j,2) == 136 && index_image == 90
                                index_val = index_val + 0.3
                            elseif index_image(i,j,1) == 251 && index_image(i,j,2) == 192 && index_image == 126
                                index_val = index_val + 0.4
                            elseif index_image(i,j,1) == 255 && index_image(i,j,2) == 240 && index_image == 181
                                index_val = index_val + 0.5
                            elseif index_image(i,j,1) == 230 && index_image(i,j,2) == 243 && index_image == 164
                                index_val = index_val + 0.6
                            elseif index_image(i,j,1) == 171 && index_image(i,j,2) == 5 && index_image == 53
                                index_val = index_val + 0.7
                            elseif index_image(i,j,1) == 171 && index_image(i,j,2) == 5 && index_image == 53
                                index_val = index_val + 0.8
                            elseif index_image(i,j,1) == 171 && index_image(i,j,2) == 5 && index_image == 53
                                index_val = index_val + 0.9
                            else
                                index_val = index_val + 0.9
                        end
                end
        end
        good_area = index_9+index_8+index_7+index_6
        avg_area = index_5+index_4+index_3
        bad_area = mask_pixels-(good_area+avg_area)
        index_value = (index_0*0.1+index_1*0.2+index_2*0.3 +index_3*0.4+index_4*0.5+index_5*0.6+index_6*0.7+index_7*0.8+index_8*0.9+index_9*1.0)/mask_pixels
        index_values = [round((index_value*100)) (index_0*100) (index_1*100) (index_2*100) (index_3*100) (index_4*100) (index_5*100) (index_6*100) (index_7*100) (index_8*100) (index_9*100) (mask_pixels*100) (good_area*100) (avg_area*100) (bad_area)];


        f_name = strcat(mainPath, "/IndexValues_")
        f_name = strcat(f_name,img_type);
        f_name = strcat(f_name,".csv");
        csvwrite(f_name,index_values)
        c1 = 0;
        %imwrite(new_index_image,file_name);
        return
end
