Commit 46e25fde authored by Jean-Yves TINEVEZ's avatar Jean-Yves TINEVEZ
Browse files

Use the mesh to specify the Z position in the from_bellaiche import.

parent 53c6289f
......@@ -3,7 +3,7 @@ function obj = from_bellaiche( ...
frame, ...
sides, ...
vertices, ...
voxel_depth, ...
mesh_file_path, ...
units )
%FROM_BELLAICHE Returns a deproj object built from the results of the tool
%from Yohannes Bellaiche lab.
......@@ -13,6 +13,17 @@ function obj = from_bellaiche( ...
width = frame.imageSize( 1 );
pixel_size = frame.scale1D;
%% Read the mesh file.
fprintf('Loading and processing the tissue mesh file.\n' )
tic
V = deproj.ply_read( mesh_file_path );
si = scatteredInterpolant( V(:,1), V(:,2), V(:,3), 'linear', 'nearest' );
fprintf('Loaded %d vertices in %.1f seconds.\n', size(V, 1), toc )
%% Build the junction graph.
tic
......@@ -25,23 +36,22 @@ function obj = from_bellaiche( ...
node_table = table();
jxy = vertices.XYs;
% TODO
jz = zeros( size( jxy, 1 ), 1 );
jz = si( jxy );
node_table.Centroid = [ jxy jz ];
node_table.ID = vertices.numbers;
junction_graph = graph( edge_table, node_table, 'omitselfloops' );
fprintf('Built the junction graph with %d nodes and %d edges in %.1f seconds.\n', ...
junction_graph.numnodes, junction_graph.numedges, toc )
junction_graph.numnodes, junction_graph.numedges, toc )
%% Convert YB structure to epicells.
fprintf('Converting to objects.\n' )
tic
n_cells = numel( cells.contour_indices );
fprintf('Computing morphological descriptors of %d objects.\n', n_cells-1 )
tic
% We don't go for the first one, which contains the contour of the tissue.
% Get boundary.
......@@ -57,8 +67,8 @@ function obj = from_bellaiche( ...
P = deproj.find_countour( P );
P = P * pixel_size;
% TODO
z = zeros( numel(x), 1 );
% Get Z from the mesh.
z = si( P );
boundary = [ P z ];
% Get the junction ids.
......@@ -70,8 +80,10 @@ function obj = from_bellaiche( ...
end
fprintf('Done in %.1f seconds.\n', toc )
obj = deproj( epicells, junction_graph, units );
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment