-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfish_visualization.jl
30 lines (28 loc) · 931 Bytes
/
fish_visualization.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Fish Visualization
using Serialization, FileIO, JLD2
using BoxTrees, TileTrees, TileTreesGUI, ImageView
using Images
if Sys.isapple()
tree_path = "/Volumes/Seagate_Backup_Binxu/stitched1/segment_tree.jld2"
img_path = "/Volumes/Seagate_Backup_Binxu/stitched.nhdr"
elseif Sys.iswindows()
img_path = "D:\\stitched1\\stitched.nhdr"
tree_path = "D:\\stitched1\\segment_tree.jld2"
elseif Sys.islinux()
img_path = "/mnt/binxu001/stitched.nhdr"#"F:\\stitched.nhdr"
tree_path = "/mnt/binxu001/stitched1/segment_tree.jld2"
end
#---
img = load(img_path);
using Makie
scene = Scene()
#plot the space inside
rx = 1:size(img,1) * 0.65
ry = 1:size(img,2) * 0.65
rz = 1:size(img,3) * 5
mat = 100*img.data[:,:,:,10000]#[(x.^2 + y.^2 + z.^2) for x = r, y = r, z = r]
mat2 = mat .* (mat .> 0.25)
volume(rx, ry, rz, 5* mat2, algorithm = :absorptionrgba)
scene2 = scene()
plotly()
histogram(collect(Iterators.flatten(mat)))