ChristophKirst / ClearMap

ClearMap is a python toolbox for the analysis and registration of volumetric data from cleared tissues.
http://christophkirst.github.io/ClearMap/build/html/index.html
GNU General Public License v3.0
49 stars 40 forks source link

findCenterOfMaxima returns non integer center coordinates, which are not valid in voxelizePixel function #40

Open pderdeyn opened 4 years ago

pderdeyn commented 4 years ago

Reproduce:

  1. Set hmax to an integer in parameter file
  2. Run process script

Issue: findCenterOfMaxima returns non integer center coordinates. This causes an error in detectCellShape in the voxelizePixel function, where these coordinates are used as array indices

Potential fix: In ClearMap/ImageProcessing/MaximaDetection.py, I added a line in findCenterOfMaxima after creating the centers array (line 231) centers = numpy.rint(centers).astype(int)

Alternatively, you could keep the non integer center coordinates and convert them to integers only when using as array indices