Skip to content

Commit

Permalink
Update bioimageio-packager.imjoy.html
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway authored Sep 28, 2024
1 parent 4669a7c commit 1f560f0
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions src/bioimageio-packager.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "window",
"tags": [],
"ui": "",
"version": "0.3.3",
"version": "0.3.4",
"api_version": "0.1.7",
"description": "Exporting BioImage.IO model packages from the model description file",
"icon": "https://raw.githubusercontent.com/imjoy-team/bioimage-io-models/master/asset/download-icon.png",
Expand Down Expand Up @@ -189,6 +189,45 @@
}
}
}

// for 0.5.3, test_inputs and test_outputs and sample_inputs and sample_outputs has been moved to inputs and outputs
for(let input of spec.inputs){
if(input.test_tensor){
if(await fileExists(rootUrl, input.test_tensor.source)){
files.push(input.test_tensor.source)
}
else{
showWarning("File not found: " + input.test_tensor.source)
}
}
if(input.sample_tensor){
if(await fileExists(rootUrl, input.sample_tensor.source)){
files.push(input.sample_tensor.source)
}
else{
showWarning("File not found: " + input.sample_tensor.source)
}
}
}

for(let output of spec.outputs){
if(output.test_tensor){
if(await fileExists(rootUrl, output.test_tensor.source)){
files.push(output.test_tensor.source)
}
else{
showWarning("File not found: " + output.test_tensor.source)
}
}
if(output.sample_tensor){
if(await fileExists(rootUrl, output.sample_tensor.source)){
files.push(output.sample_tensor.source)
}
else{
showWarning("File not found: " + output.sample_tensor.source)
}
}
}

if(spec.covers && Array.isArray(spec.covers)){
files = files.concat(spec.covers)
Expand Down Expand Up @@ -313,7 +352,7 @@

async run(ctx) {
if(!ctx.data || !ctx.data.source){
const specUrl = await api.prompt("Please paste the model spec url here", "https://bioimage-io.github.io/collection-bioimage-io/rdfs/10.5281/zenodo.5749843/5888237/rdf.yaml")
const specUrl = await api.prompt("Please paste the model spec url here", "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/affable-shark/1.1/files/rdf.yaml")
if(!specUrl) return
app.modelInfo = {
name: getFileName(specUrl),
Expand Down

0 comments on commit 1f560f0

Please sign in to comment.