Comments (7)
Hello @thewtex ,
It seems to work now :) thanks a lot!
from itkanisotropicdiffusionlbr.
This
instance = itk.CoherenceEnhancingDiffusionImageFilter[itk.Image[itk.F,2]].New(rescaled_image)
Needs to be
instance = itk.CoherenceEnhancingDiffusionImageFilter[itk.Image[itk.F,2]].New(rescaled_image)
instance.Update()
or the filter is not executed, and the output is not populated. Alternatively, use ITK 5 Pythonic syntax, which determines the required type, runs .Update()
and returns the filter's output:
smoothed_image = itk.coherence_enhancing_diffusion_image_filter(rescaled_image)
Also, this does not work:
instance = itk.GetArrayViewFromImage(instance)
because it is generate a view on an image instance (i.e. a look into the image's pixel buffer memory), but then it is overwriting the image instance. The view will not be pointing to anything that exists, which will cause a crash. Instead, use:
instance = itk.GetArrayFromImage(instance)
or the nicer:
instance = itk.array_from_image(instance)
from itkanisotropicdiffusionlbr.
itk.array_from_image(instance)
@thewtex Awesome!! Thank you very much, it really saved me a lot of time.
Thanks again for the fast and helpful answers!
from itkanisotropicdiffusionlbr.
Hello Dimitris @dimitrisl ,
A new version, 1.0.2, built against itk-5.0.0.post1 has been uploaded to PyPI, which should fix your segmentation fault issue.
Please try:
python -m pip install --upgrade itk-anisotropicdiffusionlbr
and let us know how it goes.
from itkanisotropicdiffusionlbr.
hello again @thewtex
it seems that another issue occured.
In [5]: instance = itk.CoherenceEnhancingDiffusionImageFilter(rescaled_image)
Segmentation fault (core dumped)
from itkanisotropicdiffusionlbr.
@dimitrisl could a SSCCE be shared?
from itkanisotropicdiffusionlbr.
import matplotlib.pyplot as plt
import numpy as np
import itk
image = np.random.randn(1517, 1501).astype("float32")
rescaled_image = (image - np.min(image))/np.ptp(image)
rescaled_image = itk.GetImageViewFromArray(rescaled_image)
instance = itk.CoherenceEnhancingDiffusionImageFilter[itk.Image[itk.F,2]].New(rescaled_image)
instance = itk.GetArrayViewFromImage(instance)
plt.imshow(instance) # essentially it breaks on this point here..but this behaviour is not consistent
plt.show()
from itkanisotropicdiffusionlbr.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itkanisotropicdiffusionlbr.