Perhaps you could try to combine the focus stacking and focus peak features (this is just some wild idea):
Use the focus stacking feature to create a series of shots with different focusing distances. For each image in the stack, focused areas should correspond to zones in the scene that share the same distance to the camera (the focusing distance). Then, you could use the focus peak feature to grab those focused areas from each image, assign a proper grayscale color to each one, and merge them.
For a quick and dirty experiment, you do not need any modifications to ML, you can do most of the heavy work outside of the camera:
First, choose a nice scene, do a focus stack, and copy all the files to your computer. Then use
enfuse to make a
contrast-based fusing, and save all the masks; finally, use PS / GIMP / ... to combine those masks.
Just my two cents.