Giter Site home page Giter Site logo

pytricubic's People

Contributors

danielguterding avatar rbturnbull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pytricubic's Issues

build issue

Hi-- I'm trying to build this on mac OS 10.10.5 and getting the following error from boost:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have installed boost-1.58.0 using homebrew (brew install boost). I'm not very familiar with compiler issues and have been browsing around stackoverflow but haven't yet found anything helpful. Let me know if you have any specific suggestions!

3d image upsampling

Hi, I'm trying to upsample 3-d images with your tricubic module, but I can't figure it out even after seeing the example code.

Images I have are numpy arrays(e.g. 256x256x256) and I want to resize them to bigger sizes like 512x512x512.

Could you please provide me a code snippet showing how to do it? It will be a great help.

Thank you.

Derivates

Couple of questions about the setup of derivatives.

  • It seems the index function will will wrap around, this causing the side effect of having exactly derivatives on the left and right sides of the data. Is this on purpose?

image

  • Looking at the df/dx derivates as an example, the df(x, y, z)/dx is only dependent on f(x-1, y, z) and f(x+1, y, z), values. As a result, it will be the same of all cases, regardless of the actual value of f(x, y, z). Side effect of this is that when there are large delta between (f(x-1, y, z) - f(x, y, z)) and (f(x, y, z) - f(z+1, y, z)) the resulting spline ends up with a bump above, or drop below possible values, as in image below. I can come up with an very non-elegant solution probably, but I am wondering if you might have thoughts on this? I realize this is probably very close, but in my case small positive values turn into small negitive value, and I need to have the right sign, kind like when moving money around.

image

Store tricubic results for loading later

I have successfully implemented the tricubic code you have created and have been trying to find a way to store the resulting function from the regression and load it in a later instance to utilize the function. The current dataset used in the tricubic regression is hundreds of megabytes and in order to currently utilize tricubic, I load this dataset, run the regression and use. If I could more directly store the ip function, then I would not need to load all those megabytes of data in order to regress. This is an issue because the runtime of the code I have can be quite fast depending on the use case and the time to load the data can take several orders of magnitude longer to load making it inefficient.

The ip function cannot currently be pickled as it is a pycapsule object. Is there a way to store this data out of the pycapsule as pickle and then reload at another run?

Memory Leak

tricubic.tricubic() seems to leak memory when called repeatedly. The only way I was able to work around it was calling it in a subprocess and joining when I no longer need the interpolator. Any idea why this might be happening?

Code to reproduce issue:

import gc

import numpy as np 
import tricubic


def interp(X):
    ip = tricubic.tricubic(list(X), list(X.shape))

    # Added to try to deallocate memory
    del ip
    gc.collect()


if __name__ == "__main__":
    X = np.random.rand(100, 100, 100)
    for i in range(1000):
        interp(X)

Code that doesn't have issue:

from multiprocessing import Process

import numpy as np 
import tricubic


def interp():
    X = np.random.rand(100, 100, 100)
    ip = tricubic.tricubic(list(X), list(X.shape))


if __name__ == "__main__":
    for i in range(1000):
        p = Process(target=interp)
        p.start()
        p.join()

installation/setup error

Lekien provided a great method, so thank for creating a python implementation. I am having trouble installing it via pip. (I actually use pipenv within a specific environment.). But I get get a failure when trying to install it. Have you tried to install it lately with newer versions of things.

My Pipfile:
[packages]
scipy = ""
matplotlib = "
"
cmake = "*"

[dev-packages]

[requires]
python_version = "3.11"
python_full_version = "3.11.6"

at about line 25 within the attached file containing the error output it says,
python setup.py bdist_wheel did not run successfully.
[pipenv.exceptions.InstallError]: โ”‚ exit code: 1

Any help to get me into using the tricubic would be greatly appreciated.
Thank you,
--Andy
tricubic_install_error.txt

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.