Skip to content

Commit

Permalink
Use generators and simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
msorelli committed Nov 20, 2024
1 parent d6d33be commit a34157f
Show file tree
Hide file tree
Showing 13 changed files with 1,355 additions and 1,306 deletions.
11 changes: 5 additions & 6 deletions foa3d/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from foa3d.input import get_cli_parser, load_microscopy_image
from foa3d.pipeline import parallel_odf_over_scales, parallel_frangi_over_slices
from foa3d.pipeline import parallel_frangi_over_slices, parallel_odf_over_scales
from foa3d.printing import print_pipeline_heading
from foa3d.utils import delete_tmp_folder
from foa3d.utils import delete_tmp_data


def foa3d(cli_args):
Expand All @@ -12,15 +12,14 @@ def foa3d(cli_args):
# parallel 3D Frangi-based fiber orientation analysis on batches of basic image slices
out_img = parallel_frangi_over_slices(cli_args, save_dirs, in_img)

# generate 3D fiber ODF maps over the spatial scales of interest using concurrent workers
parallel_odf_over_scales(cli_args, save_dirs, out_img['vec'], out_img['iso'], out_img['px_sz'], in_img['name'])
# generate 3D fiber ODF maps at the spatial scales of interest using concurrent workers
parallel_odf_over_scales(cli_args, save_dirs, out_img, in_img['name'])

# delete temporary folder
delete_tmp_folder(save_dirs['tmp'], (in_img, out_img))
delete_tmp_data(save_dirs['tmp'], (in_img, out_img))


def main():
# start Foa3D by terminal
print_pipeline_heading()
foa3d(cli_args=get_cli_parser())

Expand Down
Loading

0 comments on commit a34157f

Please sign in to comment.