Skip to content

add support for anisotropic values of the flow3D_smooth#1408

Open
yuriyzubov wants to merge 1 commit intoMouseLand:mainfrom
yuriyzubov:ring_artifacts
Open

add support for anisotropic values of the flow3D_smooth#1408
yuriyzubov wants to merge 1 commit intoMouseLand:mainfrom
yuriyzubov:ring_artifacts

Conversation

@yuriyzubov
Copy link

Currently flow3D_smooth only accepts a single integer, applying the same Gaussian smoothing sigma uniformly across all spatial axes (Z, Y, X).

If voxel spacing differs across axes, passing a vector value to the flow3D_smooth parameter (anisotropic smoothing) makes more sense.

Changes

  • flow3D_smooth now accepts int or list[int] (length 3)
  • If an int is passed, it is broadcast to [val, val, val] for backwards compatibility
  • Updated docstring to reflect the new accepted types

Example

# Uniform smoothing
model.eval(img, do_3D=True, flow3D_smooth=2)

# Anisotropic smoothing
model.eval(img, do_3D=True, flow3D_smooth=[3, 0, 0])  

@mrariden
Copy link
Collaborator

@yuriyzubov I think it makes more sense to scale the flow3D_smooth's first term by anisotropy inside of CellposeModel.eval(). That way anisotropy of 1 will have the same effect as it does now.

I'm testing this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants