diff --git a/CMakeLists.txt b/CMakeLists.txt index fda6e86..7d2379e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,11 @@ cmake_minimum_required(VERSION 3.10.2) project(TotalVariation) -set(TotalVariation_LIBRARIES TotalVariation) +if(ITK_USE_SYSTEM_proxTV) + set(TotalVariation_LIBRARIES proxTV::proxTV) +else() + set(TotalVariation_LIBRARIES proxTV) +endif() set(${PROJECT_NAME}_THIRD_PARTY 1) @@ -116,6 +120,7 @@ if(${_populate_include_dirs_for_swig}) set(TotalVariation_INCLUDE_DIRS ${proxTV_INCLUDE_DIRS_STRIP}) endif() + # Populate module variables if(NOT ITK_SOURCE_DIR) include(ITKModuleExternal) @@ -124,5 +129,6 @@ else() itk_module_impl() endif() + # Add the proxTV library to Modules/Targets/TotalVariationTargets.cmake itk_module_target(${_proxTV_lib} NO_INSTALL) diff --git a/README.rst b/README.rst index 77a33ca..292f072 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,6 @@ ITK provides wrapping for Windows, macOS and Linux: import itk Dimension = 3 I = itk.Image[itk.F, Dimension] - # file_name="/tmp/img.nrrd" reader = itk.ImageFileReader[I].New(FileName=file_name) reader.Update() image = reader.GetOutput() @@ -29,7 +28,6 @@ ITK provides wrapping for Windows, macOS and Linux: output_file_name="/tmp/tvout.nrrd" itk.imwrite(tv.GetOutput(), output_file_name) - Examples of 3D image denoised Original: @@ -52,7 +50,7 @@ Denoised: And the branch in my fork: - [x] Uses CMake FetchContent to download the third party proxTV. - [x] Do the actual wrapping with ITK classes. -- [ ] Check that python module: itk-totalvariation works for: +- [x] Check that python module: itk-totalvariation works for: - [x] Linux - [x] Mac - [ ] Windows diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 242ef43..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(TotalVariation_SRCS - itkProxTVImageFilter.cxx - ) - -itk_module_add_library(TotalVariation ${TotalVariation_SRCS}) -# TODO: Remove debug messages -message(STATUS "proxTV_lib: ${_proxTV_lib}") -if(TARGET ${_proxTV_lib}) - message(STATUS "proxTV_lib: ${_proxTV_lib} TARGET EXISTS") -else() - message(STATUS "proxTV_lib: ${_proxTV_lib} TARGET DOES NOT EXISTS") -endif() -target_link_libraries(TotalVariation PUBLIC ${_proxTV_lib}) diff --git a/src/itkProxTVImageFilter.cxx b/src/itkProxTVImageFilter.cxx deleted file mode 100644 index 32ce313..0000000 --- a/src/itkProxTVImageFilter.cxx +++ /dev/null @@ -1,19 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *=========================================================================*/ - -#include "itkProxTVImageFilter.h"