-
Couldn't load subscription status.
- Fork 22
Description
Hi everyone,
At the moment I’m working on a master thesis, which topic is connected with biomedical image processing. I am writing to you regarding an issue that I am experiencing with the JuliaImages library.
The error occurs during the construction of a graph from a segmented image obtained by computing the watershed algorithm.
My Julia code processes high-resolution histological images, whose size can range from 30 MB to 1.8 GB. The error that is generated is an Out Of Memory error and it occurs after about 10 minutes from the beginning of the graph construction process. I have 128 GB of memory + 8 GB of Swap available, is there a possible solution to overcome the problem and generate the graph without the risk of OOM?
To try to reduce the chances of OOM, I modified the "region_adjacency_graph" function by removing the parts related to edge weights and consequently also the function for calculating weights. Nevertheless, the OOM scenario still occurs.
Below are the lines of code I use to segment the image and build the graph:
img = ImageMagick.load_(svs_image) # load image
bw = Gray.(img) .> 0.21
dist = 1 .- distance_transform(feature_transform(bw))
markers = label_components(dist .< -0.00001)
segments = watershed(dist, markers)
weight_fn(i,j) = euclidean(segment_pixel_count(segments,i), segment_pixel_count(segments,j)) #not used
G, vert_map = region_adjacency_graph(segments)
For further information regarding the structure of the images to be segmented (svs_image), I am leaving the link to the package: https://github.com/niccolo99mandelli/JHistint.jl/tree/main/output_example. The image can be found in the "output_example" folder under the name "SlideExample.tif.
Thank you for your attention in advance.
Niccolò Mandelli, University of Milano-Bicocca