Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
18bfccbd
Commit
18bfccbd
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Exported single-channel TIFs for purposes of ilastik classifier development
parent
0c3a9a03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extensions/chaeo/actual_runs/20230805_kristineberg_PA.py
+27
-8
27 additions, 8 deletions
extensions/chaeo/actual_runs/20230805_kristineberg_PA.py
extensions/chaeo/util.py
+2
-2
2 additions, 2 deletions
extensions/chaeo/util.py
with
29 additions
and
10 deletions
extensions/chaeo/actual_runs/20230805_kristineberg_PA.py
+
27
−
8
View file @
18bfccbd
...
...
@@ -3,6 +3,19 @@ from pathlib import Path
from
extensions.chaeo.util
import
autonumber_new_directory
,
get_matching_files
,
loop_workflow
from
extensions.chaeo.workflows
import
export_patches_from_multichannel_zstack
from
model_server.accessors
import
CziImageFileAccessor
,
write_accessor_data_to_file
def
export_single_channel_tif_from_multichannel_czi
(
files
,
where_output
,
channel
):
for
czif
in
files
:
in_acc
=
CziImageFileAccessor
(
czif
)
outf
=
Path
(
where_output
)
/
(
Path
(
czif
).
stem
+
'
.tif
'
)
write_accessor_data_to_file
(
outf
,
in_acc
.
get_one_channel_data
(
channel
),
)
print
(
f
'
Wrote file:
{
outf
}
'
)
if
__name__
==
'
__main__
'
:
where_czi
=
'
c:/Users/rhodes/projects/proj0012-trec-handoff/owncloud-sync/TREC-HD/Images/TREC_STOP_15_Kristineberg/230805_automic_AI_PA/20230805-122525_AI_PA_successfulrun_recognitiononPLL405cilindionas/Selection
'
where_output
=
autonumber_new_directory
(
...
...
@@ -17,7 +30,7 @@ if __name__ == '__main__':
'
pxmap_threshold
'
:
0.25
,
'
pixel_class
'
:
0
,
'
zmask_channel
'
:
0
,
'
patches_channel
'
:
4
,
'
patches_channel
'
:
2
,
'
mask_type
'
:
'
boxes
'
,
'
zmask_filters
'
:
{
'
area
'
:
(
1e3
,
1e8
)},
'
zmask_expand_box_by
'
:
(
128
,
3
),
...
...
@@ -31,12 +44,18 @@ if __name__ == '__main__':
input_files
=
get_matching_files
(
where_czi
,
'
czi
'
)
loop_workflow
(
input_files
,
where_output
,
export_patches_from_multichannel_zstack
,
params
,
catch_and_continue
=
False
,
)
tif_export_params
=
{
'
channel
'
:
0
}
export_single_channel_tif_from_multichannel_czi
(
input_files
,
where_output
,
0
)
# loop_workflow(
# input_files,
# where_output,
# export_single_channel_tif_from_multichannel_czi,
# tif_export_params,
# catch_and_continue=False,
# )
print
(
'
Finished
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
extensions/chaeo/util.py
+
2
−
2
View file @
18bfccbd
...
...
@@ -26,7 +26,7 @@ def autonumber_new_file(where: str, prefix: str, ext: str) -> str:
idx
=
max
(
idx
,
int
(
ma
.
groups
()[
0
])
+
1
)
return
f
'
{
prefix
}
-
{
idx
:
04
d
}
.
{
ext
}
'
def
get_matching_files
(
where
:
str
,
ext
:
str
,
coord_filter
:
dict
=
{})
->
st
r
:
def
get_matching_files
(
where
:
str
,
ext
:
str
,
coord_filter
:
dict
=
{})
->
li
st
:
files
=
[]
def
is_filtered_out
(
ff
):
...
...
@@ -54,7 +54,7 @@ def loop_workflow(files, where_output, workflow_func, params,
failures
=
[]
for
ii
,
ff
in
enumerate
(
files
):
export_kwargs
=
{
'
input_zstack_path
'
:
ff
,
'
input_zstack_path
'
:
ff
,
# TODO: use a more generic name for implied args
'
where_output
'
:
where_output
,
**
params
,
}
...
...
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