WIP: ITK initial conversion 20171210#36
WIP: ITK initial conversion 20171210#36hjmjohnson wants to merge 16 commits intoInsightSoftwareConsortium:masterfrom
Conversation
dzenanz
left a comment
There was a problem hiding this comment.
"Require CMake 3.5.2" in commit message is misleading, as the commit requires version 3.8.2.
The rest looks like a good start!
CMakeLists.txt
Outdated
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| endif() | ||
| if(NOT CMAKE_CXX_EXTENSIONS) | ||
| set(CMAKE_CXX_EXTENSIONS ON) |
There was a problem hiding this comment.
Why explicitly enable extensions? Wouldn't it be easier to write cross-platform code with compiler extensions disabled?
CMakeLists.txt
Outdated
| ##### | ||
| ## Set the default target properties for ITK | ||
| if(NOT CMAKE_CXX_STANDARD) | ||
| set(CMAKE_CXX_STANDARD 11) # Supported values are ``11``, ``14``, and ``17``. |
There was a problem hiding this comment.
Should these be made cache variables so that the user can set them and knows they are set?
dba4329 to
efbe6af
Compare
| fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake | \ | ||
| xargs sed -i '' -e \"s/${oldstring}/${newstring}/g\" | ||
|
|
||
| For a full description of the rational for this change |
| 'Continued development and maintenance of the ITK-SNAP 3D image segmentation software'." | ||
| GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKMorphologicalContourInterpolation.git | ||
| GIT_TAG 608853faf597c38132eaff8586f1f9c5c31f70aa | ||
| GIT_TAG ITKv5 |
There was a problem hiding this comment.
And until these tags are added, enabling remote modules will cause errors? That's certain to draw attention 😄
There was a problem hiding this comment.
These are not intended for long term use. I think they are being pushed now. I'll test on a secondary machine soon.
There was a problem hiding this comment.
I meant, if anyone tries building your PR he will be clearly reminded that remote modules should not be turned on 😄
| // Software Guide : EndCodeSnippet | ||
|
|
||
| virtual void GenerateData() override; | ||
| void GenerateData() override; |
There was a problem hiding this comment.
It is great you are doing this for examples too, as examples will be copied many times.
26d8fec to
d1dc3f1
Compare
|
Great job Has! here is the CircleCI build on CDash: There is just one little warning. |
|
I see the ITKv3 registration framework examples are being removed. There is not plans to remove the older v3 Registration framework? |
40a821a to
e09d721
Compare
| typedef SmartPointer<Self> Pointer; | ||
| typedef SmartPointer<const Self> ConstPointer; | ||
|
|
||
| //HACK #ifdef ITKV3_COMPATIBILITY |
CMake/itkApple.cmake
Outdated
| CMAKE_OSX_SYSROOT) | ||
|
|
||
| if (CMAKE_OSX_DEPLOYMENT_TARGET AND | ||
| CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.7") |
There was a problem hiding this comment.
OSX SDK 10.6 is the standard SDK for Python.
There was a problem hiding this comment.
@blowekamp This was copied and pasted from the VTK v9 configuration infrasturcture.
https://github.com/Kitware/VTK/blob/master/CMake/vtkApple.cmake
There was a problem hiding this comment.
I was just following their lead.
There was a problem hiding this comment.
This is now a separate patch.
13316a1 to
aa6ab2d
Compare
| add_subdirectory(Statistics) | ||
| add_subdirectory(RegistrationITKv4) | ||
|
|
||
| if(ITKV3_COMPATIBILITY) |
There was a problem hiding this comment.
I think we concluded that examples for v3 registration should remain. Just remove this if condition, and keep the examples.
|
Could you modify |
12c2b7a to
dbce04e
Compare
ITK version 5 will require C++11 syntax when building. During initial implementation of C++11 rigorously enforce C++11 language support. Require CMake 3.8.2 at a minimum version. Change-Id: I391a64b66135911acb455c539a70a01ee2e5bbf9
With CMake 3.8.2 and greater the static backwards compatibly header files can be removed in favor of dynamically creating these header files from cmake using write_compiler_detection_header Change-Id: Ia74bed1c5047dba0621fad7b56fb2ad61812c7f8
circleci environment needs to include at leasst version 3.8.2 for cmake to support ITKv5. Change-Id: I55de27c74ad515fe3ca0a4412b5cc90aaa0e41ab
The following is now always true for C++11: ITK_COMPILED_CXX_STANDARD_VERSION >= 201103L Remove contingent code compilation. Change-Id: Iee87889676c8b17d75ae109acd8cf5faab107d5e
Use clang-tidy to add ITK_OVERRIDE, and to remove redundant virtual on functions. cd ../ITK; clang-tidy -p ITK-clangtidy $(find Modules/[A-J]* -name "*.cxx" |fgrep -v ThirdParty) -checks=-*,modernize-use-override -header-filter=.* -fix clang-tidy -p ITK-clangtidy $(find Modules/[K-Z]* -name "*.cxx" |fgrep -v ThirdParty) -checks=-*,modernize-use-override -header-filter=.* -fix https://stackoverflow.com/questions/39932391/virtual-override-or-both-c When you override a function you don't technically need to write either virtual or override. The original base class declaration needs the keyword virtual to mark it as virtual. In the derived class the function is virtual by way of having the ¹same type as the base class function. However, an override can help avoid bugs by producing a compilation error when the intended override isn't technically an override. E.g. that the function type isn't exactly like the base class function. Or that a maintenance of the base class changes that function's type, e.g. adding a defaulted argument. In the same way, a virtual keyword in the derived class can make such a bug more subtle, by ensuring that the function is still is virtual in further derived classes. So the general advice is, Use virtual for the base class function declaration. This is technically necessary. Use override (only) for a derived class' override. This helps with maintenance. Change-Id: Ic99248fbd081f264fab8fe9cf0ffc0a98bace639
git grep -l "ITK_OVERRIDE" | fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/ITK_OVERRIDE/override/g" Change-Id: I1147053472d97b2d4a353fddded7571ca6243368
git grep -l \"ITK_NULLPTR\" | \ fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake | \ xargs sed -i '' -e \"s/ITK_NULLPTR/nullptr/g\"
The check converts the usage of null pointer constants (eg. NULL, 0) to use the new C++11 nullptr keyword. clang-tidy -p ITK-clangtidy $(find Modules/[A-J]* -name "*.cxx" |fgrep -v ThirdParty) -checks=-*,modernize-use-nullptr -header-filter=.* -fix clang-tidy -p ITK-clangtidy $(find Modules/[K-Z]* -name "*.cxx" |fgrep -v ThirdParty) -checks=-*,modernize-use-nullptr -header-filter=.* -fix Change-Id: Ia69b1993cdad5931a74d2bc30eafadae0460aa45
Pull over settings from VTK build so that similar configurations are used. Change-Id: I72832bf8183abc5b05bda17d30bc3d6fce027323
OSX SDK 10.6 is still the standard for python integration. Change-Id: I1bb8cdd9ccdb527a5148bdc6d55c5b18a223aaa2
Prefer to use nullptr keyword for indicating a null pointer. Change-Id: I56318fdedc7efcb6834e1e4f78dbeff127206757
Describe function overrides using the override keyword from C++11. run-clang-tidy.py -checks="-*,modernize-use-override" -header-filter=".*" -fix Change-Id: I25ed9c035c128ae22c6fbc06ad8dcbc6b518f1c7
Each threader may have a different type for the default initialization. Keep nullptr separate from the integer value of 0, and NULL. Change-Id: I3239afde505da25032bf8389ce5360195bfa79b5
In file included from ITK/Modules/Core/Mesh/src/itkMeshRegion.cxx:18: ITK/Modules/Core/Mesh/include/itkMeshRegion.h:81:32: warning: comparison 'itk::SizeValueType' (aka 'unsigned long') <= 18446744073709551615 is always true [-Wtautological-constant-compare] if ( num >= 1 ) Change-Id: I6753da58645346f56b9aea777dbbeb4a63cd8034
This change is intended to ease the burden for developers during the migration to ITKv5. Anticipating several changes needed to bring Remote modules into compliance with ITKv5. Change-Id: I8a3f2ab098d5e3a8f6b8d471075e64ccfc9b43de
Some headers from C library were deprecated in C++ and are no longer welcome in C++ codebases. Some have no effect in C++. For more details refer to the C++ 14 Standard [depr.c.headers] section. This patch replaces C standard library headers with their C++ alternatives and removes redundant ones. Change-Id: I76376c552e1d836f8909a5ea7230090e80e232ce
dbce04e to
c00dfc5
Compare
This pull request provides a starting point for ITKv5 development. This development branch will not be managed on the gerrit review system.
This set of patches is NOT intended for merging. Several iterations are anticipated.