function c1 = calc_indices2(uid,fieldid,img_type)

        file_name = strcat("IndexValues_",img_type);
        file_array = csvread(filename);
        mask_file_name = strcat(uid,"/");
        mask_file_name = strcat(mask_file_name,"mask_img.png");
        mask_image = imread(mask_file_name);
        %mask_image = imresize(mask_image,[600 600]);
        size_index = size(file_array);
        size_mask_img = size(mask_image);
        index_0 = 0;
        index_1 = 0;
        index_2 = 0;
        index_3 = 0;
        index_4 = 0;
        index_5 = 0;
        index_6 = 0;
        index_7 = 0;
        index_8 = 0;
        index_9 =0;
        good_area = 0;
        avg_area = 0;
        bad_area = 0;
        unmarked_pixels = 0;
        mask_pixels = 0;
        for i = 1:size_index(1)
                for j = 1:size_index(2)
                        if mask_image(i,j) ==1
                                mask_pixels = mask_pixels+1;
				if file_array(i,j) < 0.1
					index_0 = index_0 + 1;
				elseif file_array(i,j) >=0.1 && file_array(i,j) < 0.2
					index_1 = index_1 + 1;
				elseif file_array(i,j) >=0.1 && file_array(i,j) < 0.2
                                        index_2 = index_2 + 1;
				elseif file_array(i,j) >=0.2 && file_array(i,j) < 0.3
                                        index_3 = index_3 + 1;
				elseif file_array(i,j) >=0.3 && file_array(i,j) < 0.4
                                        index_4 = index_4 + 1;
				elseif file_array(i,j) >=0.4 && file_array(i,j) < 0.5
                                        index_5 = index_5 + 1;
				elseif file_array(i,j) >=0.5 && file_array(i,j) < 0.6
                                        index_6 = index_6 + 1;
				elseif file_array(i,j) >=0.6 && file_array(i,j) < 0.7
                                        index_7 = index_7 + 1;
				elseif file_array(i,j) >=0.7 && file_array(i,j) < 0.8
                                        index_8 = index_8 + 1;
				else
					index_9 = index_9 + 1;
				end
			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("IndexValues_",img_type);
        f_name = strcat(f_name,".csv");
        csvwrite(f_name,index_values);
        c1 = 0;
        %imwrite(new_index_image,file_name);
        return
end
           
