Edit: Version 1 using Nearest
I think Nearest can be put to good use here anyway. This one uses the idea (inspired by @DanielLichtblau) that you can carry useful information in a NearestFunction that is not relevant for the actual distance by scaling those values with a small factor, finding the nearest points/vectors and the re-scaling the stowaways. While this is not exact, it can be very useful if you want to use "mixed" vectors and still get the performance gained by repeated use of a NearestFunction (here together with timing information).
Slight reformatting (scaling time with small factor):
fixations2 = Flatten[#]*{1, 1, 2^-20} & /@ fixations;
adding a 0 for compatibility...
Disks2 = Insert[#, 0, 3] & /@ Disks;
here we go (NearestFunction nf is called with additional arguments {n, radius}):
nf = Nearest[fixations2];
hits = Map[#*{1, 1, 2^20} &,
nf[#[[1 ;; 3]], {Infinity, #[[-1]]}] & /@ Disks2, {2}][[All, All,
3 ]]
{{155}, {}, {}, {145}, {}, {160}, {}, {377, 130}}
Total /@ hits
{155, 0, 0, 145, 0, 160, 0, 507}
This should scale pretty well with larger samples.
Version 2 (straightforward)
Another, very simple version with a bit of pattern mumbo-jumbo for versatile use with different input types (will become slow for large sample numbers):
fixations = {{{20.3899, 14.8931}, 238}, {{27.0063, 18.8899},
428}, {{25.8113, 24.8679}, 377}, {{24.2579, 22.022},
106}, {{25.3208, 24.022}, 130}, {{21.739, 12.1792},
175}, {{29.2673, 8.88994}, 295}, {{30.3868, 17.6572},
160}, {{31.217, 22.6761}, 145}, {{22.9686, 20.6918},
155}, {{19.6321, 20.2704}, 145}};
Disks = {{22.8176, 19.9696, 0.974938}, {29.5314, 10.7197,
0.974938}, {17.5112, 19.7207, 0.974938}, {30.8997, 23.2454,
0.974938}, {28.0588, 6.09759, 0.974938}, {30.8524, 17.0661,
1.53205}, {21.0393, 10.7137, 1.53205}, {25.451, 25.1336, 1.53205}};
timeindisk[{{x_?NumericQ, y_?NumericQ}, time_}, {u_?NumericQ,
v_?NumericQ, r_?NumericQ}] :=
If[Norm[{x, y} - {u, v}] <= r, time, 0]
timeindisk[#, Disks[[1]]] & /@ fixations
{0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0}
Threaded over fixes:
timeindisk[fixes_List, {u_?NumericQ, v_?NumericQ, r_?NumericQ}] :=
timeindisk[#, {u, v, r}] & /@ fixes
timeindisk[fixations, Disks[[1]]]
{0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0}
Threaded over fixes and disks:
timeindisk[fixes_List, disks_List] := timeindisk[fixes, #] & /@ disks
times = timeindisk[fixations, Disks]
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 145,
0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0,
160, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 377, 0,
130, 0, 0, 0, 0, 0, 0}}
(* Time within disks: Total*)
Total /@ times
{155, 0, 0, 145, 0, 160, 0, 507}