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

Ran two more porto sets through pipeline

parent 07c9e0e3
No related branches found
No related tags found
No related merge requests found
from pathlib import Path
from model_server.util import autonumber_new_directory, get_matching_files, loop_workflow
from extensions.chaeo.ecotaxa import write_ecotaxa_tsv
from extensions.chaeo.workflows import export_patches_from_multichannel_zstack
from extensions.ilastik.models import IlastikPixelClassifierModel
if __name__ == '__main__':
sample_id = '20231023-porto-live'
root = Path('c:/Users/rhodes/projects/proj0012-trec-handoff/owncloud-sync/TREC-HD/Images/')
where_czi = (root / 'TREC_STOP_26_Porto/231023_automic/20231023-182725_Live/LowZoom').__str__()
where_output = autonumber_new_directory(
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0021/output',
'batch-output'
)
px_ilp = Path('c:/Users/rhodes/projects/proj0011-plankton-seg/exp0017/pxAF405_dim8bit.ilp').__str__()
params = {
'pxmap_threshold': 0.25,
'pxmap_foreground_channel': 0,
'segmentation_channel': 0,
'zmask_zindex': None,
'patches_channel': 2,
'zmask_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,
'zmask_clip': 0.01,
'rgb_overlay_channels': (1, None, None),
'rgb_overlay_weights': (0.2, 1.0, 1.0),
'draw_label_on_zstack': True,
}
input_files = get_matching_files(where_czi, 'czi', coord_filter={})
loop_workflow(
input_files,
where_output,
export_patches_from_multichannel_zstack,
[IlastikPixelClassifierModel(params={'project_file': Path(px_ilp)})],
params,
catch_and_continue=False,
)
csv_path = (Path(where_output) / 'workflow_data.csv').__str__()
write_ecotaxa_tsv(csv_path, where_output, sample_id=sample_id, scope_id='EMBL-MS-Zeiss-LSM900')
print('Finished')
\ No newline at end of file
from pathlib import Path
from model_server.util import autonumber_new_directory, get_matching_files, loop_workflow
from extensions.chaeo.ecotaxa import write_ecotaxa_tsv
from extensions.chaeo.workflows import export_patches_from_multichannel_zstack
from extensions.ilastik.models import IlastikPixelClassifierModel
if __name__ == '__main__':
sample_id = '20231026-porto'
root = Path('c:/Users/rhodes/projects/proj0012-trec-handoff/owncloud-sync/TREC-HD/Images/')
where_czi = (root / 'TREC_STOP_26_Porto/231026_automic/20231026-152512_lowzoom_data/LowZoom').__str__()
where_output = autonumber_new_directory(
'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0022/output',
'batch-output'
)
px_ilp = Path('c:/Users/rhodes/projects/proj0011-plankton-seg/exp0017/pxAF405_dim8bit.ilp').__str__()
params = {
'pxmap_threshold': 0.25,
'pxmap_foreground_channel': 0,
'segmentation_channel': 0,
'zmask_zindex': None,
'patches_channel': 2,
'zmask_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,
'zmask_clip': 0.01,
'rgb_overlay_channels': (1, None, None),
'rgb_overlay_weights': (0.2, 1.0, 1.0),
'draw_label_on_zstack': True,
}
input_files = get_matching_files(where_czi, 'czi', coord_filter={})
loop_workflow(
input_files,
where_output,
export_patches_from_multichannel_zstack,
[IlastikPixelClassifierModel(params={'project_file': Path(px_ilp)})],
params,
catch_and_continue=False,
)
csv_path = (Path(where_output) / 'workflow_data.csv').__str__()
write_ecotaxa_tsv(csv_path, where_output, sample_id=sample_id, scope_id='EMBL-MS-Zeiss-LSM900')
print('Finished')
\ No newline at end of file
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