From 2bd2e819a40e4c941de5cc57e44633e3872f4ed0 Mon Sep 17 00:00:00 2001 From: Pixelguy14 Date: Thu, 13 Mar 2025 13:49:49 -0600 Subject: [PATCH] Concept error in Sum spectrum, changed to Mean spectrum --- app.jl | 20 ++++++++++---------- app.jl.html | 6 +++--- julia_imzML_visual.jl | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app.jl b/app.jl index 9c0255f..aaa9767 100644 --- a/app.jl +++ b/app.jl @@ -54,7 +54,7 @@ include("./julia_imzML_visual.jl") @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 + @in createMeanPlot=false # To generate mean spectrum plot @in createXYPlot=false # To generate an spectrum plot according to the xy values inputed @in image3dPlot=false # To generate 3d plot based on current image @in triq3dPlot=false # To generate 3d plot based on current triq image @@ -290,13 +290,13 @@ include("./julia_imzML_visual.jl") # Splitting the route with regex from imzml to mzml so the plotting can work full_routeMz=replace(full_route, r"\.[^.]*$" => ".mzML") if isfile(full_routeMz) - # Start the sum spectrum creation on loading + # Start the mean spectrum creation on loading progressSpectraPlot=true btnPlotDisable=true btnStartDisable=true - msg="Loading SUM spectrum plot..." + msg="Loading mean spectrum plot..." sTime=time() - plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz) + plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz) selectedTab="tab2" progressSpectraPlot=false btnPlotDisable=false @@ -319,13 +319,13 @@ include("./julia_imzML_visual.jl") btnSpectraDisable=false SpectraEnabled=true if isfile(full_routeMz) - # Start the sum spectrum creation on loading + # Start the mean spectrum creation on loading progressSpectraPlot=true btnPlotDisable=true btnStartDisable=true - msg="Loading SUM spectrum plot..." + msg="Loading mean spectrum plot..." sTime=time() - plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz) + plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz) selectedTab="tab2" progressSpectraPlot=false btnPlotDisable=false @@ -469,15 +469,15 @@ include("./julia_imzML_visual.jl") end end - @onbutton createSumPlot begin - msg="Sum spectrum plot selected" + @onbutton createMeanPlot begin + msg="Mean spectrum plot selected" sTime=time() if isfile(full_routeMz) # Check if the file exists progressSpectraPlot=true btnPlotDisable=true btnStartDisable=true msg="Loading plot..." - plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz) + plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz) GC.gc() # Trigger garbage collection if Sys.islinux() ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS diff --git a/app.jl.html b/app.jl.html index b25b0e9..0336595 100644 --- a/app.jl.html +++ b/app.jl.html @@ -64,14 +64,14 @@ - + - Sum Spectrum Plot + Mean spectrum plot - Spectrum Plot (X,Y) + Spectrum plot (X,Y) diff --git a/julia_imzML_visual.jl b/julia_imzML_visual.jl index 2316c25..1316186 100644 --- a/julia_imzML_visual.jl +++ b/julia_imzML_visual.jl @@ -442,17 +442,17 @@ function padarray(A, padsize) return padded end -# sumSpectrumPlot recieves the local directory of the image as a string, +# meanSpectrumPlot recieves the local directory of the image as a string, # returns the layout and data for the surface plotly plot # this function loads the spectra data and makes a mean to display # its values in the spectrum plot -function sumSpectrumPlot(mzmlRoute::String) +function meanSpectrumPlot(mzmlRoute::String) spectraMz=LoadMzml(mzmlRoute) xSpectraMz=Float64[] ySpectraMz=Float64[] layout=PlotlyBase.Layout( - title="SUM spectrum plot", + title="Mean spectrum plot", xaxis=PlotlyBase.attr( title="m/z", showgrid=true,