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"
manifest_format = "2.0"
project_hash = "2289dc4b622847faad50ee48ccc2bada375b46bf"
project_hash = "49392750aeb43599cd2d6b9c2e6f6cbff6f08de0"
[[deps.ArgParse]]
deps = ["Logging", "TextWrap"]

View File

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

View File

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

View File

@ -1,51 +1,57 @@
<header>
<h4>Julia mzML imzML GUI&nbsp;</h4>
</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>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="st-col col-12 col-sm st-module">
<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-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>
<p id="i7brk">full route: {{full_route}} {{warning_fr}}</p>
</div>
</div>
<div class="row">
<div class="st-col col-12 col-sm st-module">
<q-input id="icc9d" v-model="Nmass" :dense="true" label="Mass Value" type="number" :rules="[
val => val >= 0 || 'Need positive mass values',
]"></q-input>
</div>
<div class="st-col col-12 col-sm st-module">
<q-input id="iqt3l" step="0.01" v-model="Tol" :dense="true" label="Tolerance" type="number" :rules="[
val => !!val || '* Required',
val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1',
]"></q-input>
</div>
</div>
<div class="row">
<div class="st-col col-12 col-sm st-module">
<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>
<div class="st-col col-12 col-sm">
<q-input id="icc9d" v-model="Nmass" :dense="true" label="Mass Value" type="number" :rules="[
val => val >= 0 || 'Need positive mass values',
]"></q-input>
</div>
<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="[
val => !!val || '* Required',
val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1',
]"></q-input>
</div>
</div>
<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',
]" :readonly="!triqEnabled"></q-input>
<q-btn id="isfqg" color="primary" icon="play_arrow" v-on:click="Main_Process = true" label="Start"></q-btn>
<div class="row">
<div class="st-col col-12 col-sm">
<q-toggle id="igqon" v-on:click="triqEnabled" v-model="triqEnabled" color="blue" label="Add TrIQ!"></q-toggle>
</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="[
val => val >= 0 &amp;&amp; val <= 1 || 'Needs to be in range between 0 and 1',
]" :readonly="!triqEnabled"></q-input>
</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>
<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>
</div>
</div>
<p>{{msg}}</p>
<plotly id="i1j1o" data="plotdata"></plotly>
<!--<plotly id="i1j1o" data="plotdata"></plotly>-->
</div>
<div class="st-col col-12 col-sm st-module">
<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>
<p></p>
<q-btn id="ijhjl-2" color="primary" icon="arrow_back" label="Previous" v-on:click="ImgMinus = true"></q-btn>
@ -56,8 +62,7 @@
<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>
<p>{{msgtriq}}</p>
<!--<q-img id="i6e3p-2" src="/Borrador_Julia_GUI.jpeg"></q-img>-->
</div>
</div>
</div>
</div>
</div>