Support conversion of complex-valued ImgLib2 images to Python
- Dominant language
- Python
- Stars
- 534
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Description
I'm not able to print FFT results with ij.py.show!
```python
import skimage
import imagej
import numpy as np
from skimage import io
import imagej
import imglyb
from jnius import cast
from jnius import autoclass
ij = imagej.init('sc.fiji:fiji:2.0.0-pre-10')
img = io.imread('https://www.fi.edu/sites/fi.live.franklinds.webair.com/files/styles/featured_large/public/General_EduRes_Heart_BloodVessels_0.jpg')
img = np.mean(img, axis=2)
print(ij.op().help('filter.fft'))
result= ij.op().filter().fft(ij.py.to_java(img))
```
Error 'JavaException: JVM exception occurred: java.util.concurrent.ExecutionException: java.lang.ClassCastException: net.imglib2.type.numeric.complex.ComplexFloatType cannot be cast to net.imglib2.type.numeric.real.AbstractRealType java.lang.RuntimeException'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the Python reproduction using ij.py.to_java(img) and the FFT operation shown in the issue. Trace how complex-valued ImgLib2 results are converted for Python, then verify that FFT output can be displayed without the ComplexFloatType/ClassCastException reported here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100