Giter VIP home page Giter VIP logo

larix's People

Contributors

dkazanc avatar yousefmoazzam avatar

Watchers

 avatar  avatar  avatar  avatar

larix's Issues

Add builds for macOS and Windows

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.

Silent failing of CPU 3D median filter when array of incorrect data type is passed

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.