Grouping the Nonzero Elements of an NxNxN Matrix

  • Follow


Hello,

I have an  NxNxN matrix the elements of which is either zero or one. For example in the 2x2x2 case,


N(1,1,1)=1
N(1,1,2)=0
N(1,2,1)=0
N(1,2,2)=0
N(2,1,1)=0
N(2,1,2)=0
N(2,2,1)=0
N(2,2,2)=1

I am trying to group the neighbouring elements which are '1'. For the matrix above

N(1,1,1) and N(2,2,2) are nonzero and they are the neighbor of each other. So the output should be two distinct matrices, the first matrix should carry the indices (1,1,1) and the second matrix (2,2,2).

Does anyone know of an algorithm which carries out this operation?
0
Reply Ahmet 6/12/2010 4:34:05 PM


0 Replies
449 Views

(page loaded in 0.013 seconds)

Similiar Articles:













7/22/2012 12:19:41 PM


Reply: