Skip to content
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

Strip trailing spaces and convert tabs to spaces #157

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMake/CTestCustom.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"SlicerExecutionModel"
"SimpleITK"

".*has no symbols",
".*has no symbols",
"CMake Warning:",
"note: expanded from macro",
": note:",
Expand Down
2 changes: 1 addition & 1 deletion CMake/ExternalProjectGenerateProjectDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ if(NOT license_found)
message(AUTHOR_WARNING \"${name}: Could not find a license file\")
endif()
")

ExternalProject_Add_Step(${projectname} generate_project_description
COMMAND ${CMAKE_COMMAND} -P ${script}
COMMENT "Generate ${generated_version_file} and ${generated_license_file}"
Expand Down
46 changes: 22 additions & 24 deletions CMake/ITKSetStandardCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0)
cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
check_pie_supported()
cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
check_pie_supported()
endif()

function(check_c_compiler_flags c_flag_var)
set(local_c_flags "")
set(flag_list "${ARGN}")
foreach(flag IN LISTS flag_list)
string(REPLACE "=" "_" flag_var ${flag} )
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag_var})
else()
check_c_compiler_flag(${flag} C_HAS_WARNING${flag_var})
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag_var})
else()
check_c_compiler_flag(${flag} C_HAS_WARNING${flag_var})
endif()
if(${C_HAS_WARNING${flag_var}})
set(local_c_flags "${local_c_flags} ${flag}")
endif()
Expand All @@ -52,11 +52,11 @@ function(check_cxx_compiler_flags cxx_flag_var)
set(flag_list "${ARGN}")
foreach(flag IN LISTS flag_list)
string(REPLACE "=" "_" flag_var ${flag} )
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag_var})
else()
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag_var})
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag_var})
else()
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag_var})
endif()
if(${CXX_HAS_WARNING${flag_var}})
set(local_cxx_flags "${local_cxx_flags} ${flag}")
endif()
Expand Down Expand Up @@ -209,7 +209,7 @@ macro(check_compiler_platform_flags)
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
)
endif()
# With MS compilers on Win64, we need the /bigobj switch, else generated
# code results in objects with number of sections exceeding object file
Expand Down Expand Up @@ -243,11 +243,11 @@ macro(check_compiler_platform_flags)
# if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
# BUILD_SHARED_LIBS works as it would on other systems
if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
if(BUILD_SHARED_LIBS)
set(ITK_LIBRARY_BUILD_TYPE "SHARED")
else()
set(ITK_LIBRARY_BUILD_TYPE "STATIC")
endif()
if(BUILD_SHARED_LIBS)
set(ITK_LIBRARY_BUILD_TYPE "SHARED")
else()
set(ITK_LIBRARY_BUILD_TYPE "STATIC")
endif()
# turn off BUILD_SHARED_LIBS as ITK_LIBRARY_BUILD_TYPE
# is used on the libraries that have markup.
set(BUILD_SHARED_LIBS OFF)
Expand All @@ -258,7 +258,7 @@ macro(check_compiler_platform_flags)
#-----------------------------------------------------------------------------
#ITK requires special compiler flags on some platforms.
if(CMAKE_COMPILER_IS_GNUCXX)

