-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding 3D wavelets from Sparse3D #52
Conversation
Getting latest version of master pysap
…d in the future (notImplemented yet)
Pull Request Test Coverage Report for Build 148
💛 - Coveralls |
The tests on Travis failed for Python 2.7: ERROR: Test all the registered transformations.Traceback (most recent call last): |
I also notice this issue when installing nose with Python 2.7: mkl-random 1.0.1 requires cython, which is not installed. |
@@ -16,5 +16,8 @@ | |||
from .tools import mr_filter | |||
from .tools import mr_deconv | |||
from .tools import mr_recons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to rename the previous tools to distinguish between 1d, 2d, and 3d transforms?
mr1d_*
mr2d_*
mr3d_*
If yes, just use the import as synthax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mr*_ binds 1D and 2D, it is not a necessity
pysap/extensions/tools.py
Outdated
if type_of_multiresolution_transform == 1: | ||
if type_of_filters == 10: | ||
raise ValueError('Wrong type of filters with orthogonal transform') | ||
if type_of_lifting_transform != 3 and\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using \ and prefer ().
pysap/extensions/tools.py
Outdated
|
||
# A trous wavelet transform | ||
if type_of_multiresolution_transform == 3: | ||
if type_of_lifting_transform != 3 and\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem.
pysap/base/transform.py
Outdated
else: | ||
self.trf = None | ||
if self.data_dim == 2: | ||
self.trf = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.trf is already set to None.
To remove.
pysap/base/transform.py
Outdated
@@ -110,8 +111,18 @@ def __init__(self, nb_scale, verbose=0, **kwargs): | |||
self.__isap_transform_id__) | |||
kwargs["number_of_scales"] = self.nb_scale | |||
self.trf = pysparse.MRTransform(**self.kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why keeping this line?
sparse2d/python/NumPyArrayData.h
Outdated
// Get the data: force cast to float | ||
// TODO: use buffer | ||
fltarray im(arr.shape(0), arr.shape(1), arr.shape(2)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line.
sparse2d/python/NumPyArrayData.h
Outdated
fltarray im(arr.shape(0), arr.shape(1), arr.shape(2)); | ||
|
||
NumPyArrayData<double> arr_data(arr); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line.
sparse2d/python/NumPyArrayData.h
Outdated
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line.
sparse2d/python/NumPyArrayData.h
Outdated
return im; | ||
} | ||
|
||
// convert functions for 3d arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment: not necessary here.
sparse2d/python/NumPyArrayData.h
Outdated
return im; | ||
} | ||
|
||
// convert functions for 3d arrays | ||
bn::ndarray image2array_3d(const fltarray& im){ | ||
// TODO: use buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the speed was important for you.
Did you try to speed up the binding using the buffer only?
It may really improve the optimization algorithms speed.
sparse2d/python/pysparse.cpp
Outdated
} | ||
|
||
} | ||
|
||
|
||
// Module property | ||
bp::scope().attr("__version__") = "0.0.1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increase the binding package version.
@@ -0,0 +1,311 @@ | |||
/*########################################################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##########################################################################
pySAP - Copyright (C) CEA, 2017 - 2018
Distributed under the terms of the CeCILL-B license, as published by
the CEA-CNRS-INRIA. Refer to the LICENSE file or to
http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
for details.
##########################################################################
#include "NumPyArrayData.h" | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one empty line.
sparse2d/python/transform_3D.hpp
Outdated
cout << " Save transform: " << save << endl; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one empty line.
Adding 3D transforms from the Sparse2D package (https://github.com/CosmoStat/Sparse2D/)
WARNING: This PR would pass only after the PR #16 of Sparse2D has passed, as it correct a memory bug vital for using the wavelets.