Finished tabs and compare views, added file search to ease access to files, corrected minimal fixes
This commit is contained in:
parent
ddc690b659
commit
c92576d5a5
@ -2,7 +2,13 @@
|
||||
|
||||
julia_version = "1.11.2"
|
||||
manifest_format = "2.0"
|
||||
project_hash = "0eb77e47b715b07e9286c9a5bb8575a4c2a4963c"
|
||||
project_hash = "e84343a015a9b60e7e39a0605149974e3d8cf1e0"
|
||||
|
||||
[[deps.ATK_jll]]
|
||||
deps = ["Artifacts", "Glib_jll", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "a2ecb68d240333fe63bea1965b71884e98c2d0f0"
|
||||
uuid = "7b86fcea-f67b-53e1-809c-8f1719c154e8"
|
||||
version = "2.38.0+0"
|
||||
|
||||
[[deps.AbstractFFTs]]
|
||||
deps = ["LinearAlgebra"]
|
||||
@ -229,10 +235,10 @@ uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
|
||||
version = "0.7.6"
|
||||
|
||||
[[deps.ColorBrewer]]
|
||||
deps = ["Colors", "JSON", "Test"]
|
||||
git-tree-sha1 = "61c5334f33d91e570e1d0c3eb5465835242582c4"
|
||||
deps = ["Colors", "JSON"]
|
||||
git-tree-sha1 = "e771a63cc8b539eca78c85b0cabd9233d6c8f06f"
|
||||
uuid = "a2cac450-b92f-5266-8821-25eda20663c8"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
|
||||
[[deps.ColorSchemes]]
|
||||
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"]
|
||||
@ -647,6 +653,12 @@ git-tree-sha1 = "da121cbdc95b065da07fbb93638367737969693f"
|
||||
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
|
||||
version = "0.72.8+0"
|
||||
|
||||
[[deps.GTK3_jll]]
|
||||
deps = ["ATK_jll", "Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "FriBidi_jll", "Glib_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Libepoxy_jll", "Pango_jll", "Pkg", "Wayland_jll", "Xorg_libX11_jll", "Xorg_libXcomposite_jll", "Xorg_libXcursor_jll", "Xorg_libXdamage_jll", "Xorg_libXext_jll", "Xorg_libXfixes_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll", "Xorg_libXrender_jll", "at_spi2_atk_jll", "gdk_pixbuf_jll", "iso_codes_jll", "xkbcommon_jll"]
|
||||
git-tree-sha1 = "b080a592525632d287aee4637a62682576b7f5e4"
|
||||
uuid = "77ec8976-b24b-556a-a1bf-49a033a670a6"
|
||||
version = "3.24.31+0"
|
||||
|
||||
[[deps.GarishPrint]]
|
||||
deps = ["Configurations", "Preferences"]
|
||||
git-tree-sha1 = "41136d24cc02c4d7c2b8c8982823fedac66d0a45"
|
||||
@ -1213,6 +1225,12 @@ version = "1.11.0+1"
|
||||
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Libepoxy_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libX11_jll"]
|
||||
git-tree-sha1 = "7a0158b71f8be5c771e7a273183b2d0ac35278c5"
|
||||
uuid = "42c93a91-0102-5b3f-8f9d-e41de60ac950"
|
||||
version = "1.5.10+0"
|
||||
|
||||
[[deps.Libffi_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
|
||||
git-tree-sha1 = "27ecae93dd25ee0909666e6835051dd684cc035e"
|
||||
@ -1445,6 +1463,18 @@ git-tree-sha1 = "030ea22804ef91648f29b7ad3fc15fa49d0e6e71"
|
||||
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
|
||||
version = "1.0.3"
|
||||
|
||||
[[deps.NativeFileDialog]]
|
||||
deps = ["FilePathsBase", "NativeFileDialog_jll"]
|
||||
git-tree-sha1 = "6964c902c838b214cb4e8b4a94ca45e585c9d47b"
|
||||
uuid = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
|
||||
version = "0.2.1"
|
||||
|
||||
[[deps.NativeFileDialog_jll]]
|
||||
deps = ["Artifacts", "GTK3_jll", "JLLWrappers", "Libdl", "Pkg"]
|
||||
git-tree-sha1 = "916d2db66748820c8e8bc3329a2a23c42c1520de"
|
||||
uuid = "94d9ae2c-efc7-56f8-9a02-54c47b797961"
|
||||
version = "1.1.6+3"
|
||||
|
||||
[[deps.NaturalSort]]
|
||||
git-tree-sha1 = "eda490d06b9f7c00752ee81cfa451efe55521e21"
|
||||
uuid = "c020b1a1-e9b0-503a-9c33-f039bfc54a85"
|
||||
@ -1759,9 +1789,9 @@ uuid = "92933f4c-e287-5a05-a399-4b506db050ca"
|
||||
version = "1.10.2"
|
||||
|
||||
[[deps.PtrArrays]]
|
||||
git-tree-sha1 = "77a42d78b6a92df47ab37e177b2deac405e1c88f"
|
||||
git-tree-sha1 = "1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d"
|
||||
uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d"
|
||||
version = "1.2.1"
|
||||
version = "1.3.0"
|
||||
|
||||
[[deps.PyCall]]
|
||||
deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"]
|
||||
@ -2132,9 +2162,9 @@ weakdeps = ["DataFrames", "JSON", "OffsetArrays"]
|
||||
|
||||
[[deps.StipplePivotTable]]
|
||||
deps = ["Stipple", "StippleUI", "Tables"]
|
||||
git-tree-sha1 = "dcd4bb577152dd9945514e352d306a9dc89339a0"
|
||||
git-tree-sha1 = "02c29d8464f1c26f659d1aa94d69a986ecaafea4"
|
||||
uuid = "adab0226-ee3c-44de-8f2f-393b1bf1e936"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
|
||||
[[deps.StipplePlotly]]
|
||||
deps = ["DataFrames", "Genie", "Requires", "Stipple"]
|
||||
@ -2408,12 +2438,24 @@ git-tree-sha1 = "e9216fdcd8514b7072b43653874fd688e4c6c003"
|
||||
uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec"
|
||||
version = "1.0.12+0"
|
||||
|
||||
[[deps.Xorg_libXcomposite_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll"]
|
||||
git-tree-sha1 = "7c688ca9c957837539bbe1c53629bb871025e423"
|
||||
uuid = "3c9796d7-64a0-5134-86ad-79f8eb684845"
|
||||
version = "0.4.5+4"
|
||||
|
||||
[[deps.Xorg_libXcursor_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"]
|
||||
git-tree-sha1 = "807c226eaf3651e7b2c468f687ac788291f9a89b"
|
||||
uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724"
|
||||
version = "1.2.3+0"
|
||||
|
||||
[[deps.Xorg_libXdamage_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll"]
|
||||
git-tree-sha1 = "fe4ffb2024ba3eddc862c6e1d70e2b070cd1c2bf"
|
||||
uuid = "0aeada51-83db-5f97-b67e-184615cfc6f6"
|
||||
version = "1.1.5+4"
|
||||
|
||||
[[deps.Xorg_libXdmcp_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "89799ae67c17caa5b3b5a19b8469eeee474377db"
|
||||
@ -2456,6 +2498,12 @@ git-tree-sha1 = "a490c6212a0e90d2d55111ac956f7c4fa9c277a6"
|
||||
uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa"
|
||||
version = "0.9.11+1"
|
||||
|
||||
[[deps.Xorg_libXtst_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll", "Xorg_libXi_jll"]
|
||||
git-tree-sha1 = "0c0a60851f44add2a64069ddf213e941c30ed93c"
|
||||
uuid = "b6f176f1-7aea-5357-ad67-1d3e565ea1c6"
|
||||
version = "1.2.3+4"
|
||||
|
||||
[[deps.Xorg_libpthread_stubs_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "c57201109a9e4c0585b208bb408bc41d205ac4e9"
|
||||
@ -2539,12 +2587,36 @@ git-tree-sha1 = "622cf78670d067c738667aaa96c553430b65e269"
|
||||
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
|
||||
version = "1.5.7+0"
|
||||
|
||||
[[deps.at_spi2_atk_jll]]
|
||||
deps = ["ATK_jll", "Artifacts", "JLLWrappers", "Libdl", "Pkg", "XML2_jll", "Xorg_libX11_jll", "at_spi2_core_jll"]
|
||||
git-tree-sha1 = "f16ae690aca4761f33d2cb338ee9899e541f5eae"
|
||||
uuid = "de012916-1e3f-58c2-8f29-df3ef51d412d"
|
||||
version = "2.34.1+4"
|
||||
|
||||
[[deps.at_spi2_core_jll]]
|
||||
deps = ["Artifacts", "Dbus_jll", "Glib_jll", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXtst_jll"]
|
||||
git-tree-sha1 = "d2d540cd145f2b2933614649c029d222fe125188"
|
||||
uuid = "0fc3237b-ac94-5853-b45c-d43d59a06200"
|
||||
version = "2.34.0+4"
|
||||
|
||||
[[deps.fzf_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "6e50f145003024df4f5cb96c7fce79466741d601"
|
||||
uuid = "214eeab7-80f7-51ab-84ad-2988db7cef09"
|
||||
version = "0.56.3+0"
|
||||
|
||||
[[deps.gdk_pixbuf_jll]]
|
||||
deps = ["Artifacts", "Glib_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg", "Xorg_libX11_jll", "libpng_jll"]
|
||||
git-tree-sha1 = "e9190f9fb03f9c3b15b9fb0c380b0d57a3c8ea39"
|
||||
uuid = "da03df04-f53b-5353-a52f-6a8b0620ced0"
|
||||
version = "2.42.8+0"
|
||||
|
||||
[[deps.iso_codes_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "d837a5d2a19d54243dafb6cc98d0f590a603dfa1"
|
||||
uuid = "bf975903-5238-5d20-8243-bc370bc1e7e5"
|
||||
version = "4.15.1+0"
|
||||
|
||||
[[deps.isoband_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
|
||||
git-tree-sha1 = "51b5eeb3f98367157a7a12a1fb0aa5328946c03c"
|
||||
|
||||
@ -6,6 +6,7 @@ GenieFramework = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353"
|
||||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
|
||||
Libz = "2ec943e9-cfe8-584d-b93d-64dcb6d567b7"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
|
||||
NaturalSort = "c020b1a1-e9b0-503a-9c33-f039bfc54a85"
|
||||
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
|
||||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
|
||||
|
||||
114
app.jl
114
app.jl
@ -11,6 +11,7 @@ using Statistics
|
||||
using NaturalSort
|
||||
using Images
|
||||
using LinearAlgebra
|
||||
using NativeFileDialog
|
||||
@genietools
|
||||
|
||||
# == Code import ==
|
||||
@ -56,7 +57,7 @@ end
|
||||
# Interface non Variables
|
||||
@out warning_fr=""
|
||||
@out btnStartDisable=true
|
||||
@out btnPlotDisable = true
|
||||
@out btnPlotDisable=false
|
||||
@in warning_msg=false
|
||||
@in CompareDialog=false
|
||||
|
||||
@ -69,6 +70,7 @@ end
|
||||
@in triqColor=256
|
||||
|
||||
# Interface Buttons
|
||||
@in btnSearch=false # To search for files in your device
|
||||
@in mainProcess=false # To generate images
|
||||
@in CompareBtn=false # to open dialog
|
||||
@in createSumPlot=false # To generate sum spectrum plot
|
||||
@ -85,9 +87,12 @@ end
|
||||
@in ImgMinusT=false
|
||||
|
||||
#TABS
|
||||
@out tabIDs = ["tab0","tab1","tab2","tab3"]
|
||||
@out tabLabels = ["Image", "TrIQ", "2D Plot","3D Plot"]
|
||||
@out tabIDs=["tab0","tab1","tab2","tab3","tab4"]
|
||||
@out tabLabels=["Image", "TrIQ", "Spectrum Plot", "Topology Plot","Surface Plot"]
|
||||
@in selectedTab= "tab0"
|
||||
@out CompTabIDs=["tab0","tab1","tab2","tab3","tab4"]
|
||||
@out CompTabLabels=["Image", "TrIQ", "Spectrum Plot", "Topology Plot","Surface Plot"]
|
||||
@in CompSelectedTab= "tab0"
|
||||
|
||||
# Interface Images
|
||||
@out imgInt="/.bmp" # image Interface
|
||||
@ -124,7 +129,7 @@ end
|
||||
@out lastimg=0
|
||||
@out lastimgTriq=0
|
||||
|
||||
# Interface Plot 2d
|
||||
# Interface Plot Spectrum
|
||||
layoutSpectra=PlotlyBase.Layout(
|
||||
title="SUM Spectrum plot",
|
||||
xaxis=PlotlyBase.attr(
|
||||
@ -142,6 +147,24 @@ end
|
||||
@out plotdata=[traceSpectra]
|
||||
@out plotlayout=layoutSpectra
|
||||
|
||||
# Interface Plot Surface
|
||||
layoutContour=PlotlyBase.Layout(
|
||||
title="2D Topographic Map",
|
||||
xaxis=PlotlyBase.attr(
|
||||
title="X",
|
||||
showgrid=true
|
||||
),
|
||||
yaxis=PlotlyBase.attr(
|
||||
title="Y",
|
||||
showgrid=true
|
||||
)
|
||||
)
|
||||
# Dummy 2D surface plot
|
||||
traceContour=PlotlyBase.scatter(x=[], y=[], mode="lines")
|
||||
# Create conection to frontend
|
||||
@out plotdataC=[traceContour]
|
||||
@out plotlayoutC=layoutContour
|
||||
|
||||
# Interface Plot 3d
|
||||
# Define the layout for the 3D plot
|
||||
layout3D=PlotlyBase.Layout(
|
||||
@ -179,30 +202,24 @@ end
|
||||
# Reactive handlers watch a variable and execute a block of code when its value changes
|
||||
# The onbutton handler will set the variable to false after the block is executed
|
||||
|
||||
@onchange file_name begin
|
||||
msg = ""
|
||||
progress = false
|
||||
progressPlot = false
|
||||
try
|
||||
if contains(file_name,".imzML")
|
||||
warning_fr = ""
|
||||
full_route = joinpath( file_route, file_name )
|
||||
if isfile(full_route) # Check if the file exists
|
||||
btnPlotDisable = false
|
||||
btnStartDisable = false
|
||||
else
|
||||
warning_fr = "is not an imzML file"
|
||||
end
|
||||
else
|
||||
btnPlotDisable = true
|
||||
@onbutton btnSearch begin
|
||||
full_route=pick_file(; filterlist="imzML")
|
||||
if isnothing(full_route)
|
||||
#println("No file selected")
|
||||
msg="No file selected"
|
||||
warning_msg=true
|
||||
btnStartDisable=true
|
||||
full_route = "/"
|
||||
warning_fr = "is not an imzML or mzML file"
|
||||
end
|
||||
catch e
|
||||
msg = "There was an error, please verify the file and try again. $(e)"
|
||||
else
|
||||
#println("Selected file path: ", full_route)
|
||||
btnStartDisable=false
|
||||
btnPlotDisable=false
|
||||
msi_bmp=sort(filter(filename -> startswith(filename, "MSI_") && endswith(filename, ".bmp"), readdir("public")),lt=natural)
|
||||
col_msi_png=sort(filter(filename -> startswith(filename, "colorbar_MSI_") && endswith(filename, ".png"), readdir("public")),lt=natural)
|
||||
triq_bmp=sort(filter(filename -> startswith(filename, "TrIQ_") && endswith(filename, ".bmp"), readdir("public")),lt=natural)
|
||||
col_triq_png=sort(filter(filename -> startswith(filename, "colorbar_TrIQ_") && endswith(filename, ".png"), readdir("public")),lt=natural)
|
||||
end
|
||||
end
|
||||
|
||||
"""
|
||||
@onchange Nmass begin
|
||||
indeximg=floor(Int, Nmass)
|
||||
@ -215,9 +232,10 @@ end
|
||||
@onbutton mainProcess begin
|
||||
progress=true # Start progress button animation
|
||||
btnStartDisable=true # We disable the button to avoid multiple requests
|
||||
btnPlotDisable=true
|
||||
indeximg=floor(Int, Nmass)
|
||||
text_nmass=replace(string(Nmass), "." => "_")
|
||||
full_route = joinpath(file_route, file_name)
|
||||
#full_route=joinpath(file_route, file_name)
|
||||
if isfile(full_route) && Nmass > 0 && Tol > 0 && Tol <= 1
|
||||
msg="File exists, Nmass=$(Nmass) Tol=$(Tol). Loading file will begin, please be patient."
|
||||
try
|
||||
@ -256,8 +274,8 @@ end
|
||||
# We update the directory to include the new placed images.
|
||||
triq_bmp=sort(filter(filename -> startswith(filename, "TrIQ_") && endswith(filename, ".bmp"), readdir("public")),lt=natural)
|
||||
col_triq_png=sort(filter(filename -> startswith(filename, "colorbar_TrIQ_") && endswith(filename, ".png"), readdir("public")),lt=natural)
|
||||
|
||||
msg="The file has been created successfully inside the 'public' folder of the app."
|
||||
selectedTab="tab1"
|
||||
#println("all msi in folder=",triq_bmp)
|
||||
#println("all col msi in folder= ",col_triq_png)
|
||||
end
|
||||
@ -275,7 +293,7 @@ end
|
||||
imgInt="/MSI_$(text_nmass).bmp?t=$(timestamp)"
|
||||
# Get current image
|
||||
current_msi="MSI_$(text_nmass).bmp"
|
||||
msgimg = "image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
msgimg="Image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
# Create colorbar
|
||||
ticks=round.(range(0, stop=maximum(slice), length=10), digits=2)
|
||||
Colorbar(fig[1, 1], colormap=rgb_ViridisPalette, limits=(0, maximum(slice)),ticks=ticks, label="Intensity")
|
||||
@ -286,7 +304,7 @@ end
|
||||
# We update the directory to include the new placed images.
|
||||
msi_bmp=sort(filter(filename -> startswith(filename, "MSI_") && endswith(filename, ".bmp"), readdir("public")),lt=natural)
|
||||
col_msi_png=sort(filter(filename -> startswith(filename, "colorbar_MSI_") && endswith(filename, ".png"), readdir("public")),lt=natural)
|
||||
|
||||
selectedTab="tab0"
|
||||
msg="The file has been created successfully inside the 'public' folder of the app."
|
||||
#println("all msi in folder=",msi_bmp)
|
||||
#println("all col msi in folder= ",col_msi_png)
|
||||
@ -306,12 +324,13 @@ end
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||
end
|
||||
btnStartDisable=false
|
||||
btnPlotDisable=false
|
||||
progress=false
|
||||
end
|
||||
|
||||
@onbutton createSumPlot begin
|
||||
msg="Sum spectrum plot selected"
|
||||
full_route = joinpath( file_route, file_name )
|
||||
#full_route=joinpath( file_route, file_name )
|
||||
if isfile(full_route) # Check if the file exists
|
||||
btnPlotDisable=false
|
||||
btnStartDisable=false
|
||||
@ -328,6 +347,7 @@ end
|
||||
xaxis=PlotlyBase.attr(
|
||||
title="<i>m/z</i>",
|
||||
showgrid=true
|
||||
|
||||
),
|
||||
yaxis=PlotlyBase.attr(
|
||||
title="Intensity",
|
||||
@ -345,8 +365,12 @@ end
|
||||
if Sys.islinux()
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||
end
|
||||
selectedTab="tab2"
|
||||
msg="Plot loaded."
|
||||
full_routeMz2=full_routeMz # To avoid creating the plot if its the same file read as before
|
||||
else
|
||||
msg="the mzML file was not found"
|
||||
warning_msg=true
|
||||
end
|
||||
else
|
||||
msg="is not an imzML file"
|
||||
@ -376,7 +400,7 @@ end
|
||||
|
||||
text_nmass=replace(current_msi, "MSI_" => "")
|
||||
text_nmass=replace(text_nmass, ".bmp" => "")
|
||||
msgimg = "image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
msgimg="Image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
end
|
||||
@onbutton ImgPlus begin
|
||||
# Append a query string to force the image to refresh
|
||||
@ -395,7 +419,7 @@ end
|
||||
|
||||
text_nmass=replace(current_msi, "MSI_" => "")
|
||||
text_nmass=replace(text_nmass, ".bmp" => "")
|
||||
msgimg = "image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
msgimg="Image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
end
|
||||
|
||||
@onbutton ImgMinusT begin
|
||||
@ -414,7 +438,7 @@ end
|
||||
|
||||
text_nmass=replace(current_triq, "TrIQ_" => "")
|
||||
text_nmass=replace(text_nmass, ".bmp" => "")
|
||||
msgtriq = "image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
msgtriq="TrIQ image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
|
||||
end
|
||||
@onbutton ImgPlusT begin
|
||||
@ -433,7 +457,7 @@ end
|
||||
|
||||
text_nmass=replace(current_triq, "TrIQ_" => "")
|
||||
text_nmass=replace(text_nmass, ".bmp" => "")
|
||||
msgtriq = "image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
msgtriq="TrIQ image with the Nmass of $(replace(text_nmass, "_" => "."))"
|
||||
end
|
||||
|
||||
# 3d plot
|
||||
@ -506,6 +530,7 @@ end
|
||||
if Sys.islinux()
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||
end
|
||||
selectedTab="tab4"
|
||||
msg="Plot loaded."
|
||||
catch e
|
||||
msg="Failed to load and process image: $e"
|
||||
@ -513,7 +538,7 @@ end
|
||||
println(msg)
|
||||
end
|
||||
else
|
||||
msg = "image could not be 3d plotted"
|
||||
msg="Image could not be 3d plotted"
|
||||
warning_msg=true
|
||||
end
|
||||
progressPlot=false
|
||||
@ -584,6 +609,7 @@ end
|
||||
if Sys.islinux()
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||
end
|
||||
selectedTab="tab4"
|
||||
msg="Plot loaded."
|
||||
catch e
|
||||
msg="Failed to load and process image: $e"
|
||||
@ -591,7 +617,7 @@ end
|
||||
println(msg)
|
||||
end
|
||||
else
|
||||
msg = "image could not be 3d plotted"
|
||||
msg="Image could not be 3d plotted"
|
||||
warning_msg=true
|
||||
end
|
||||
progressPlot=false
|
||||
@ -631,8 +657,8 @@ end
|
||||
layoutContour=PlotlyBase.Layout(
|
||||
title="2D Topographic Map",
|
||||
xaxis_title="X",
|
||||
yaxis_title = "Y",
|
||||
margin = attr(l = 65, r = 50, b = 65, t = 90)
|
||||
yaxis_title="Y"
|
||||
|
||||
)
|
||||
traceContour=PlotlyBase.contour(
|
||||
z=elevation_smoothed,
|
||||
@ -641,14 +667,15 @@ end
|
||||
contours_coloring="Viridis",
|
||||
colorscale="Viridis"
|
||||
)
|
||||
plotdata = [traceContour]
|
||||
plotlayout = layoutContour
|
||||
plotdataC=[traceContour]
|
||||
plotlayoutC=layoutContour
|
||||
|
||||
spectraMz=nothing # Important for memory cleaning
|
||||
GC.gc() # Trigger garbage collection
|
||||
if Sys.islinux()
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure Julia returns the freed memory to OS
|
||||
end
|
||||
selectedTab="tab3"
|
||||
msg="Plot loaded."
|
||||
catch e
|
||||
msg="Failed to load and process image: $e"
|
||||
@ -696,7 +723,7 @@ end
|
||||
title="2D Topographic Map",
|
||||
xaxis_title="X",
|
||||
yaxis_title="Y",
|
||||
margin = attr(l = 65, r = 50, b = 65, t = 90)
|
||||
|
||||
)
|
||||
traceContour=PlotlyBase.contour(
|
||||
z=elevation_smoothed,
|
||||
@ -705,14 +732,15 @@ end
|
||||
contours_coloring="Viridis",
|
||||
colorscale="Viridis"
|
||||
)
|
||||
plotdata = [traceContour]
|
||||
plotlayout = layoutContour
|
||||
plotdataC=[traceContour]
|
||||
plotlayoutC=layoutContour
|
||||
|
||||
spectraMz=nothing # Important for memory cleaning
|
||||
GC.gc() # Trigger garbage collection
|
||||
if Sys.islinux()
|
||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure Julia returns the freed memory to OS
|
||||
end
|
||||
selectedTab="tab3"
|
||||
msg="Plot loaded."
|
||||
catch e
|
||||
msg="Failed to load and process image: $e"
|
||||
|
||||
52
app.jl.html
52
app.jl.html
@ -9,16 +9,19 @@
|
||||
</div>
|
||||
</header>
|
||||
<div id="extDivStyle" class="row col-12 q-pa-xl">
|
||||
<div class="row col-6">
|
||||
<div class="row col-7">
|
||||
<!-- Left DIV -->
|
||||
<div id="intDivStyle" class="st-col col-12 st-module">
|
||||
<!--<q-file v-model="file_route" filled="" label="Select your imzML file" accept=".imzML"></q-file>-->
|
||||
<q-input id="textRoute" standout="custom-standout" v-model="file_route" label="Insert the route to your imzML file"></q-input>
|
||||
<!--<q-input id="textRoute" standout="custom-standout" v-model="file_route" label="Insert the route to your imzML file"></q-input>-->
|
||||
<h6>Search for your imzML file in your device</h6>
|
||||
<q-btn id="btnStyle" icon="search" class="q-ma-sm" v-on:click="btnSearch=true" label="Search in your device for the imzML file"></q-btn>
|
||||
<!--<p>{{full_route}}</p>-->
|
||||
<div class="row st-col col-12">
|
||||
<q-input id="textName" class="col-9" standout="custom-standout" v-model="file_name" label="Insert the name of your imzML file"></q-input>
|
||||
<!--<q-input id="textName" class="col-9" standout="custom-standout" v-model="file_name" label="Insert the name of your imzML file"></q-input>-->
|
||||
<q-btn-dropdown
|
||||
id="btnStyle"
|
||||
class="col-3"
|
||||
class="q-ma-sm"
|
||||
:loading="progressPlot"
|
||||
:disable="btnPlotDisable"
|
||||
label="Generate Plots"
|
||||
@ -91,24 +94,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn id="btnStyle" :loading="progress" :disabled="btnStartDisable" icon="play_arrow" v-on:click="mainProcess = true" padding="lg">
|
||||
Start Process
|
||||
<q-btn id="btnStyle" :loading="progress" class="q-ma-sm" :disabled="btnStartDisable" icon="play_arrow" v-on:click="mainProcess=true" padding="lg" label="Main process">
|
||||
<template v-slot:loading>
|
||||
<q-spinner-hourglass class="on-left" />
|
||||
Loading...
|
||||
</template>
|
||||
</q-btn>
|
||||
<q-btn id="btnStyle" icon="zoom_out_map" v-on:click="CompareBtn = true" padding="sm" class="on-right">
|
||||
Compare
|
||||
</q-btn>
|
||||
<q-btn id="btnStyle" icon="zoom_out_map" class="q-ma-sm on-right" v-on:click="CompareBtn=true" padding="sm" label="Compare"></q-btn>
|
||||
</div>
|
||||
<p>{{msg}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-6">
|
||||
<div class="row col-5">
|
||||
<!-- Right DIV -->
|
||||
<div id="intDivStyle" class="st-col col-12 col-sm st-module">
|
||||
<st-tabs class="bg-primary text-white shadow-2" :ids="tabIDs" :labels="tabLabels" v-model="selectedTab"></st-tabs>
|
||||
<st-tabs id="tabHeader":ids="tabIDs" :labels="tabLabels" v-model="selectedTab" no-arrows></st-tabs>
|
||||
<q-tab-panels v-model="selectedTab">
|
||||
<q-tab-panel name="tab0">
|
||||
<!-- Content for Tab 0 -->
|
||||
@ -151,11 +151,15 @@
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab2">
|
||||
<!-- Content for Tab 2 -->
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="q-pt-none"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab3">
|
||||
<!-- Content for Tab 3 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="q-pt-none"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdataC" :layout="plotlayoutC" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab4">
|
||||
<!-- Content for Tab 4 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
@ -187,7 +191,7 @@
|
||||
<q-card-section class="q-pt-none col-12">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<st-tabs class="bg-primary text-white shadow-2" :ids="tabIDs" :labels="tabLabels" v-model="selectedTab"></st-tabs>
|
||||
<st-tabs id="tabHeader":ids="tabIDs" :labels="tabLabels" v-model="selectedTab"></st-tabs>
|
||||
<q-tab-panels v-model="selectedTab">
|
||||
<q-tab-panel name="tab0">
|
||||
<!-- Content for Tab 0 -->
|
||||
@ -228,17 +232,21 @@
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab2">
|
||||
<!-- Content for Tab 2 -->
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="col-12"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab3">
|
||||
<!-- Content for Tab 3 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="col-12"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdataC" :layout="plotlayoutC" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab4">
|
||||
<!-- Content for Tab 4 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<st-tabs class="bg-primary text-white shadow-2" :ids="tabIDs" :labels="tabLabels" v-model="selectedTab"></st-tabs>
|
||||
<q-tab-panels v-model="selectedTab">
|
||||
<st-tabs id="tabHeader" :ids="CompTabIDs" :labels="CompTabLabels" v-model="CompSelectedTab" outside-arrows mobile-arrows></st-tabs>
|
||||
<q-tab-panels v-model="CompSelectedTab">
|
||||
<q-tab-panel name="tab0">
|
||||
<!-- Content for Tab 0 -->
|
||||
<!-- Btn image changer -->
|
||||
@ -278,11 +286,15 @@
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab2">
|
||||
<!-- Content for Tab 2 -->
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="col-12"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdata" :layout="plotlayout" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab3">
|
||||
<!-- Content for Tab 3 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="col-12"></plotly>
|
||||
<plotly id="plotStyle" :data="plotdataC" :layout="plotlayoutC" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="tab4">
|
||||
<!-- Content for Tab 4 -->
|
||||
<plotly id="plotStyle3d" :data="plotdata3d" :layout="plotlayout3d" class="q-pa-none q-ma-none"></plotly>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
|
||||
@ -1 +1 @@
|
||||
#btnStyle{background:#009f90;color:rgb(229, 236, 246);}#imgInt{float:left;}#header{display:flex;align-items:center;}#imgLogo{width:100px;height:80px;margin-right:10px;margin-left:10px;}#extDivStyle{background-color:#c9cdb1;border-radius: 10px;}#intDivStyle{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background-color: #eff2f5;}#colorbar{float:left;}.custom-standout{background-color:#7f8389!important;color:rgb(0, 0, 0)!important;}
|
||||
#btnStyle{background:#009f90;color:rgb(229, 236, 246);}#imgInt{float:left;}#header{display:flex;align-items:center;}#imgLogo{width:100px;height:80px;margin-right:10px;margin-left:10px;}#extDivStyle{background-color:#c9cdb1;border-radius: 10px;}#intDivStyle{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background-color: #eff2f5;}#colorbar{float:left;}.custom-standout{background-color:#7f8389!important;color:rgb(0, 0, 0)!important;}#tabHeader{color:#009f90;}
|
||||
@ -6,6 +6,7 @@ Pkg.gc()
|
||||
Pkg.add("Libz") ; Pkg.add("PlotlyBase") ; Pkg.add("CairoMakie") ; Pkg.add("Colors") ; Pkg.add("Statistics") ; Pkg.add("NaturalSort") ; Pkg.add("GenieFramework") ;Pkg.add("Genie")
|
||||
Pkg.add(url="https://github.com/CINVESTAV-LABI/julia_mzML_imzML") # With this we ensure it uses the latest library iteration
|
||||
Pkg.add("Images") ; Pkg.add("LinearAlgebra")
|
||||
Pkg.add("NativeFileDialog")
|
||||
|
||||
using Genie
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user