geometry - Dividing complex shapes into contiguous sub-shapes in MATLAB -


i have 3d shape loaded matlab 3d matrix. matrix large, e.g. 250x250x250. shape defined within matrix numbers >0 <=1, positive numbers in matrix "shape", , zeros "non-shape". shape contiguous. simplified (8x8) example of 1 plane of such shape shown in below:

0  0  0  0  0  0  0  0 0  0  1 .5 .1 .2  1  0 0  0  0  0  0 .3  0  0 0  0 .2 .3  1  1  1  1 0  0  0 .8  1  0  0  0 0 .2 .1  1  0  1  0  0 0 .1 .9 .9 .9  0  0  0 0  0  0  0  0  0  0  0 

i need split shape 2 sub-shapes sum of values of 2 sub-shapes equal, , 2 sub-shapes contiguous. valid division [n.b. zeros replaced '.' visual clarity]:

.  .  .  .  .  .  .  . .  .  b  b  b  b  b  . .  .  .  .  .  b  .  . .  .    b  b  b  b .  .  .    .  .  . .     .   .  . .      .  .  . .  .  .  .  .  .  .  . 

but following division invalid because not of values in sub-shape b can directly joined each other.

.  .  .  .  .  .  .  . .  .  b  b  b    . .  .  .  .  .   .  . .  .  b  b     .  .  .  b   .  .  . .  b  b  b  .   .  . .  b  b  b  b  .  .  . .  .  .  .  .  .  .  . 

my real-world example in 3 dimensions , larger. ideas how divide shape 2 contiguous sub-shapes. extension, how can divide 3 contiguous sub-shapes if wanted to, again sum of values in sub-shapes approximately equal?


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -