## Readme for code-4

This part of code is the multi-phase segmentation program.
It will automatically batch-process the decomposed mueller matrix data into multi-phase segmentations and related intermediate results.

1. Use the Reaction_phase_testing.m as the main function.
2. Update the file paths for input and output data; users can define if need.
3. Update the 'gj' to specify the ID of the decomposed mueller matrix data; users can define if need.
4. Apply data averaging if need.
5. Preprocess the matrix components with resize and filtering.
6. Detect the region of interest (ROI) for defining the physically meaningful data region.
7. The used matrix components and compunded physcial parameters/vectors (see SI and references) are fed into the Bubble_detect.m function; users may define different or extended input margins for further algorithm development.
8. During the phase detection stage, the pixels in the meaningful ROI, will be allocated to categories of solid, liquid, gas, and uncertain regions (see SI for more details).
9. Further differentiation of gas phases are then carried out after evaluating the polarization elements distribution in feature space.
10. Multi-phase segmentation results are then shown with a user-selected colorcoding and rendering and then be saved.
11. Futher phase rendering options and statistical analysis can be found in code-5 (the example results.pptx for more details).
