From 948fa41c5c1f45f5fc510c64bf9c32d5ea8fb782 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Wed, 28 Mar 2018 00:14:11 +0200 Subject: [PATCH] Update Readme --- CMakeLists.txt | 2 ++ README.rst | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba62ae8..87fa953 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(TotalVariation) set(TotalVariation_LIBRARIES TotalVariation) +add_subdirectory(ThirdParty/proxTV) + if(NOT ITK_SOURCE_DIR) find_package(ITK REQUIRED) list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) diff --git a/README.rst b/README.rst index 68f8ccc..b02ff59 100644 --- a/README.rst +++ b/README.rst @@ -16,6 +16,35 @@ ITKTotalVariation |CircleCI| |TravisCI| |AppVeyor| =========== =========== =========== + TotalVariation algorithms, providing a wrap for the external project: https://github.com/albarji/proxTV ITK is an open-source, cross-platform library that provides developers with an extensive suite of software tools for image analysis. Developed through extreme programming methodologies, ITK employs leading-edge algorithms for registering and segmenting multidimensional scientific images. + +**Idea / Work in progress** + +Not ready. The motivation is that Total Variation methods from proxTV are pretty effective denoisers. +If interested, there are python and matlab wraps available from https://github.com/albarji/proxTV . +If using the proxTV python package and python ITK, you can interconnect them: + +.. code-block:: python + + import itk + import prox_tv as ptv + reader = itk.ImageFileReader.New(FileName=input_filename) + reader.Update() + image = reader.GetOutput() + image_array = itk.GetArrayViewFromImage(image) + norm = 1 + dimensions_to_penalyze = [1,2,3] + tv_array = ptv.tvgen(image_array, np.array([lam,lam,lam]), dimensions_to_penalyze, np.array([norm,norm,norm])) + tv_array = np.ascontiguousarray(tv_array, dtype=image_array.dtype) + modifiedImage = itk.GetImageViewFromArray(tv_array) + itk.ImageFileWriter.New(Input=modifiedImage, FileName=output_filename).Update() + + +- [x] Add support for CMake to proxTV. Open PR: + And the branch in my fork: +- [ ] Handle the external project. Choose between add_subdirectory, or ExternalProject_Add. Ask ITK. +- [ ] Do the actual wrapping with ITK classes. +- [ ] Profit and use TV methods in C++ with ITK.