Add files via upload

This commit is contained in:
Pixelguy14 2024-07-31 19:34:54 -06:00 committed by GitHub
parent 11b0dc493c
commit 3650572337
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 67 additions and 51 deletions

View File

@ -2,7 +2,7 @@
julia_version = "1.10.4" julia_version = "1.10.4"
manifest_format = "2.0" manifest_format = "2.0"
project_hash = "2289dc4b622847faad50ee48ccc2bada375b46bf" project_hash = "49392750aeb43599cd2d6b9c2e6f6cbff6f08de0"
[[deps.ArgParse]] [[deps.ArgParse]]
deps = ["Logging", "TextWrap"] deps = ["Logging", "TextWrap"]

View File

@ -1,4 +1,5 @@
[deps] [deps]
Genie = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
GenieFramework = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353" GenieFramework = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353"
[Genie] [Genie]

View File

@ -21,7 +21,7 @@ function mean_value(x)
sum(x) / length(x) sum(x) / length(x)
end end
function contains_word(x, word) function contains_word(x, word) #ease to read
occursin(word, x) occursin(word, x)
end end
@ -33,8 +33,7 @@ end
# @out variables can only be modified by the backend # @out variables can only be modified by the backend
# @in variables can be modified by both the backend and the browser # @in variables can be modified by both the backend and the browser
# variables must be initialized with constant values, or variables defined outside of the @app block # variables must be initialized with constant values, or variables defined outside of the @app block
#@out test = "/wp.jpeg"#slash means it's getting the info from 'public' folder #@out test = "/test.bmp"#slash means it's getting the info from 'public' folder
#@out test = "/95.bmp"
#mkdir("new_folder") #mkdir("new_folder")
@in file_route = "" @in file_route = ""
@in file_name = "" @in file_name = ""
@ -42,7 +41,9 @@ end
@in Nmass = 0.0 @in Nmass = 0.0
@in Tol = 0.0 @in Tol = 0.0
@in triqEnabled = false @in triqEnabled = false
@out Disab_btn = false
@in triqProb = 0.0 @in triqProb = 0.0
@in triqColor = 0
@in Main_Process = false @in Main_Process = false
@out indeximg = 0 @out indeximg = 0
@out indeximgTriq = 0 @out indeximgTriq = 0
@ -65,6 +66,7 @@ end
@onchange triqEnabled begin @onchange triqEnabled begin
if !triqEnabled if !triqEnabled
triqProb = 0.0 triqProb = 0.0
triqColor = 0
end end
end end
@onchange file_name begin @onchange file_name begin
@ -85,6 +87,8 @@ end
# the onbutton handler will set the variable to false after the block is executed # the onbutton handler will set the variable to false after the block is executed
#/home/julian/Documentos/Cinvestav_2024/Web/Archivos IMZML/royaimg.imzML #/home/julian/Documentos/Cinvestav_2024/Web/Archivos IMZML/royaimg.imzML
@onbutton Main_Process begin @onbutton Main_Process begin
GC.gc() # Trigger garbage collection
Disab_btn = true #We disable the button to avoid multiple requests
indeximg = Nmass indeximg = Nmass
full_route = joinpath(file_route, file_name) full_route = joinpath(file_route, file_name)
if isfile(full_route) if isfile(full_route)
@ -93,12 +97,18 @@ end
msg = "File loaded. Please do not press the start button until confirmation" msg = "File loaded. Please do not press the start button until confirmation"
slice = GetSlice(spectra, Nmass, Tol) slice = GetSlice(spectra, Nmass, Tol)
if triqProb != 0 # if we have TrIQ if triqProb != 0 # if we have TrIQ
if triqColor < 1 || triqColor > 256
triqColor = 1
end
if triqProb < 0 || triqProb > 1
triqProb = 0.1
end
SaveBitmap(joinpath("public", "TrIQ_$(Int(Nmass)).bmp"), SaveBitmap(joinpath("public", "TrIQ_$(Int(Nmass)).bmp"),
TrIQ( slice, Int(Nmass), triqProb ), TrIQ(slice, Int(triqColor), triqProb),
ViridisPalette) ViridisPalette)
testT = "/TrIQ_$(Int(Nmass)).bmp" # we define the starting value of the images testT = "/TrIQ_$(Int(Nmass)).bmp" # we define the starting value of the images
msgtriq = "TrIQ image with the Nmass of $(Int(Nmass))" msgtriq = "TrIQ image with the Nmass of $(Int(Nmass))"
else else # if we don't
SaveBitmap(joinpath("public", "$(Int(Nmass)).bmp"), SaveBitmap(joinpath("public", "$(Int(Nmass)).bmp"),
IntQuant(slice), IntQuant(slice),
ViridisPalette) ViridisPalette)
@ -111,8 +121,8 @@ end
end end
spectra = nothing # Important for memory cleaning spectra = nothing # Important for memory cleaning
slice = nothing slice = nothing
#Important for memory cleaning GC.gc() # Trigger garbage collection
GC.gc() Disab_btn = false
end end
@onbutton ImgMinus begin @onbutton ImgMinus begin
indeximg-=1 indeximg-=1

View File

