Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] possibly issues with anisotropy in cellpose/gui/make_train.py #1076

Open
MariaTheiss opened this issue Dec 9, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@MariaTheiss
Copy link

Describe the bug
I am running make_train on a single-channel tif image with dimensions (z, y, x). I set --anisotropy = 3. When opening the resulting crops in the Cellpose GUI, anisotropy is applied to all yx, zx, and zy crops. I expected corrections for anisotropy only along the z-axis.

To Reproduce
Steps to reproduce the behavior:

  1. To check image dimensions in python:
import tifffile as tiff

# Load the TIFF file
folder = 'folder/to/image/'
file = 'example_image.tif'

file_path = folder + file
image = tiff.imread(file_path)
# Check the image shape
print(f"Image dimensions: {image.shape}")

Output:
Image dimensions: (23, 2304, 6452) (This corresponds to z, y, x)

  1. Run make_train: python make_train.py --dir directory/to/the/image --z_axis 0 --anisotropy 3
  2. To open cellpose GUI: python -m cellpose --Zstack
  3. When dragging and dropping the resulting images from directory/to/the/image/train into the cellpose GUI, all crops (YX, ZX, and ZY) are stretched along one axis.

Attached: showing anisotropy in yx (nuclei appear stretched).
anisotropy_yx

@MariaTheiss MariaTheiss added the bug Something isn't working label Dec 9, 2024
@JellyfishKz
Copy link

Hello, I have also encountered a similar problem. My problem is that during the recognition process of a 3D grayscale image with a shape of (2304 * 2304 * 10), the z-axis, x-axis, and y-axis of the grayscale image are always misread due to the logic of "If channel_axis=None cellpose will try to automatically determine the channel axis by choosing the dimension with the minimum size after squeezing. I think your problem may be similar to mine

@MariaTheiss
Copy link
Author

Hello, I have also encountered a similar problem. My problem is that during the recognition process of a 3D grayscale image with a shape of (2304 * 2304 * 10), the z-axis, x-axis, and y-axis of the grayscale image are always misread due to the logic of "If channel_axis=None cellpose will try to automatically determine the channel axis by choosing the dimension with the minimum size after squeezing. I think your problem may be similar to mine

Thank you! Did you manage to find a workaround?

@JellyfishKz
Copy link

JellyfishKz commented Dec 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants