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
3eadaa65
Commit
3eadaa65
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Exposed patch chlorophyl overlay parameters to workflow kwargs
parent
d039e57b
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
+20
-6
20 additions, 6 deletions
extensions/chaeo/actual_runs/20230805_kristineberg_PA.py
extensions/chaeo/workflows.py
+7
-6
7 additions, 6 deletions
extensions/chaeo/workflows.py
with
27 additions
and
12 deletions
extensions/chaeo/actual_runs/20230805_kristineberg_PA.py
+
20
−
6
View file @
3eadaa65
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
...
...
@@ -25,7 +26,7 @@ if __name__ == '__main__':
'
batch-output
'
)
px_ilp
=
Path
.
home
()
/
'
model-server
'
/
'
ilastik
'
/
'
AF405-bodies_boundaries
.ilp
'
px_ilp
=
Path
(
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0016/pxAF405_dim8bit
.ilp
'
)
params
=
{
'
ilastik_project_file
'
:
px_ilp
.
__str__
(),
...
...
@@ -42,23 +43,36 @@ if __name__ == '__main__':
'
export_3d_patches
'
:
False
,
'
export_annotated_zstack
'
:
True
,
'
export_patch_masks
'
:
True
,
'
rescale_zmask_clip
'
:
0.01
,
'
rgb_overlay_channels
'
:
(
3
,
None
,
None
),
'
rgb_overlay_weights
'
:
(
0.5
,
1.0
,
1.0
)
}
input_files
=
get_matching_files
(
where_czi
,
'
czi
'
)
# input_files = get_matching_files(where_czi, 'czi', coord_filter={'P': (5, 10)},)
input_files
=
get_matching_files
(
where_czi
,
'
czi
'
,
coord_filter
=
{})
tif_export_params
=
{
'
channel
'
:
0
,
'
rescale_zmask_clip
'
:
0.01
,
}
# loop_workflow(
# input_files,
# where_output,
# export_single_channel_tif_from_multichannel_czi,
# tif_export_params,
# catch_and_continue=False,
# export_batch_csvs=False,
# write_intermediate_products=False,
# )
loop_workflow
(
input_files
,
where_output
,
export_
single_channel_tif
_from_multichannel_
czi
,
tif_export_
params
,
export_
patches
_from_multichannel_
zstack
,
params
,
catch_and_continue
=
False
,
export_batch_csvs
=
False
,
write_intermediate_products
=
False
,
)
print
(
'
Finished
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
extensions/chaeo/workflows.py
+
7
−
6
View file @
3eadaa65
...
...
@@ -35,6 +35,8 @@ def export_patches_from_multichannel_zstack(
export_3d_patches
=
True
,
export_annotated_zstack
=
True
,
export_patch_masks
=
True
,
rgb_overlay_channels
=
(
None
,
None
,
None
),
rgb_overlay_weights
=
(
1.0
,
1.0
,
1.0
),
)
->
Dict
:
ti
=
Timer
()
stack
=
generate_file_accessor
(
Path
(
input_file_path
))
...
...
@@ -99,13 +101,13 @@ def export_patches_from_multichannel_zstack(
make_3d
=
False
,
focus_metric
=
'
max_sobel
'
,
ch_white
=
patches_channel
,
ch_rgb_overlay
=
(
3
,
None
,
None
)
,
ch_rgb_overlay
=
rgb_overlay_channels
,
draw_bounding_box
=
False
,
bounding_box_channel
=
1
,
bounding_box_linewidth
=
2
,
# draw_contour=True,
draw_mask
=
True
,
overlay_gain
=
(
0.1
,
1.0
,
1.0
)
overlay_gain
=
rgb_overlay_weights
,
)
df_patches
=
pd
.
DataFrame
(
files
)
ti
.
click
(
'
export_2d_patches
'
)
...
...
@@ -117,7 +119,7 @@ def export_patches_from_multichannel_zstack(
if
export_2d_patches_for_training
:
files
=
export_multichannel_patches_from_zstack
(
Path
(
output_folder_path
)
/
'
2d_patches_training
'
,
stack
.
get_one_channel_data
(
4
),
stack
.
get_one_channel_data
(
patches_channel
),
zmask_meta
,
prefix
=
fstem
,
rescale_clip
=
0.001
,
...
...
@@ -127,10 +129,9 @@ def export_patches_from_multichannel_zstack(
df_patches
=
pd
.
DataFrame
(
files
)
ti
.
click
(
'
export_2d_patches
'
)
# associate 2d patches, dropping labeled objects that were not exported as patches
df
=
pd
.
merge
(
df
,
df_patches
,
left_index
=
True
,
right_on
=
'
df_index
'
).
drop
(
columns
=
'
df_index
'
)
#
df = pd.merge(df, df_patches, left_index=True, right_on='df_index').drop(columns='df_index')
# prepopulate patch UUID
df
[
'
patch_id
'
]
=
df
.
apply
(
lambda
_
:
uuid4
(),
axis
=
1
)
# df['patch_id'] = df.apply(lambda _: uuid4(), axis=1)
if
export_patch_masks
:
files
=
export_patch_masks_from_zstack
(
...
...
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