ClearAnatomics / ClearMap

ClearMap 2 with WobblyStitcher, TubeMap and CellMap
https://clearanatomics.github.io/ClearMapDocumentation/
GNU General Public License v3.0
109 stars 46 forks source link

Resampling IndexError: tuple index out of range #118

Closed mahsa106 closed 7 months ago

mahsa106 commented 1 year ago

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 commented 1 year ago

"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 commented 10 months ago

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

crousseau commented 10 months ago

@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 commented 9 months ago

@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.