Skip to content
Snippets Groups Projects
Commit 0c3a9a03 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Trying to run 2d kristineberg data through z-stack pipeline

parent c9dc159c
No related branches found
No related tags found
No related merge requests found
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
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(
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0016/output',
'batch-output'
)
px_ilp = Path.home() / 'model-server' / 'ilastik' / 'AF405-bodies_boundaries.ilp'
params = {
'ilastik_project_file': px_ilp.__str__(),
'pxmap_threshold': 0.25,
'pixel_class': 0,
'zmask_channel': 0,
'patches_channel': 4,
'mask_type': 'boxes',
'zmask_filters': {'area': (1e3, 1e8)},
'zmask_expand_box_by': (128, 3),
'export_pixel_probabilities': True,
'export_2d_patches_for_training': True,
'export_2d_patches_for_annotation': True,
'export_3d_patches': False,
'export_annotated_zstack': True,
'export_patch_masks': True,
}
input_files = get_matching_files(where_czi, 'czi')
loop_workflow(
input_files,
where_output,
export_patches_from_multichannel_zstack,
params,
catch_and_continue=False,
)
print('Finished')
\ No newline at end of file
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
if __name__ == '__main__':
where_czi = 'z:/rhodes/projects/proj0004-marine-photoactivation/data/exp0038/AutoMic/20230906-163415/Selection'
where_output = autonumber_new_directory(
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009/output',
'batch-output'
)
px_ilp = Path.home() / 'model-server' / 'ilastik' / 'AF405-bodies_boundaries.ilp'
params = {
'ilastik_project_file': px_ilp.__str__(),
'pxmap_threshold': 0.25,
'pixel_class': 0,
'zmask_channel': 0,
'patches_channel': 4,
'mask_type': 'boxes',
'zmask_filters': {'area': (1e3, 1e8)},
'zmask_expand_box_by': (128, 3),
'export_pixel_probabilities': False,
'export_2d_patches_for_training': True,
'export_2d_patches_for_annotation': True,
'export_3d_patches': False,
'export_annotated_zstack': False,
'export_patch_masks': True,
}
input_files = get_matching_files(where_czi, 'czi', coord_filter={'P': (0, 10)}, )
loop_workflow(
input_files,
where_output,
export_patches_from_multichannel_zstack,
params,
)
print('Finished')
\ No newline at end of file
......@@ -4,10 +4,11 @@ from extensions.chaeo.util import autonumber_new_directory, get_matching_files,
from extensions.chaeo.workflows import export_patches_from_multichannel_zstack
if __name__ == '__main__':
where_czi = 'z:/rhodes/projects/proj0004-marine-photoactivation/data/exp0038/AutoMic/20230906-163415/Selection'
# where_czi = 'z:/rhodes/projects/proj0004-marine-photoactivation/data/exp0038/AutoMic/20230906-163415/Selection'
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(
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009/output',
# 'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009/output',
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0016/output',
'batch-output'
)
......@@ -22,7 +23,7 @@ if __name__ == '__main__':
'mask_type': 'boxes',
'zmask_filters': {'area': (1e3, 1e8)},
'zmask_expand_box_by': (128, 3),
'export_pixel_probabilities': False,
'export_pixel_probabilities': True,
'export_2d_patches_for_training': True,
'export_2d_patches_for_annotation': True,
'export_3d_patches': False,
......@@ -30,6 +31,7 @@ if __name__ == '__main__':
'export_patch_masks': True,
}
# input_files = get_matching_files(where_czi, 'czi', coord_filter={'P': (0, 10)}, )
input_files = get_matching_files(where_czi, 'czi', coord_filter={'P': (0, 10)}, )
loop_workflow(
......
......@@ -38,7 +38,7 @@ def export_patches_from_multichannel_zstack(
stack = generate_file_accessor(Path(input_zstack_path))
fstem = Path(input_zstack_path).stem
ti.click('file_input')
assert stack.nz > 1, 'Expecting z-stack'
# assert stack.nz > 1, 'Expecting z-stack'
# MIP and classify pixels
mip = InMemoryDataAccessor(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment