dkazanc / larix Goto Github PK
View Code? Open in Web Editor NEWLarix - a collection of image processing tools
License: Apache License 2.0
Larix - a collection of image processing tools
License: Apache License 2.0
This pull request tomopy/tomopy#594 is for integrating the CPU 3D median filter from Larix into TomoPy. The CI in the TomoPy repo requires that there exist builds of its dependencies for macOS and Windows in addition to Linux.
When testing for tomopy/tomopy#594, it was discovered that passing a python numpy array of values whose data type is not supported by the CPU median filter module https://github.com/dkazanc/larix/blob/master/src/Core/CPU_modules/MedianFilt_core.c causes the python wrapper function to simply return None
.
For example, when the input array has dtype=np.float64
(64-bit float arrays aren't supported by Larix's CPU 3D median filter), there is no error and it instead silently fails:
>>> import numpy as np
>>> from larix.methods.misc import MEDIAN_FILT
>>> float64_data = np.ones(shape=(100, 100, 100), dtype=np.float64)
>>> float64_res = MEDIAN_FILT(float64_data, 3, 4)
>>> float64_res
>>> type(float64_res)
<class 'NoneType'>
but when the input array has dtype=np.uint16
(16-bit unsigned integer arrays are supported by Larix's CPU 3D median filter), it works as expected:
>>> uint16_data = np.ones(shape=(100, 100, 100), dtype=np.uint16)
>>> uint16_res = MEDIAN_FILT(uint16_data, 3, 4)
>>> uint16_res
array([[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]],
[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]],
[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]],
...,
[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]],
[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]],
[[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
...,
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1],
[1, 1, 1, ..., 1, 1, 1]]], dtype=uint16)
>>> type(uint16_res)
<class 'numpy.ndarray'>
This is possibly something in the python wrapper that needs to be amended, rather than the median filter C code itself?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.