@ -1,26 +1,23 @@
<header> <header>
<h4>Julia mzML imzML GUI&nbsp;</h4> <h4>Julia mzML imzML GUI&nbsp;</h4>
</header> </header>
<!--<q-file v-model="Juliapkg" filled="" label="Insert the file where 'julia_mzML_imzML' is located" accept=".txt"></q-file>-->
<h6>Please make sure the ibd file is located in the same directory as the imzML file</h6> <h6>Please make sure the ibd file is located in the same directory as the imzML file</h6>
<h6>It may take a while to generate the image, don't press the Start button more than once until it finishes</h6> <h6>It may take a while to generate the image, don't press the Start button more than once until it finishes</h6>
<div class="row"> <div class="row">
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm st-module">
<div class="row"> <div class="row">
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm st-module"> <!--Left DIV-->
<!--<q-file v-model="file_route" filled="" label="Select your imzML file" accept=".txt"></q-file>--> <!--<q-file v-model="file_route" filled="" label="Select your imzML file" accept=".txt"></q-file>-->
<q-input id="ijii1" v-model="file_route" :dense="true" label="Insert the route to your imzML file"></q-input> <q-input id="ijii1" v-model="file_route" :dense="true" label="Insert the route to your imzML file"></q-input>
<q-input id="ijii1-2" v-model="file_name" :dense="true" label="Insert the name of your imzML file"></q-input> <q-input id="ijii1-2" v-model="file_name" :dense="true" label="Insert the name of your imzML file"></q-input>
<p id="i7brk">full route: {{full_route}} {{warning_fr}}</p> <p id="i7brk">full route: {{full_route}} {{warning_fr}}</p>
</div>
</div>
<div class="row"> <div class="row">
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm">
<q-input id="icc9d" v-model="Nmass" :dense="true" label="Mass Value" type="number" :rules="[ <q-input id="icc9d" v-model="Nmass" :dense="true" label="Mass Value" type="number" :rules="[
val => val >= 0 || 'Need positive mass values', val => val >= 0 || 'Need positive mass values',
]"></q-input> ]"></q-input>
</div> </div>
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm">
<q-input id="iqt3l" step="0.01" v-model="Tol" :dense="true" label="Tolerance" type="number" :rules="[ <q-input id="iqt3l" step="0.01" v-model="Tol" :dense="true" label="Tolerance" type="number" :rules="[
val => !!val || '* Required', val => !!val || '* Required',
val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1', val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1',
@ -28,24 +25,33 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm">
<div class="row">
<div class="st-col col-12 col-sm st-module">
<q-toggle id="igqon" v-on:click="triqEnabled" v-model="triqEnabled" color="blue" label="Add TrIQ!"></q-toggle> <q-toggle id="igqon" v-on:click="triqEnabled" v-model="triqEnabled" color="blue" label="Add TrIQ!"></q-toggle>
</div> </div>
</div> </div>
<div class="row">
<div class="st-col col-12 col-sm-8">
<q-input id="i28wb" step="0.01" v-model="triqProb" :dense="true" label="TrIQ Probability" type="number" :rules="[ <q-input id="i28wb" step="0.01" v-model="triqProb" :dense="true" label="TrIQ Probability" type="number" :rules="[
val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1', val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1',
]" :readonly="!triqEnabled"></q-input> ]" :readonly="!triqEnabled"></q-input>
<q-btn id="isfqg" color="primary" icon="play_arrow" v-on:click="Main_Process = true" label="Start"></q-btn> </div>
<div class="st-col col-12 col-sm-4">
<q-input id="i28wb-2" step="1" v-model="triqColor" :dense="true" label="TrIQ Color" type="number" :rules="[
val => val >= 0 &amp;&amp; val <= 256 || 'Needs to be in range between 1 and 256',
]" :readonly="!triqEnabled"></q-input>
</div> </div>
</div> </div>
<q-btn id="isfqg" :disabled="Disab_btn" color="primary" icon="play_arrow" v-on:click="Main_Process = true" label="Start"></q-btn>
<p>{{msg}}</p> <p>{{msg}}</p>
<plotly id="i1j1o" data="plotdata"></plotly> </div>
</div>
<!--<plotly id="i1j1o" data="plotdata"></plotly>-->
</div> </div>
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm st-module">
<div class="row"> <div class="row">
<div class="st-col col-12 col-sm st-module"> <div class="st-col col-12 col-sm st-module"> <!--Right DIV-->
<h6>Image Visualizer</h6><br> <h6>Image Visualizer</h6><br>
<p></p> <p></p>
<q-btn id="ijhjl-2" color="primary" icon="arrow_back" label="Previous" v-on:click="ImgMinus = true"></q-btn> <q-btn id="ijhjl-2" color="primary" icon="arrow_back" label="Previous" v-on:click="ImgMinus = true"></q-btn>
@ -56,7 +62,6 @@
<q-btn id="i3zt1-2" color="primary" icon="arrow_forward" label="Next" v-on:click="ImgPlusT = true"></q-btn> <q-btn id="i3zt1-2" color="primary" icon="arrow_forward" label="Next" v-on:click="ImgPlusT = true"></q-btn>
<q-img id="i6e3p-2" :src="testT"></q-img> <q-img id="i6e3p-2" :src="testT"></q-img>
<p>{{msgtriq}}</p> <p>{{msgtriq}}</p>
<!--<q-img id="i6e3p-2" src="/Borrador_Julia_GUI.jpeg"></q-img>-->
</div> </div>
</div> </div>
</div> </div>