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

Horizon fails with a single channel 4D volume #3112

Open
pjsjongsung opened this issue Mar 9, 2024 · 2 comments
Open

Horizon fails with a single channel 4D volume #3112

pjsjongsung opened this issue Mar 9, 2024 · 2 comments

Comments

@pjsjongsung
Copy link
Contributor

Description

The recent change of code for detecting unique values uses image shape for sampling random integers. This will throw an error when dealing with single channel 4D volumes since it would try to sample from a range of 0 to 0.

Way to reproduce

from dipy.viz.horizon.app import horizon
from dipy.io.image import load_nifti

image, affine = load_nifti(some_file_path_with_single_channel)

horizon(images=[(image, affine)])
@Garyfallidis
Copy link
Contributor

Garyfallidis commented Mar 9, 2024

Do you mean with data that have the following shape? For example (128, 128, 65, 1)?

@Garyfallidis
Copy link
Contributor

People can currently use dipy_split to get the "first" volume. But indeed this should be fixed.

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

No branches or pull requests

2 participants