Out of Sample Extension
First, create a folder for the extension sample, we’ll call it OoSE folder and prepare the data:
- Run
1-ImageSegmentationFull > Run_CellSegmentation.mand select the OoSE folder as your Analysis folder - Either correct data manually, using
Inspect Datafor allImageStacksXXX.matand run1-ImageSegmentationFull > MakeBigStructs.mor continue without inspection and run1-ImageSegmentationFull > MakeBigStructsWithoutManual.m.
Secondly, run 6-OoSE > generate_OoSe_distMatrix_new. Choose Analysis and OoSE folders. Choose one of the embedding methods: K Nearest Neighbours or Laplacian Pyramids. If using K nearest neighbours enter the value of K in the box below. This value is ignored for the Laplacian Pyramids method. Click Start OOSE. 
After correctly finishing, there will be new files in the OOSE folder:
- Dist_mat.mat
- OoSE_embedding.mat
- LP_trained.mat (if the Laplacian Pyramids method was used)
To compare the OOSE sample within the shape parameters and cluster parameters of say the control sample, run 6-OoSE > createBargraphs.m. Before running this step you must have previously run 5-Extended_Affinity_Propagation > Run_Affinity_Propagation.m for the reference sample (Analysis folder)

For clusters, select the best numbers from the reference (Analysis) sample. The new subset will be plotted in shape space using the two most distinctive features for x- and y-axis from the larger sample in Analysis. The sample in the Analysis folder is used as ‘reference’ clusters and compared to the extension sample.

Bar graphs for clusters with absolute numbers

Shape space with reference dots in grey and sample extension in colour

Extension shapes in full circles and reference shapes in empty circles.
Note: All Figures are saved within a Figures folder in the in OoSE folder and the values for the bar graphs are written to CSV files.