Skip to content

Commit

Permalink
Update label position in graph
Browse files Browse the repository at this point in the history
  • Loading branch information
niccolo99mandelli committed Oct 8, 2023
1 parent d0cc556 commit 4045dd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/graphManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ representing the positions of the vertices in `G`.
function extract_vertex_position(G::MetaGraph)
position_array = Luxor.Point[]
for v in Graphs.vertices(G)
s = get_prop(G, v, :position_label)
s = get_prop(G, v, :centroid)
coordinates_str = match(r"\((.*)\)", string(s)).captures[1]
coordinates = parse.(Int, split(coordinates_str, ", "))
x, y ,z = coordinates
Expand Down
14 changes: 7 additions & 7 deletions src/segmentationManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function apply_segmentation_with_download(slide_info::Tuple{String, Vector{UInt8
filepath_img_graph_edges = replace(slide_info[3], r"....$" => "_graph_edges.png")
save(filepath_seg_png, masked_colored_labels)
img_graph = Luxor.readpng(filepath_background)
w = img_graph.width
h = img_graph.height
w = img_graph.Images.width
h = img_graph.Images.height
g_meta = J_Space.spatial_graph(filepath_dataframe_edges, filepath_dataframe_labels)
# Image with Vertices
@png begin
Expand Down Expand Up @@ -249,7 +249,7 @@ function apply_segmentation_SOPHYSM_tessellation(filepath_input::AbstractString,
# build tessellation
filepath_total_tess = replace(filepath_output, r"....$" => "_total_tessellation.png")
filepath_cell_tess = replace(filepath_output, r"....$" => "_cell_tessellation.png")
df_edges, edges = build_graph_from_grid(df_labels, df_noisy_labels, df_total_labels, width, height, filepath_total_tess, filepath_cell_tess)
df_edges, edges = build_graph_from_tessellation(df_labels, df_noisy_labels, df_total_labels, width, height, filepath_total_tess, filepath_cell_tess)
# save dataframe label as .CSV
filepath_dataframe_labels = replace(filepath_output, r"....$" => "_dataframe_labels.csv")
CSV.write(filepath_dataframe_labels, df_labels)
Expand All @@ -273,8 +273,8 @@ function apply_segmentation_SOPHYSM_tessellation(filepath_input::AbstractString,
filepath_img_graph_vertex = replace(filepath_output, r"....$" => "_graph_vertex.png")
filepath_img_graph_edges = replace(filepath_output, r"....$" => "_graph_edges.png")
img_graph = Luxor.readpng(filepath_background)
w = img_graph.width
h = img_graph.height
w = img_graph.Images.width
h = img_graph.Images.height
g_meta_labels = J_Space.spatial_graph(filepath_dataframe_edges, filepath_dataframe_labels)
g_meta_total_labels = J_Space.spatial_graph(filepath_dataframe_edges, filepath_dataframe_total_labels)
# Image with Vertices
Expand Down Expand Up @@ -381,8 +381,8 @@ function apply_segmentation_SOPHYSM_graph(filepath_input::AbstractString,
filepath_img_graph_edges = replace(filepath_output, r"....$" => "_graph_edges.png")
save(filepath_seg_png, masked_colored_labels)
img_graph = Luxor.readpng(filepath_background)
w = img_graph.width
h = img_graph.height
w = img_graph.Images.width
h = img_graph.Images.height
g_meta = J_Space.spatial_graph(filepath_dataframe_edges, filepath_dataframe_labels)
# Image with Vertices
@png begin
Expand Down

0 comments on commit 4045dd2

Please sign in to comment.