# GCC's -Warray-bounds has been shown to throw false positives with -O3 on 4.8.
if(UNIX AND (
("${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "4.8") OR
Expand Down Expand Up @@ -288,7 +288,7 @@ macro(check_compiler_platform_flags)
endif()
endif()
endif()

if(APPLE)
option(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
mark_as_advanced(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
Expand Down Expand Up @@ -341,8 +341,7 @@ macro(check_compiler_platform_flags)
endif()
endif()
endif()



# mingw thread support
if(MINGW)
set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mthreads")
Expand Down Expand Up @@ -397,7 +396,6 @@ mark_as_advanced(${PROJECT_NAME}_C_WARNING_FLAGS)
unset(C_WARNING_FLAGS)
unset(CXX_WARNING_FLAGS)


if(NOT ${PROJECT_NAME}_C_OPTIMIZATION_FLAGS OR NOT ${PROJECT_NAME}_CXX_OPTIMIZATION_FLAGS ) # Only check once if not explicitly set on command line
#-----------------------------------------------------------------------------
#Check the set of warning flags the compiler supports
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mark_as_advanced(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Required by Slicer extension build system for reasons. See
# https://github.com/Slicer/Slicer/commit/b160ec13f276a86306513954ef8b08a5332afc2e
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};RuntimeLibraries;/")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};RuntimeLibraries;/")

#-----------------------------------------------------------------------------
# Superbuild script
Expand Down
2 changes: 1 addition & 1 deletion CompressedSensing/CompressedSensing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<documentation-url>http://www.na-mic.org/Wiki/index.php/2014_Project_Week:DWIDispersion</documentation-url>
<license>Slicer</license>
<contributor>Peter Savadjiev (BWH), Hans J. Johnson, Kent Williams (UIowa)</contributor>
<acknowledgements><![CDATA[Peter Savadjiev (1); Yogesh Rathi (1); Hans Johnson(2); Kent Williams(2); 1= Brigham and Women's Hospital, Harvard Medical School, 2=University of Iowa]]> </acknowledgements>
<acknowledgements><![CDATA[Peter Savadjiev (1); Yogesh Rathi (1); Hans Johnson(2); Kent Williams(2); 1= Brigham and Women's Hospital, Harvard Medical School, 2=University of Iowa]]> </acknowledgements>

<parameters advanced="false">
<label>I/O</label>
Expand Down
6 changes: 3 additions & 3 deletions CompressedSensing/HARDICompressedSensing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<documentation-url></documentation-url>
<license>Slicer</license>
<contributor>Yogesh Rathi (BWH), Hans J. Johnson (UIowa)</contributor>
<acknowledgements><![CDATA[Yogesh Rathi (1); Hans Johnson(2); Peter Savadjiev (1); 1= Brigham and Women's Hospital, Harvard Medical School, 2=University of Iowa]]> </acknowledgements>
<acknowledgements><![CDATA[Yogesh Rathi (1); Hans Johnson(2); Peter Savadjiev (1); 1= Brigham and Women's Hospital, Harvard Medical School, 2=University of Iowa]]> </acknowledgements>

<parameters advanced="false">
<label>IO</label>
<description><![CDATA[Input/output parameters]]></description>
<image type="diffusion-weighted">
<name>inputDWIVolume</name>
<flag>i</flag>
<longflag>inputDWIVolume</longflag>
<longflag>inputDWIVolume</longflag>
<label>Input DWI Volume</label>
<channel>input</channel>
<index>0</index>
Expand Down Expand Up @@ -70,5 +70,5 @@
<channel>output</channel>
<description><![CDATA[If you choose to save the coefficients, please select the output text file.]]></description>
</file>
</parameters>
</parameters>
</executable>
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ We present a framework which uses an unscented Kalman filter for performing
tractography. At each point on the fiber the most consistent direction is found
as a mixture of previous estimates and of the local model.

It is very easy to expand the framework and to implement new fiber representations
for it. Currently it is possible to tract fibers using two different 1-, 2-, or 3-tensor
methods. Both methods use a mixture of Gaussian tensors. One limits the diffusion
ellipsoids to a cylindrical shape (the second and third eigenvalue are assumed to be
It is very easy to expand the framework and to implement new fiber representations
for it. Currently it is possible to tract fibers using two different 1-, 2-, or 3-tensor
methods. Both methods use a mixture of Gaussian tensors. One limits the diffusion
ellipsoids to a cylindrical shape (the second and third eigenvalue are assumed to be
identical) and the other one uses a full tensor representation.

__Authors__:
Expand Down Expand Up @@ -76,18 +76,18 @@ Basic Usage
### 1. As Command Line Module

The executable is called 'UKFTractography'. It can be found in:

<build-dir>/UKFTractography-build/UKFTractography/bin/

In order to see all options run.

./UKFTractography --help
./UKFTractography --help

In the source directory of the project you will find a shell script called 'sample_run.sh'
It should give you an idea of what a function call could look like.
It should give you an idea of what a function call could look like.

Files dataset_Mask.nrrd and seeds_full_cc.nrrd in Input folder are mask and seed files of subject 100307
in hcp dataset, download the subject's preprocessed diffusion MRI data from https://db.humanconnectome.org/
in hcp dataset, download the subject's preprocessed diffusion MRI data from https://db.humanconnectome.org/

### 2. As Slicer 4 module

Expand Down
72 changes: 41 additions & 31 deletions SuperBuild/External_Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,44 +61,44 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}"

if(MSVC)
if(MSVC_VERSION GREATER_EQUAL 1400 AND MSVC_VERSION LESS 1500)
list(APPEND Boost_b2_Command toolset=msvc-8.0)
list(APPEND Boost_b2_Command toolset=msvc-8.0)
elseif(MSVC_VERSION GREATER_EQUAL 1500 AND MSVC_VERSION LESS 1600)
list(APPEND Boost_b2_Command toolset=msvc-9.0)
list(APPEND Boost_b2_Command toolset=msvc-9.0)
elseif(MSVC_VERSION GREATER_EQUAL 1600 AND MSVC_VERSION LESS 1700)
list(APPEND Boost_b2_Command toolset=msvc-10.0)
list(APPEND Boost_b2_Command toolset=msvc-10.0)
elseif(MSVC_VERSION GREATER_EQUAL 1700 AND MSVC_VERSION LESS 1800)
list(APPEND Boost_b2_Command toolset=msvc-11.0)
list(APPEND Boost_b2_Command toolset=msvc-11.0)
elseif(MSVC_VERSION GREATER_EQUAL 1800 AND MSVC_VERSION LESS 1900)
list(APPEND Boost_b2_Command toolset=msvc-12.0)
list(APPEND Boost_b2_Command toolset=msvc-12.0)
elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS 1910)
list(APPEND Boost_b2_Command toolset=msvc-14.0)
list(APPEND Boost_b2_Command toolset=msvc-14.0)
elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
list(APPEND Boost_b2_Command toolset=msvc-14.1)
list(APPEND Boost_b2_Command toolset=msvc-14.1)
elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1927)
list(APPEND Boost_b2_Command toolset=msvc-14.2)
else()
message(FATAL_ERROR "Unknown MSVC compiler version [${MSVC_VERSION}]")
endif()
list(APPEND Boost_b2_Command toolset=msvc-14.2)
else()
message(FATAL_ERROR "Unknown MSVC compiler version [${MSVC_VERSION}]")
endif()
endif()

if(XCODE_VERSION OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
list(APPEND Boost_b2_Command toolset=clang)
elseif(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND Boost_b2_Command toolset=gcc)
endif()

if(ENV{CC})
# CMake apprarently puts the full path of the compiler into CC
# The user might specify a non-default gcc compiler through ENV
message(STATUS "ENV{CC}=$ENV{CC}")
get_filename_component( gccToolset "$ENV{CC}" NAME )

# see: https://svn.boost.org/trac/boost/ticket/5917
string(TOLOWER ${gccToolset} gccToolset)
if(gccToolset STREQUAL "cc")
set(gccToolset "gcc")
endif()
list(APPEND Boost_b2_Command toolset=${gccToolset})
message(STATUS "ENV{CC}=$ENV{CC}")
get_filename_component( gccToolset "$ENV{CC}" NAME )

# see: https://svn.boost.org/trac/boost/ticket/5917
string(TOLOWER ${gccToolset} gccToolset)
if(gccToolset STREQUAL "cc")
set(gccToolset "gcc")
endif()
list(APPEND Boost_b2_Command toolset=${gccToolset})
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcfr , I do not think this PR is still right. Lines 93-101 should be inside the 90's if block.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jean, would you like me to hand-correct it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good morning @jcfr :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jcfr ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jcfr ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jcfr ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jcfr ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jcfr ...


if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand All @@ -107,16 +107,26 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}"
set(Boost_address_model 32)
endif()

ExternalProject_Add(${proj}
${${proj}_EP_ARGS}
BUILD_IN_SOURCE 1
URL ${Boost_url}
URL_MD5 ${Boost_md5}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${Boost_Bootstrap_Command} --prefix=${Boost_Install_Dir}/lib
BUILD_COMMAND ${Boost_b2_Command} install -j8 --prefix=${Boost_Install_Dir} --with-thread --with-filesystem --with-system --with-date_time --with-program_options --with-atomic address-model=${Boost_address_model} link=static
INSTALL_COMMAND ""
)
ExternalProject_Add(${proj}
${${proj}_EP_ARGS}
BUILD_IN_SOURCE 1
URL ${Boost_url}
URL_MD5 ${Boost_md5}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${Boost_Bootstrap_Command}
--prefix=${Boost_Install_Dir}/lib
BUILD_COMMAND ${Boost_b2_Command} install -j8
--prefix=${Boost_Install_Dir}
--with-thread
--with-filesystem
--with-system
--with-date_time
--with-program_options
--with-atomic
address-model=${Boost_address_model}
link=static
INSTALL_COMMAND ""
)

if(NOT WIN32)
set(BOOST_ROOT ${Boost_Install_Dir})
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(NOT DEFINED ITK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
SOURCE_DIR ${EP_SOURCE_DIR}
BINARY_DIR ${EP_BINARY_DIR}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_SlicerExecutionModel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if(NOT DEFINED SlicerExecutionModel_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM
CMAKE_ARGS -Wno-dev --no-warn-unused-cli
CMAKE_CACHE_ARGS
${COMMON_EXTERNAL_PROJECT_ARGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
-DITK_DIR:PATH=${ITK_DIR}
-DSlicerExecutionModel_LIBRARY_PROPERTIES:STRING=${Slicer_LIBRARY_PROPERTIES}
Expand Down
4 changes: 2 additions & 2 deletions SuperBuild/External_VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ endif()
# For MinGW for case of compilation failure cause of 'too many sections' error
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if(MINGW)
set(ep_common_cxx_flags "${ep_common_cxx_flags} -Wa,-mbig-obj")
set(ep_common_cxx_flags "${ep_common_cxx_flags} -Wa,-mbig-obj")
elseif(MSVC)
set(ep_common_cxx_flags "${ep_common_cxx_flags} /bigobj")
set(ep_common_cxx_flags "${ep_common_cxx_flags} /bigobj")
endif()
endif()

Expand Down
10 changes: 5 additions & 5 deletions SuperBuild/External_zlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ if(NOT DEFINED zlib_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
set(ZLIB_ROOT ${zlib_DIR})
set(ZLIB_INCLUDE_DIR ${zlib_DIR}/include)
if(WIN32)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") #to make compatible with msys2 gcc build
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/zlib.lib)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") #to make compatible with msys2 gcc build
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/zlib.lib)
endif()
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
endif()
Expand Down
12 changes: 6 additions & 6 deletions UKFTractography.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ endif()

#-----------------------------------------------------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common)
set(UKF_STATIC)
if(NOT BUILD_SHARED_LIBS)
set(UKF_STATIC 1)
if(WIN32)
add_definitions("-DUKF_STATIC")
endif()
set(UKF_STATIC)
if(NOT BUILD_SHARED_LIBS)
set(UKF_STATIC 1)
if(WIN32)
add_definitions("-DUKF_STATIC")
endif()
endif()
add_subdirectory(ukf)
add_subdirectory(UKFTractography)
Expand Down
Loading
Loading