VirtualPlants / timagetk

3D and 2D Image processing algorithms in Python for tissues
https://virtualplants.github.io/timagetk
Other
13 stars 5 forks source link

Registration fails for SpatialImages of certain dtypes #15

Open supersubscript opened 6 years ago

supersubscript commented 6 years ago

Fails for


ValueError: NULL pointer access


------------------------------------------------------------------------------
- **np.float16** 
------------------------------------------------------------------------------
```python
Traceback (most recent call last):

  File "<ipython-input-442-7d37f3743db4>", line 49, in <module>
    images[ii-1], method='rigid_registration')

  File "/home/<user>/.local/timagetk/timagetk/plugins/registration.py", line 77, in registration
    trsf_out, res_image = rigid_registration(floating_img, reference_img)

  File "/home/<user>/.local/timagetk/timagetk/plugins/registration.py", line 94, in rigid_registration
    trsf_rig, res_rig = blockmatching(floating_img, reference_img)

  File "/home/<user>/.local/timagetk/timagetk/algorithms/blockmatching.py", line 95, in blockmatching
    img_res = BalImage(c_bal_image=c_img_res)

  File "/home/<user>/.local/timagetk/timagetk/wrapping/bal_image.py", line 310, in __init__
    self._spatial_image = self.to_spatial_image()

  File "/home/<user>/.local/timagetk/timagetk/wrapping/bal_image.py", line 324, in to_spatial_image
    return bal_image_to_spatial_image(self._c_bal_image, **kwds)

  File "/home/<user>/.local/timagetk/timagetk/wrapping/bal_image.py", line 287, in bal_image_to_spatial_image
    _ct_array = (_cdtype * size).from_address(b.data)

AttributeError: 'long' object has no attribute 'from_address'