diff --git a/RunExample2.m b/RunExample2.m new file mode 100755 index 0000000000000000000000000000000000000000..09e9f61b2d8914fd98d3902d018914166d08a235 --- /dev/null +++ b/RunExample2.m @@ -0,0 +1,55 @@ +%% Example de-projection script, using a cell result structure and a mesh. + +%% Clear all. + +close all +clear +clc + +%% Parameters, scripts and files location. + +% Add DeProj functions to the path. +addpath('./src') + +% Where are the images. +root_folder = 'samples'; + +% The segmentation results. Here we use the results from Y. Bellaiche lab +% analysis software. The results must contain a CELL, FRAME, VERTICES and +% SIDES structures. +segmentation_filename = 'SIA_161210_gfapnlsg_Backup_001.mat'; + +% The tissue surface mesh. It must be a mesh mapping the tissue surface, +% openedd at the tissue borders. +mesh_filename = 'SimplifiedMesh.ply'; + +% The physical unit of length must be specified (not stored elsewhere). +units = 'µm'; + +%% Read files. + +% Segmentation results. +fprintf('Opening segmentation file: %s\n', segmentation_filename ) +seg = load( fullfile( root_folder, segmentation_filename ) ); + +% Path to mesh file. +mesh_file_path = fullfile( root_folder, mesh_filename ); + +%% Create deproj instance. + +dpr = deproj.from_bellaiche( ... + seg.CELLS, ... + seg.FRAME, ... + seg.SIDES, ... + seg.VERTICES, ... + mesh_file_path, ... + units ); + +%% Plot morphological parameters. + +close all +plot_sizes( dpr ); +plot_fit_plane( dpr ); +plot_fit_ellipse( dpr ); +plot_curvatures( dpr ); +plot_distorsions( dpr );