danielguterding / pytricubic Goto Github PK
View Code? Open in Web Editor NEWTricubic interpolation module for Python.
License: MIT License
Tricubic interpolation module for Python.
License: MIT License
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!
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.
You should replace 0.25 by 0.5.
Best regards.
Couple of questions about the setup of derivatives.
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?
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()
Love the library.
Original paper is freely available on late Prof Marsden's page here:
http://www.cds.caltech.edu/~marsden/bib/2005/08-LeMa2005/LeMa2005.pdf
Would be super cool to add it to the README.
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
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.