Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qim3d
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QIM
Tools
qim3d
Commits
2d5eded9
Commit
2d5eded9
authored
1 year ago
by
Stefan Peter Engelmann Jensen
Browse files
Options
Downloads
Patches
Plain Diff
Added event trigger for removing output file in working directory
parent
2e94eb52
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!41
Added event trigger for removing output file in working directory
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
qim3d/gui/annotation_tool.py
+3
-1
3 additions, 1 deletion
qim3d/gui/annotation_tool.py
qim3d/gui/iso3d.py
+6
-0
6 additions, 0 deletions
qim3d/gui/iso3d.py
qim3d/gui/local_thickness.py
+6
-1
6 additions, 1 deletion
qim3d/gui/local_thickness.py
with
15 additions
and
2 deletions
qim3d/gui/annotation_tool.py
+
3
−
1
View file @
2d5eded9
...
...
@@ -170,7 +170,9 @@ class Interface:
fn
=
operations
.
save_mask
,
inputs
=
output_masks
,
outputs
=
[
save_output
,
save_output
],
)
).
success
(
fn
=
lambda
:
os
.
remove
(
'
mask.tif
'
)
)
# Remove mask file from working directory immediately after sending it to /tmp/gradio
# Update 'Add mask' button interactivit according to the current count
counts
.
change
(
...
...
This diff is collapsed.
Click to expand it.
qim3d/gui/iso3d.py
+
6
−
0
View file @
2d5eded9
...
...
@@ -187,6 +187,11 @@ class Interface:
return
fig
,
"
iso3d.html
"
def
remove_unused_file
(
self
):
# Remove localthickness.tif file from working directory
# as it otherwise is not deleted
os
.
remove
(
"
iso3d.html
"
)
def
create_interface
(
self
):
# Create gradio app
...
...
@@ -367,6 +372,7 @@ class Interface:
# fmt: off
btn_run
.
click
(
fn
=
self
.
process
,
inputs
=
inputs
,
outputs
=
outputs
).
success
(
fn
=
self
.
remove_unused_file
).
success
(
fn
=
self
.
make_visible
,
inputs
=
None
,
outputs
=
plot_download
)
# fmt: on
...
...
This diff is collapsed.
Click to expand it.
qim3d/gui/local_thickness.py
+
6
−
1
View file @
2d5eded9
...
...
@@ -90,7 +90,6 @@ class Interface:
quiet
=
quiet
,
height
=
self
.
height
,
width
=
self
.
width
,
show_tips
=
False
,
)
return
...
...
@@ -272,6 +271,7 @@ class Interface:
fn
=
pipeline
.
output_viz
,
inputs
=
session
,
outputs
=
output_vol
).
success
(
fn
=
pipeline
.
thickness_histogram
,
inputs
=
session
,
outputs
=
histogram
).
success
(
fn
=
pipeline
.
save_lt
,
inputs
=
session
,
outputs
=
lt_output
).
success
(
fn
=
pipeline
.
remove_unused_file
).
success
(
fn
=
self
.
make_visible
,
inputs
=
None
,
outputs
=
lt_output
)
...
...
@@ -421,6 +421,11 @@ class Pipeline:
return
filename
def
remove_unused_file
(
self
):
# Remove localthickness.tif file from working directory
# as it otherwise is not deleted
os
.
remove
(
'
localthickness.tif
'
)
def
run_interface
(
host
=
"
0.0.0.0
"
):
gradio_interface
=
Interface
().
create_interface
()
internal_tools
.
run_gradio_app
(
gradio_interface
,
host
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment