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

Resampling IndexError: tuple index out of range #118

Closed
mahsa106 opened this issue Nov 9, 2022 · 4 comments
Closed

Resampling IndexError: tuple index out of range #118

mahsa106 opened this issue Nov 9, 2022 · 4 comments

Comments

@mahsa106
Copy link

mahsa106 commented Nov 9, 2022

Hi,

while trying to run TubeMap or CellMap, I get the following error:

Screenshot from 2022-11-09 00-56-09

The stitching process seems to go smoothly and I get stuck in resampling. In the file ClearMap/Alignment/Resampling.py, variables such as "source_shapeO", "source_resolutionO" or "sink_resolution" are arrays of size 1x3, but ndim can reach values of 5. Hence the lines such as:

sink_shape = tuple([int(np.ceil(source_shapeO[i] * float(source_resolutionO[i])/float(sink_resolution[i]))) for i in range(ndim)]);

cause the error. What could be the root issue? Is ndim supposed to be higher than 3?

@crousseau
Copy link
Collaborator

"Is ndim supposed to be higher than 3?", well definitely not more than 4 (with color)
This can happen in different situations unfortunately and is a reason for us to envision to work on the IO library when we are less busy with the next release.
Make sure that your paths are correct. I have see this happen for example when the channels were swapped between "raw" and "autofluorescence"

@hhbw16
Copy link

hhbw16 commented Jan 2, 2024

Hi,
Is the problem solved yet?
I'm facing exactly the same error, while my paths and channels are confirmed to be correct.

@crousseau
Copy link
Collaborator

@hhbw16 this can happen with incorrectly read metadata from tiff.
I just pushed to master a bugfix that was up untill now only on dev.
I hope this fixes it. If not, could you provide more info re the organisation of your raw data (i.e. pattern)

@hhbw16
Copy link

hhbw16 commented Jan 16, 2024

@crousseau thanks for your advice,
I just reorganized my tiff datas to the same format as the test datas on OSF(each tiff file contains only one image) and the porblem is solved.

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

3 participants