commit
bf5a0cd92b
@ -5,14 +5,12 @@ module App
|
|||||||
#julia
|
#julia
|
||||||
#]
|
#]
|
||||||
#add Pkg Libz
|
#add Pkg Libz
|
||||||
|
##to add the custom package go to terminal:
|
||||||
|
#add https://github.com/CINVESTAV-LABI/julia_mzML_imzML
|
||||||
using GenieFramework
|
using GenieFramework
|
||||||
using Pkg
|
using Pkg
|
||||||
using Libz
|
using Libz
|
||||||
#to add the custom package go to terminal:
|
using julia_mzML_imzML
|
||||||
#julia
|
|
||||||
#]
|
|
||||||
#add https://github.com/CINVESTAV-LABI/julia_mzML_imzML
|
|
||||||
using julia_mzML_imzML #could add this to a try-catch to verify they're putting the correct name of the file
|
|
||||||
@genietools
|
@genietools
|
||||||
|
|
||||||
# == Code import ==
|
# == Code import ==
|
||||||
@ -34,7 +32,8 @@ 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"
|
#@out test = "/wp.jpeg"#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 = ""
|
||||||
@ -45,6 +44,7 @@ end
|
|||||||
@in triqProb = 0.0
|
@in triqProb = 0.0
|
||||||
@in Main_Process = false
|
@in Main_Process = false
|
||||||
@out indeximg = 0
|
@out indeximg = 0
|
||||||
|
@out lastimg = 0
|
||||||
@in ImgPlus = false
|
@in ImgPlus = false
|
||||||
@in ImgMinus = false
|
@in ImgMinus = false
|
||||||
@in msg = ""
|
@in msg = ""
|
||||||
@ -66,59 +66,69 @@ end
|
|||||||
warning_fr = "is not an imzML file"
|
warning_fr = "is not an imzML file"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@onchange Nmass begin
|
||||||
|
indeximg = Nmass
|
||||||
|
lastimg = Nmass
|
||||||
|
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
|
||||||
test = "/wp2.jpeg"
|
|
||||||
indeximg = Nmass
|
indeximg = Nmass
|
||||||
#spectra = LoadImzml(file_route)
|
full_route = joinpath( file_route, file_name )
|
||||||
#slice = getSlice(spectra, Nmass, Tol)
|
|
||||||
#SaveBitmap( "$(Nmass).bmp",
|
|
||||||
#IntQuant( slice ),
|
|
||||||
#ViridisPalette )
|
|
||||||
|
|
||||||
#samplesDir = "/home/julian/Documentos/Cinvestav_2024/Web/Archivos IMZML"
|
|
||||||
#samplesDir = "/home/julian/Documentos/Cinvestav_2024/Web/Julia/JuliaIMZML_GUI/public/Files"
|
|
||||||
#fileName = "royaimg.imzML"
|
|
||||||
if isfile(full_route)
|
if isfile(full_route)
|
||||||
msg="File exists, Nmass=$(Nmass) Tol=$(Tol)"
|
msg="File exists, Nmass=$(Nmass) Tol=$(Tol). Please do not press the start button until confirmation"
|
||||||
else
|
|
||||||
msg="File does not exist"
|
|
||||||
end
|
|
||||||
spectra = LoadImzml(full_route)
|
spectra = LoadImzml(full_route)
|
||||||
slice = getSlice(spectra, Nmass, Tol)
|
msg = "File loaded. Please do not press the start button until confirmation"
|
||||||
|
slice = GetSlice(spectra, Nmass, Tol)
|
||||||
if triqProb != 0
|
if triqProb != 0
|
||||||
SaveBitmap( joinpath( samplesDir, "TrIQ_$(Nmass).bmp" ),
|
# SaveBitmap( joinpath( file_route, "TrIQ_$(Int(Nmass)).bmp" ),
|
||||||
TrIQ( slice, Nmass, triqProb ),
|
# TrIQ( slice, Int(Nmass), triqProb ),
|
||||||
|
# ViridisPalette )
|
||||||
|
SaveBitmap( joinpath( "public", "TrIQ_$(Int(Nmass)).bmp" ),
|
||||||
|
TrIQ( slice, Int(Nmass), triqProb ),
|
||||||
ViridisPalette )
|
ViridisPalette )
|
||||||
else
|
else
|
||||||
SaveBitmap( joinpath( file_route, "$(Nmass).bmp" ),
|
# SaveBitmap( joinpath( file_route, "$(Int(Nmass)).bmp" ),
|
||||||
|
# IntQuant( slice ),
|
||||||
|
# ViridisPalette )
|
||||||
|
#test
|
||||||
|
SaveBitmap( joinpath( "public", "$(Int(Nmass)).bmp" ),
|
||||||
IntQuant( slice ),
|
IntQuant( slice ),
|
||||||
ViridisPalette )
|
ViridisPalette )
|
||||||
end
|
end
|
||||||
|
msg="The file has been created inside the 'public' folder of the app"
|
||||||
|
else
|
||||||
|
msg="File does not exist"
|
||||||
|
end
|
||||||
|
spectra = nothing
|
||||||
|
slice = nothing
|
||||||
|
test = "/$(Int(Nmass)).bmp"#we define the starting value of the images
|
||||||
|
GC.gc()
|
||||||
end
|
end
|
||||||
@onbutton ImgMinus begin
|
@onbutton ImgMinus begin
|
||||||
indeximg-=1
|
indeximg-=1
|
||||||
while !isfile("/$(indeximg).jpeg") && indeximg > 0 && indeximg <999
|
while !isfile("public/$(indeximg).bmp") && indeximg > 0
|
||||||
indeximg -= 1
|
indeximg -= 1
|
||||||
end
|
end
|
||||||
if(indeximg <= 0)
|
if(indeximg <= 0) #if it doesn't find a lower value image
|
||||||
indeximg = Nmass
|
indeximg = lastimg
|
||||||
end
|
end
|
||||||
test = "/$(indeximg).jpeg"
|
test = "/$(indeximg).bmp"
|
||||||
msg = "image with the Nmass of $(indeximg)"
|
msg = "image with the Nmass of $(indeximg)"
|
||||||
|
lastimg = indeximg
|
||||||
end
|
end
|
||||||
@onbutton ImgPlus begin
|
@onbutton ImgPlus begin
|
||||||
indeximg+=1
|
indeximg+=1
|
||||||
while !isfile("/$(indeximg).jpeg") && indeximg > 0 && indeximg <999
|
while !isfile("public/$(indeximg).bmp") && indeximg < 2001
|
||||||
indeximg += 1
|
indeximg += 1
|
||||||
end
|
end
|
||||||
if(indeximg >= 999)
|
if(indeximg >= 2001)
|
||||||
indeximg = Nmass
|
indeximg = lastimg
|
||||||
end
|
end
|
||||||
test = "/$(indeximg).jpeg"
|
test = "/$(indeximg).bmp"
|
||||||
msg = "image with the Nmass of $(indeximg)"
|
msg = "image with the Nmass of $(indeximg)"
|
||||||
|
lastimg = indeximg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# == Pages ==
|
# == Pages ==
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
<h4>Julia mzML imzML GUI </h4>
|
<h4>Julia mzML imzML GUI </h4>
|
||||||
</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 that the file "julia_mzML_imzML" is located in the directory of this program</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>
|
||||||
<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">
|
||||||
<!--<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 full 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>
|
||||||
@ -36,7 +37,7 @@
|
|||||||
<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 && val <= 1 || 'Needs to be in range between 0 and 1',
|
val => val >= 0 && 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="true" v-on:click="Main_Process = true" label="Start"></q-btn>
|
<q-btn id="isfqg" color="primary" icon="play_arrow" v-on:click="Main_Process = true" label="Start"></q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>{{msg}}</p>
|
<p>{{msg}}</p>
|
||||||
@ -48,7 +49,7 @@
|
|||||||
<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>
|
||||||
<!--<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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user