Skip to content

Commit

Permalink
Rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
msorelli committed Sep 18, 2024
1 parent 852d35b commit 4495e96
Show file tree
Hide file tree
Showing 9 changed files with 426 additions and 435 deletions.
11 changes: 5 additions & 6 deletions foa3d/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@

def foa3d(cli_args):

# load microscopy volume image or array of fiber orientation vectors
# load 3D microscopy image or 4D array of fiber orientation vectors
img, ts_msk, is_tiled, is_fiber, save_dir, tmp_dir, img_name = load_microscopy_image(cli_args)

# get resources configuration
ram, jobs = get_resource_config(cli_args)

# conduct parallel 3D Frangi-based fiber orientation analysis on batches of basic image slices
if not is_fiber:
fiber_vec_img, iso_fiber_img, px_sz, img_name \
fbr_vec_img, iso_fbr_img, px_sz, img_name \
= parallel_frangi_on_slices(img, cli_args, save_dir[0], tmp_dir, img_name,
ts_msk=ts_msk, ram=ram, jobs=jobs, is_tiled=is_tiled)

else:
fiber_vec_img, iso_fiber_img, px_sz = (img, None, None)
fbr_vec_img, iso_fbr_img, px_sz = (img, None, None)

# estimate 3D fiber ODF maps at the spatial scales of interest using concurrent workers
if cli_args.odf_res:
parallel_odf_at_scales(fiber_vec_img, iso_fiber_img, cli_args, px_sz, save_dir[1], tmp_dir, img_name, ram=ram)
parallel_odf_at_scales(fbr_vec_img, iso_fbr_img, cli_args, px_sz, save_dir[1], tmp_dir, img_name, ram=ram)

# delete temporary folder
delete_tmp_folder(tmp_dir)


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

Expand Down
4 changes: 2 additions & 2 deletions foa3d/frangi.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def compute_scaled_orientation(scale_px, img, alpha=0.001, beta=1, gamma=None, d
vesselness = compute_scaled_vesselness(eigen1, eigen2, eigen3, alpha=alpha, beta=beta, gamma=gamma)

# reject vesselness background
enhanced_img = reject_vesselness_background(vesselness, eigen2, eigen3, dark)
enhanced_img = reject_fiber_background(vesselness, eigen2, eigen3, dark)

# stack eigenvalues list
eigenval = np.stack(eigenval, axis=-1)
Expand Down Expand Up @@ -332,7 +332,7 @@ def frangi_filter(img, scales_px=1, alpha=0.001, beta=1.0, gamma=None, dark=True
return enhanced_img, fiber_vec, eigenval


def reject_vesselness_background(vesselness, eigen2, eigen3, dark):
def reject_fiber_background(vesselness, eigen2, eigen3, dark):
"""
Reject the fiber background, exploiting the sign of the "secondary"
eigenvalues λ2 and λ3.
Expand Down
Loading

0 comments on commit 4495e96

Please sign in to comment.