I have a set of 3D data points on a cubic grid. The data can be downloaded from here https://skydrive.live.com/redir?resid=F96524B72DCD75FB!14240 and read into a variable lis using
lis = ReadList["filename", {Number, Number, Number}].
How can one cluster the points into groups such that the points in each group are related by the fact that they are only one grid point away from their nearest neighbor in all directions (taking periodic boundaries in all directions into account). By all directions I mean the six faces of a cube. The EuclideanDistance between grid points is 0.055089 .
Here is a plot of the data (well solution, see below).

Actually, I was able to solve this problem using object-oriented programming in C#, but I've come up short trying to reproduce it in Mathematica. I've tried a combination of FindClusters and Nearest with no success. Any help will be much appreciated. I have tried to include as much information as I think is needed to solve this problem but if more information is needed I'll gladly provide it.
Note: In the plot above, I've removed groups that has less than 20 points.



EuclideanDistancein any direction. – RunnyKine Sep 20 '13 at 22:39ManhattanDistanceandModa fix? – Kuba Sep 20 '13 at 22:59