Add files via upload

This commit is contained in:
Pixelguy14 2024-07-17 14:00:32 -06:00 committed by GitHub
parent 0946d94956
commit f47d09ad0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 55 additions and 16 deletions

View File

@ -2,4 +2,4 @@
GenieFramework = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353" GenieFramework = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353"
[Genie] [Genie]
instantiated_pwd = "/home/julian/Documentos/Cinvestav_2024/Web/Julia/JuliaIMZML_GUI" instantiated_pwd = "/var/home/pixelguy14/Documentos/Julia_imzML_GUI-main/JuliaIMZML_GUI"

View File

@ -10,6 +10,7 @@ module App
using GenieFramework using GenieFramework
using Pkg using Pkg
using Libz using Libz
using Plots
using julia_mzML_imzML using julia_mzML_imzML
@genietools @genietools
@ -44,12 +45,20 @@ end
@in triqProb = 0.0 @in triqProb = 0.0
@in Main_Process = false @in Main_Process = false
@out indeximg = 0 @out indeximg = 0
@out indeximgTriq = 0
@out lastimg = 0 @out lastimg = 0
@out lastimgTriq = 0
@in ImgPlus = false @in ImgPlus = false
@in ImgMinus = false @in ImgMinus = false
@out test = "/.bmp"
@in ImgPlusT = false
@in ImgMinusT = false
@out testT = "/.bmp"
@in msg = "" @in msg = ""
@in msgimg = ""
@in msgtriq = ""
@out full_route = "" @out full_route = ""
# == Reactive handlers == # == Reactive handlers ==
# reactive handlers watch a variable and execute a block of code when # reactive handlers watch a variable and execute a block of code when
# its value changes # its value changes
@ -68,7 +77,9 @@ end
end end
@onchange Nmass begin @onchange Nmass begin
indeximg = Nmass indeximg = Nmass
indeximgTriq = Nmass
lastimg = Nmass lastimg = Nmass
lastimgTriq = Nmass
end 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
@ -81,29 +92,26 @@ end
spectra = LoadImzml(full_route) spectra = LoadImzml(full_route)
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 triqProb != 0 #if we have TrIQ
# SaveBitmap( joinpath( file_route, "TrIQ_$(Int(Nmass)).bmp" ),
# TrIQ( slice, Int(Nmass), triqProb ),
# ViridisPalette )
SaveBitmap( joinpath( "public", "TrIQ_$(Int(Nmass)).bmp" ), SaveBitmap( joinpath( "public", "TrIQ_$(Int(Nmass)).bmp" ),
TrIQ( slice, Int(Nmass), triqProb ), TrIQ( slice, Int(Nmass), triqProb ),
ViridisPalette ) ViridisPalette )
testT = "/TrIQ_$(Int(Nmass)).bmp"#we define the starting value of the images
msgtriq = "TrIQ image with the Nmass of $(Int(Nmass))"
else else
# SaveBitmap( joinpath( file_route, "$(Int(Nmass)).bmp" ),
# IntQuant( slice ),
# ViridisPalette )
#test
SaveBitmap( joinpath( "public", "$(Int(Nmass)).bmp" ), SaveBitmap( joinpath( "public", "$(Int(Nmass)).bmp" ),
IntQuant( slice ), IntQuant( slice ),
ViridisPalette ) ViridisPalette )
test = "/$(Int(Nmass)).bmp"#we define the starting value of the images
msgimg = "image with the Nmass of $(Int(Nmass))"
end 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 else
msg="File does not exist" msg="File does not exist"
end end
spectra = nothing spectra = nothing #Important for memory cleaning
slice = nothing slice = nothing
test = "/$(Int(Nmass)).bmp"#we define the starting value of the images #Important for memory cleaning
GC.gc() GC.gc()
end end
@onbutton ImgMinus begin @onbutton ImgMinus begin
@ -115,7 +123,7 @@ end
indeximg = lastimg indeximg = lastimg
end end
test = "/$(indeximg).bmp" test = "/$(indeximg).bmp"
msg = "image with the Nmass of $(indeximg)" msgimg = "image with the Nmass of $(indeximg)"
lastimg = indeximg lastimg = indeximg
end end
@onbutton ImgPlus begin @onbutton ImgPlus begin
@ -127,9 +135,34 @@ end
indeximg = lastimg indeximg = lastimg
end end
test = "/$(indeximg).bmp" test = "/$(indeximg).bmp"
msg = "image with the Nmass of $(indeximg)" msgimg = "image with the Nmass of $(indeximg)"
lastimg = indeximg lastimg = indeximg
end end
@onbutton ImgMinusT begin
indeximgTriq-=1
while !isfile("public/TrIQ_$(indeximgTriq).bmp") && indeximgTriq > 0
indeximgTriq -= 1
end
if(indeximgTriq <= 0) #if it doesn't find a lower value image
indeximgTriq = lastimgTriq
end
testT = "/TrIQ_$(indeximgTriq).bmp"
msgtriq = "TrIQ image with the Nmass of $(indeximgTriq)"
lastimgTriq = indeximgTriq
end
@onbutton ImgPlusT begin
indeximgTriq+=1
while !isfile("public/TrIQ_$(indeximgTriq).bmp") && indeximgTriq < 2001
indeximgTriq += 1
end
if(indeximgTriq >= 2001)
indeximgTriq = lastimgTriq
end
testT = "/TrIQ_$(indeximgTriq).bmp"
msgtriq = "TrIQ image with the Nmass of $(indeximgTriq)"
lastimgTriq = indeximgTriq
end
end end
# == Pages == # == Pages ==
# register a new route and the page that will be loaded on access # register a new route and the page that will be loaded on access

View File

@ -3,7 +3,7 @@
</header> </header>
<!--<q-file v-model="Juliapkg" filled="" label="Insert the file where 'julia_mzML_imzML' is located" accept=".txt"></q-file>--> <!--<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>Once a directory is loaded, you have to restart the app in order to insert a new one</h6> <h6>Once an image is loaded, reload the page to clear possible memory usage</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">
@ -41,6 +41,7 @@
</div> </div>
</div> </div>
<p>{{msg}}</p> <p>{{msg}}</p>
<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">
@ -49,7 +50,12 @@
<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>
<q-btn id="i3zt1" color="primary" icon="arrow_forward" label="Next" v-on:click="ImgPlus = true"></q-btn> <q-btn id="i3zt1" color="primary" icon="arrow_forward" label="Next" v-on:click="ImgPlus = true"></q-btn>
<q-img id="i6e3p" src="test"></q-img> <q-img id="i6e3p" :src="test"></q-img>
<p>{{msgimg}}</p>
<q-btn id="ijhjl-2-2" color="primary" icon="arrow_back" label="Previous" v-on:click="ImgMinusT = 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>
<p>{{msgtriq}}</p>
<!--<q-img id="i6e3p-2" src="/Borrador_Julia_GUI.jpeg"></q-img>--> <!--<q-img id="i6e3p-2" src="/Borrador_Julia_GUI.jpeg"></q-img>-->
</div> </div>
</div> </div>