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
1c45425f
Commit
1c45425f
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Elevate whether to use a specific z-index or MIP to find best focus in zmask
parent
09b24fa8
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/20231008_Bilbao_PA.py
+64
-0
64 additions, 0 deletions
extensions/chaeo/actual_runs/20231008_Bilbao_PA.py
extensions/chaeo/workflows.py
+6
-1
6 additions, 1 deletion
extensions/chaeo/workflows.py
with
70 additions
and
1 deletion
extensions/chaeo/actual_runs/20231008_Bilbao_PA.py
0 → 100644
+
64
−
0
View file @
1c45425f
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
,
InMemoryDataAccessor
from
model_server.process
import
rescale
def
export_single_channel_tif_from_multichannel_czi
(
input_file_path
,
output_folder_path
,
channel
,
**
kwargs
):
in_acc
=
CziImageFileAccessor
(
input_file_path
)
data
=
in_acc
.
get_one_channel_data
(
channel
).
data
if
'
rescale_zmask_clip
'
in
kwargs
:
data
=
rescale
(
data
,
clip
=
kwargs
[
'
rescale_zmask_clip
'
])
outf
=
Path
(
output_folder_path
)
/
(
Path
(
input_file_path
).
stem
+
'
.tif
'
)
write_accessor_data_to_file
(
outf
,
InMemoryDataAccessor
(
data
),
)
print
(
f
'
Wrote file:
{
outf
}
'
)
if
__name__
==
'
__main__
'
:
root
=
Path
(
'
c:/Users/rhodes/projects/proj0012-trec-handoff/owncloud-sync/TREC-HD/Images/
'
)
where_czi
=
(
root
/
'
TREC_STOP_24_Bilbao/231008_automic/20231008-162336/Selection
'
).
__str__
()
where_output
=
autonumber_new_directory
(
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0017/output
'
,
'
batch-output
'
)
px_ilp
=
Path
(
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0017/pxAF405_dim8bit.ilp
'
).
__str__
()
params
=
{
'
ilastik_project_file
'
:
px_ilp
,
'
pxmap_threshold
'
:
0.25
,
'
pixel_class
'
:
0
,
'
zmask_channel
'
:
0
,
'
zmask_zindex
'
:
3
,
'
patches_channel
'
:
2
,
'
mask_type
'
:
'
boxes
'
,
'
zmask_filters
'
:
{
'
area
'
:
(
1e3
,
1e8
)},
'
zmask_expand_box_by
'
:
(
128
,
3
),
'
export_pixel_probabilities
'
:
True
,
'
export_2d_patches_for_training
'
:
True
,
'
draw_bounding_box_on_2d_patch
'
:
True
,
'
export_2d_patches_for_annotation
'
:
True
,
'
export_3d_patches
'
:
False
,
'
export_annotated_zstack
'
:
True
,
'
export_patch_masks
'
:
True
,
'
rescale_zmask_clip
'
:
0.01
,
'
rgb_overlay_channels
'
:
(
1
,
None
,
None
),
'
rgb_overlay_weights
'
:
(
0.5
,
1.0
,
1.0
)
}
input_files
=
get_matching_files
(
where_czi
,
'
czi
'
,
coord_filter
=
{})
loop_workflow
(
input_files
,
where_output
,
export_patches_from_multichannel_zstack
,
params
,
catch_and_continue
=
False
,
)
print
(
'
Finished
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
extensions/chaeo/workflows.py
+
6
−
1
View file @
1c45425f
...
...
@@ -23,6 +23,7 @@ def export_patches_from_multichannel_zstack(
pxmap_threshold
:
float
,
pixel_class
:
int
,
zmask_channel
:
int
,
zmask_zindex
:
None
,
# None for MIP,
patches_channel
:
int
,
rescale_zmask_clip
:
int
=
None
,
mask_type
:
str
=
'
boxes
'
,
...
...
@@ -46,7 +47,11 @@ def export_patches_from_multichannel_zstack(
ti
.
click
(
'
file_input
'
)
# MIP and classify pixels
zmask_data
=
stack
.
get_one_channel_data
(
channel
=
zmask_channel
).
data
.
max
(
axis
=-
1
,
keepdims
=
True
)
if
isinstance
(
zmask_zindex
,
int
):
assert
0
<
zmask_zindex
<
stack
.
nz
zmask_data
=
stack
.
get_one_channel_data
(
channel
=
zmask_channel
).
data
[:,
:,
:,
zmask_zindex
]
else
:
zmask_data
=
stack
.
get_one_channel_data
(
channel
=
zmask_channel
).
data
.
max
(
axis
=-
1
,
keepdims
=
True
)
if
rescale_zmask_clip
:
zmask_data
=
rescale
(
zmask_data
,
rescale_zmask_clip
)
mip
=
InMemoryDataAccessor
(
...
...
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