Simplify

Using the Ramer–Douglas–Peucker algorithm, one can simplify morphologies like:

morph-tool simplify --epsilon .5 C010306C.h5 C010306C-simple.h5

This will reduce the number of segments the morphology:

$ h5ls -r C010306C.h5
/                        Group
/metadata                Group
/points                  Dataset {2820, 4}
/structure               Dataset {107, 3}

$ h5ls -r C010306C-simple.h5
/                        Group
/metadata                Group
/points                  Dataset {627, 4}
/structure               Dataset {107, 3}

An image difference shows that all the sections have changed:

_images/simplify-diff.png

But the difference isn’t extremely obvious by the human eye:

_images/simplify-diff.gif