From 36638248e5c8200378a0bdd20bf0f53cfa8fd07f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 13 Jan 2023 05:01:06 -0500 Subject: [PATCH 1/3] STYLE: Strip trailing spaces --- CMake/CTestCustom.cmake.in | 2 +- ...nalProjectGenerateProjectDescription.cmake | 2 +- CMake/ITKSetStandardCompilerFlags.cmake | 8 ++--- CompressedSensing/CompressedSensing.xml | 2 +- CompressedSensing/HARDICompressedSensing.xml | 6 ++-- README.md | 16 +++++----- .../Testing/generate_ground_truth.sh | 16 +++++----- UKFTractography/UKFTractography.xml | 4 +-- fibertractdispersion/computedispersion.cxx | 2 +- fibertractdispersion/fibertractdispersion.xml | 2 +- vtk2mask/vtk2mask.xml | 26 ++++++++-------- vtkFilter/vtkFilter.xml | 30 +++++++++---------- 12 files changed, 58 insertions(+), 58 deletions(-) diff --git a/CMake/CTestCustom.cmake.in b/CMake/CTestCustom.cmake.in index 6c54a23..8c103b1 100644 --- a/CMake/CTestCustom.cmake.in +++ b/CMake/CTestCustom.cmake.in @@ -297,7 +297,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "SlicerExecutionModel" "SimpleITK" - ".*has no symbols", + ".*has no symbols", "CMake Warning:", "note: expanded from macro", ": note:", diff --git a/CMake/ExternalProjectGenerateProjectDescription.cmake b/CMake/ExternalProjectGenerateProjectDescription.cmake index 370d0e7..a21a951 100644 --- a/CMake/ExternalProjectGenerateProjectDescription.cmake +++ b/CMake/ExternalProjectGenerateProjectDescription.cmake @@ -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}" diff --git a/CMake/ITKSetStandardCompilerFlags.cmake b/CMake/ITKSetStandardCompilerFlags.cmake index 9989c8c..ac7db96 100644 --- a/CMake/ITKSetStandardCompilerFlags.cmake +++ b/CMake/ITKSetStandardCompilerFlags.cmake @@ -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 @@ -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) @@ -341,8 +341,8 @@ macro(check_compiler_platform_flags) endif() endif() endif() - - + + # mingw thread support if(MINGW) set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mthreads") diff --git a/CompressedSensing/CompressedSensing.xml b/CompressedSensing/CompressedSensing.xml index acdcf77..bfa3a14 100644 --- a/CompressedSensing/CompressedSensing.xml +++ b/CompressedSensing/CompressedSensing.xml @@ -7,7 +7,7 @@ http://www.na-mic.org/Wiki/index.php/2014_Project_Week:DWIDispersion Slicer Peter Savadjiev (BWH), Hans J. Johnson, Kent Williams (UIowa) - + diff --git a/CompressedSensing/HARDICompressedSensing.xml b/CompressedSensing/HARDICompressedSensing.xml index 9ced516..88d043c 100644 --- a/CompressedSensing/HARDICompressedSensing.xml +++ b/CompressedSensing/HARDICompressedSensing.xml @@ -7,7 +7,7 @@ Slicer Yogesh Rathi (BWH), Hans J. Johnson (UIowa) - + @@ -15,7 +15,7 @@ inputDWIVolume i - inputDWIVolume + inputDWIVolume input 0 @@ -70,5 +70,5 @@ output - + diff --git a/README.md b/README.md index b6f4743..1526d0f 100644 --- a/README.md +++ b/README.md @@ -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__: @@ -76,18 +76,18 @@ Basic Usage ### 1. As Command Line Module The executable is called 'UKFTractography'. It can be found in: - + /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 diff --git a/UKFTractography/Testing/generate_ground_truth.sh b/UKFTractography/Testing/generate_ground_truth.sh index 86291b0..f7f97bc 100755 --- a/UKFTractography/Testing/generate_ground_truth.sh +++ b/UKFTractography/Testing/generate_ground_truth.sh @@ -14,28 +14,28 @@ seeds_path='Data/Input/seed.nhdr' ## 1T diff_im_path='Data/Input/single_tensor.nhdr' output_path='Data/Baseline/1T_fiber.vtk' -my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path +my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path --seedsPerVoxel 1 --numTensor 1 --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 --recordNMSE" eval $my_command ## 1T - fw diff_im_path='Data/Input/single_tensor_fw.nhdr' output_path='Data/Baseline/1T_fw_fiber.vtk' -my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path ---seedsPerVoxel 1 --numTensor 1 --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 --freeWater --recordFreeWater --recordNMSE" +my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path +--seedsPerVoxel 1 --numTensor 1 --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 --freeWater --recordFreeWater --recordNMSE" eval $my_command - + ## 2T diff_im_path='Data/Input/two_tensor.nhdr' output_path='Data/Baseline/2T_fiber.vtk' -my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path +my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path --seedsPerVoxel 1 --numTensor 2 --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 --stoppingFA 0.10 --stoppingThreshold 0.05 --Qm 0.001 --Ql 10 --Rs 0.015 --recordNMSE" eval $my_command -# +# ## 2T - fw diff_im_path='Data/Input/two_tensor_fw.nhdr' output_path='Data/Baseline/2T_fw_fiber.vtk' -my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path +my_command="$ukf_path --dwiFile $diff_im_path --maskFile $mask_path --tracts $output_path --seedsFile $seeds_path --seedsPerVoxel 1 --numTensor 2 --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 --freeWater --recordFreeWater --recordNMSE --stoppingFA 0.10 --stoppingThreshold 0.05 --Qm 0.01 --Ql 10 --Rs 0.015" eval $my_command - + diff --git a/UKFTractography/UKFTractography.xml b/UKFTractography/UKFTractography.xml index 0acbad4..8252391 100644 --- a/UKFTractography/UKFTractography.xml +++ b/UKFTractography/UKFTractography.xml @@ -147,7 +147,7 @@ Tractography parameter used in all models. Step size when conducting tractography. Default: 0.3. Range: 0.1-1. 0.3 - + 0.1 1 0.1 @@ -438,7 +438,7 @@ Develop/Debug Only: Write tract file as ASCII text format. Default is not ASCII. Default tracts are written on VTK binary data file. false - + writeUncompressedTracts u diff --git a/fibertractdispersion/computedispersion.cxx b/fibertractdispersion/computedispersion.cxx index ec60a05..af868c4 100644 --- a/fibertractdispersion/computedispersion.cxx +++ b/fibertractdispersion/computedispersion.cxx @@ -674,7 +674,7 @@ computedispersion(fiberbundle &bundle, double scale, MatrixType DDFOutput = dispersionDistributionValues.row(numberOfSamplingDirections); // - // So the 'punt' to handle sub-sampling is that any fibers skipped + // So the 'punt' to handle sub-sampling is that any fibers skipped for(unsigned int i = 0, curPoint = 0; i < fibers.size(); ++i) { Fiber &curFiber = fibers[i]; diff --git a/fibertractdispersion/fibertractdispersion.xml b/fibertractdispersion/fibertractdispersion.xml index d1cd246..379bad5 100644 --- a/fibertractdispersion/fibertractdispersion.xml +++ b/fibertractdispersion/fibertractdispersion.xml @@ -7,7 +7,7 @@ http://www.na-mic.org/Wiki/index.php/2014_Project_Week:DWIDispersion Slicer Peter Savadjiev (BWH), Hans J. Johnson, Kent Williams (UIowa) - + diff --git a/vtk2mask/vtk2mask.xml b/vtk2mask/vtk2mask.xml index 23a0cd3..67ed361 100644 --- a/vtk2mask/vtk2mask.xml +++ b/vtk2mask/vtk2mask.xml @@ -14,11 +14,11 @@ Yogesh Rathi, Christian Baumgartner - + Input - + ReferenceFile ReferenceFile @@ -26,7 +26,7 @@ input Used to embed the outputs in the right coordinate system. - + FiberFile FiberFile @@ -34,7 +34,7 @@ input The fibers from which the scalars will be extracted - + LabelFile LabelFile @@ -42,7 +42,7 @@ input An optional label file, if only one ROI has to be extracted. Use with --LabelOfInterest. - + LabelOfInterest LabelOfInterest @@ -52,11 +52,11 @@ - + Output - + ScalarName ScalarName @@ -64,29 +64,29 @@ Choose the name of the scalar attached to the VTK File - + OutputVolume OutputVolume output Output file for the scalar selected above. - - + + StandartDevVolume StandartDevVolume output Output file for the std. deviation. If no given, std. dev. is not calculated. - - + + Additional Options - + Verbose Verbose diff --git a/vtkFilter/vtkFilter.xml b/vtkFilter/vtkFilter.xml index 1d265aa..a1c57a5 100644 --- a/vtkFilter/vtkFilter.xml +++ b/vtkFilter/vtkFilter.xml @@ -15,11 +15,11 @@ Yogesh Rathi, Christian Baumgartner - + IO - + FiberInFile FiberInFile @@ -27,7 +27,7 @@ input The fibers to be filtered - + FiberOutFile FiberOutFile @@ -35,7 +35,7 @@ output The filtered fibers - + @@ -48,7 +48,7 @@ input File with the Labels for the Region of Interest A - + LabelA LabelA @@ -56,7 +56,7 @@ Choose one or more Labels from LabelFileA 1 - + LabelFileB LabelFileB @@ -64,7 +64,7 @@ input File with the Labels for the Region of Interest B - + LabelB LabelB @@ -72,7 +72,7 @@ Choose one or more Labels from LabelFileB 1 - + LabelFileC LabelFileC @@ -80,7 +80,7 @@ input File with the Labels for the Region of Interest C - + LabelC LabelC @@ -88,7 +88,7 @@ Choose one or more Labels from LabelFileC 1 - + LabelFileD LabelFileD @@ -96,7 +96,7 @@ input File with the Labels for the Region of Interest D - + LabelD LabelD @@ -106,7 +106,7 @@ - + Logic @@ -116,11 +116,11 @@ Logic function of the form: Ae and (B or not C). The 'e' signifies 'ending in region' - + Options - + CopyFields CopyFields @@ -128,7 +128,7 @@ Copy VTK field data (Uncheck for speed). true - + Verbose Verbose From 047cf29d0268f7498c7a5214f34813b01b77728d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 13 Jan 2023 05:17:11 -0500 Subject: [PATCH 2/3] STYLE: Convert tabs to spaces --- CMake/ITKSetStandardCompilerFlags.cmake | 40 +++++------ CMakeLists.txt | 2 +- SuperBuild/External_Boost.cmake | 72 +++++++++++-------- SuperBuild/External_ITK.cmake | 2 +- .../External_SlicerExecutionModel.cmake | 2 +- SuperBuild/External_VTK.cmake | 4 +- SuperBuild/External_zlib.cmake | 10 +-- UKFTractography.cmake | 12 ++-- ukf/NrrdData.cc | 8 +-- ukf/cli.cc | 6 +- ukf/thread.h | 2 +- ukf/tractography.cc | 2 +- 12 files changed, 85 insertions(+), 77 deletions(-) diff --git a/CMake/ITKSetStandardCompilerFlags.cmake b/CMake/ITKSetStandardCompilerFlags.cmake index ac7db96..23cf319 100644 --- a/CMake/ITKSetStandardCompilerFlags.cmake +++ b/CMake/ITKSetStandardCompilerFlags.cmake @@ -25,9 +25,9 @@ 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) @@ -35,11 +35,11 @@ function(check_c_compiler_flags c_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_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() @@ -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() @@ -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 @@ -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) @@ -342,7 +342,6 @@ macro(check_compiler_platform_flags) endif() endif() - # mingw thread support if(MINGW) set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mthreads") @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 969b254..930c5c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/SuperBuild/External_Boost.cmake b/SuperBuild/External_Boost.cmake index 35c66b2..b14c4eb 100644 --- a/SuperBuild/External_Boost.cmake +++ b/SuperBuild/External_Boost.cmake @@ -61,24 +61,24 @@ 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")) @@ -86,19 +86,19 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" 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() if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -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}) diff --git a/SuperBuild/External_ITK.cmake b/SuperBuild/External_ITK.cmake index 3122850..1baaeb3 100644 --- a/SuperBuild/External_ITK.cmake +++ b/SuperBuild/External_ITK.cmake @@ -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} diff --git a/SuperBuild/External_SlicerExecutionModel.cmake b/SuperBuild/External_SlicerExecutionModel.cmake index 388950e..11866e8 100644 --- a/SuperBuild/External_SlicerExecutionModel.cmake +++ b/SuperBuild/External_SlicerExecutionModel.cmake @@ -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} diff --git a/SuperBuild/External_VTK.cmake b/SuperBuild/External_VTK.cmake index e49a0fb..bdc22be 100644 --- a/SuperBuild/External_VTK.cmake +++ b/SuperBuild/External_VTK.cmake @@ -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() diff --git a/SuperBuild/External_zlib.cmake b/SuperBuild/External_zlib.cmake index 111bcc2..16eab40 100644 --- a/SuperBuild/External_zlib.cmake +++ b/SuperBuild/External_zlib.cmake @@ -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() diff --git a/UKFTractography.cmake b/UKFTractography.cmake index a976bd7..962efaf 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -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) diff --git a/ukf/NrrdData.cc b/ukf/NrrdData.cc index fb623a4..4bf7566 100644 --- a/ukf/NrrdData.cc +++ b/ukf/NrrdData.cc @@ -244,9 +244,9 @@ void NrrdData::GetSeeds(const std::vector& labels, std::vector::const_iterator cit; // Go through the volume. - size_t nx = _seed_nrrd->axis[2].size; - size_t ny = _seed_nrrd->axis[1].size; - size_t nz = _seed_nrrd->axis[0].size; + size_t nx = _seed_nrrd->axis[2].size; + size_t ny = _seed_nrrd->axis[1].size; + size_t nz = _seed_nrrd->axis[0].size; assert(_seed_data); if ( !(nx == _dim[0] && ny == _dim[1] && nz == _dim[2]) ) @@ -263,7 +263,7 @@ void NrrdData::GetSeeds(const std::vector& labels, for( cit = labels.begin(); cit != labels.end(); ++cit ) { int value = 0; - size_t index = ny * nz * i + nz * j + k; + size_t index = ny * nz * i + nz * j + k; switch( _seed_data_type ) { diff --git a/ukf/cli.cc b/ukf/cli.cc index cc807e6..92c79f8 100644 --- a/ukf/cli.cc +++ b/ukf/cli.cc @@ -80,11 +80,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) // HANDLE ERRORNOUS INPUT if (dwiFile.empty() || maskFile.empty() || tracts.empty()) { std::cout << "Error! Must indicate DWI data, mask and tracts output files!" << std::endl << std::endl ; - return 1 ; //This is to indicate that the module returns with error + return 1 ; //This is to indicate that the module returns with error } if (numTensor == 1) { - tractsWithSecondTensor.clear() ; //Reassure the string is empty + tractsWithSecondTensor.clear() ; //Reassure the string is empty } if (l_maxHalfFiberLength <= 0) { @@ -126,7 +126,7 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) } if (labels.size() == 0) { - labels.push_back(1) ; //Default to use label 1 + labels.push_back(1) ; //Default to use label 1 } if (l_stoppingFA == 0.15) { diff --git a/ukf/thread.h b/ukf/thread.h index c70a1f8..9e7bc24 100644 --- a/ukf/thread.h +++ b/ukf/thread.h @@ -30,7 +30,7 @@ typedef std::vector WorkDistribution; // ~ProgressThread() ; // } ; -// const int PROGRESS_REPORT_INTERVAL = 2 ; //Report progress once per 2 seconds +// const int PROGRESS_REPORT_INTERVAL = 2 ; //Report progress once per 2 seconds WorkDistribution GenerateWorkDistribution(const int num_threads, const int total_num_works); diff --git a/ukf/tractography.cc b/ukf/tractography.cc index cfdaf31..d852756 100644 --- a/ukf/tractography.cc +++ b/ukf/tractography.cc @@ -405,7 +405,7 @@ void Tractography::Init(std::vector& seed_infos) } if (! (seeds.size() > 0)) { - std::cout << "No matching label ROI seeds found! Please verify label selection."; + std::cout << "No matching label ROI seeds found! Please verify label selection."; throw; } From a1d1739a7947eb0f96495dd28eeadb9895023d3e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 1 Apr 2024 15:59:48 -0400 Subject: [PATCH 3/3] STYLE: Improve consistency of spacing before inlined C comments Use 1-space and align consecutive comments --- ukf/NrrdData.cc | 10 +++++----- ukf/cli.cc | 24 ++++++++++++------------ ukf/dwi_normalize.cc | 6 +++--- ukf/filter_Full1T_FW.h | 10 +++++----- ukf/filter_Full2T_FW.h | 16 ++++++++-------- ukf/filter_NODDI1F.h | 10 +++++----- ukf/filter_NODDI2F.h | 16 ++++++++-------- ukf/filter_Simple1T_FW.h | 8 ++++---- ukf/filter_Simple2T_FW.h | 12 ++++++------ ukf/tractography.cc | 38 +++++++++++++++++++------------------- ukf/ukffiber.cc | 2 +- ukf/vtk_writer.cc | 4 ++-- 12 files changed, 78 insertions(+), 78 deletions(-) diff --git a/ukf/NrrdData.cc b/ukf/NrrdData.cc index 4bf7566..406a3de 100644 --- a/ukf/NrrdData.cc +++ b/ukf/NrrdData.cc @@ -113,7 +113,7 @@ void NrrdData::Interp3Signal(const vec3_t& pos, signal[i] /= w_sum; // Push into second spot. - signal[i + _num_gradients] = signal[i]; // Duplicate the signals + signal[i + _num_gradients] = signal[i]; // Duplicate the signals } } @@ -419,7 +419,7 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData) else { this->_data_nrrd = nrrdNew(); - dwiNormalize(input_nrrd, _data_nrrd); // Do preprocessing on the data + dwiNormalize(input_nrrd, _data_nrrd); // Do preprocessing on the data } // After normalization, the first axis of the nrrd data is the list, namely the gradient axis @@ -493,7 +493,7 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData) nrrdSpacingCalculate(this->_data_nrrd, 1, &spacing1, space_dir); nrrdSpacingCalculate(this->_data_nrrd, 2, &spacing2, space_dir); nrrdSpacingCalculate(this->_data_nrrd, 3, &spacing3, space_dir); - _voxel << spacing3, spacing2, spacing1; // NOTE that the _voxel here is in reverse axis order! + _voxel << spacing3, spacing2, spacing1; // NOTE that the _voxel here is in reverse axis order! // make sure something computable is in spacing. for(unsigned int i = 0; i < this->_data_nrrd->dim; ++i) @@ -569,8 +569,8 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData) R(0, 0) *= vox_x_inv; R(1, 0) *= vox_x_inv; - R(2, 0) *= vox_x_inv; // R(0,0), R(1,0), R(2,0) is a unit vector, and is just the normalized spacedirection of axis - // 1 + R(2, 0) *= vox_x_inv; // R(0,0), R(1,0), R(2,0) is a unit vector, and is just the normalized spacedirection of axis + // 1 R(0, 1) *= vox_y_inv; R(1, 1) *= vox_y_inv; R(2, 1) *= vox_y_inv; diff --git a/ukf/cli.cc b/ukf/cli.cc index 92c79f8..eb78158 100644 --- a/ukf/cli.cc +++ b/ukf/cli.cc @@ -80,11 +80,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) // HANDLE ERRORNOUS INPUT if (dwiFile.empty() || maskFile.empty() || tracts.empty()) { std::cout << "Error! Must indicate DWI data, mask and tracts output files!" << std::endl << std::endl ; - return 1 ; //This is to indicate that the module returns with error + return 1 ; //This is to indicate that the module returns with error } if (numTensor == 1) { - tractsWithSecondTensor.clear() ; //Reassure the string is empty + tractsWithSecondTensor.clear() ; //Reassure the string is empty } if (l_maxHalfFiberLength <= 0) { @@ -137,7 +137,7 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) if (l_seedingThreshold == 0.0) { ukf_setAndTell(l_seedingThreshold, FULL_BRAIN_MEAN_SIGNAL_MIN, - "seedingThreshold"); // Used to default to 2 times the FA threshold. + "seedingThreshold"); // Used to default to 2 times the FA threshold. } else { ukf_tell(l_seedingThreshold, "seedingThreshold"); } @@ -156,12 +156,12 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) else ukf_setAndTell(l_Qm, 0.001, "Qm"); } else if (numTensor == 1) { - ukf_setAndTell(l_Qm, 0.005, "Qm");//l_Qm = 0.0015; + ukf_setAndTell(l_Qm, 0.005, "Qm"); //l_Qm = 0.0015; } else { if (fullTensorModel) { - ukf_setAndTell(l_Qm, 0.002, "Qm");//l_Qm = 0.002; + ukf_setAndTell(l_Qm, 0.002, "Qm"); //l_Qm = 0.002; } else { - ukf_setAndTell(l_Qm, 0.001, "Qm");//l_Qm = 0.001; was 0.003, changed to 0.001 for new Interp3Signal + ukf_setAndTell(l_Qm, 0.001, "Qm"); //l_Qm = 0.001; was 0.003, changed to 0.001 for new Interp3Signal } } } else { @@ -178,11 +178,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) else { if (l_Ql == 0.0) { if (numTensor == 1) { - ukf_setAndTell(l_Ql, 300.0, "Ql");//l_Ql = 25.0; + ukf_setAndTell(l_Ql, 300.0, "Ql"); //l_Ql = 25.0; } else if (numTensor == 2) { - ukf_setAndTell(l_Ql, 50.0, "Ql");//was l_Ql = 100.0; for old Interp3Signal + ukf_setAndTell(l_Ql, 50.0, "Ql"); //was l_Ql = 100.0; for old Interp3Signal } else if (numTensor == 3) { - ukf_setAndTell(l_Ql, 100.0, "Ql");//l_Ql = 150.0; + ukf_setAndTell(l_Ql, 100.0, "Ql"); //l_Ql = 150.0; } } else { ukf_tell(l_Ql, "Ql"); @@ -192,12 +192,12 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s) if (l_Rs == 0.0) { if (numTensor == 1) { - ukf_setAndTell(l_Rs, 0.01, "Rs");//l_Rs = 0.02; + ukf_setAndTell(l_Rs, 0.01, "Rs"); //l_Rs = 0.02; } else { if (fullTensorModel) { - ukf_setAndTell(l_Rs, 0.01, "Rs");// = 0.01; + ukf_setAndTell(l_Rs, 0.01, "Rs"); // = 0.01; } else { - ukf_setAndTell(l_Rs, 0.02, "Rs");//was l_Rs = 0.015;for old Interp3Signal + ukf_setAndTell(l_Rs, 0.02, "Rs"); //was l_Rs = 0.015;for old Interp3Signal } } } else { diff --git a/ukf/dwi_normalize.cc b/ukf/dwi_normalize.cc index 6887929..6863994 100644 --- a/ukf/dwi_normalize.cc +++ b/ukf/dwi_normalize.cc @@ -45,7 +45,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized) throw; } - nrrdKeyValueClear(normalized); // Force to erase the key/value pairs + nrrdKeyValueClear(normalized); // Force to erase the key/value pairs // Process the key/value pairs. Identify the non-zero gradients, namely the non-zero B values std::vector > keyValuePairsOfRaw; @@ -149,7 +149,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized) // Compute the permutation std::vector permutation(DATA_DIMENSION); unsigned int permuteCounter = 0; - permutation[0] = static_cast(listAxis); // Shift the list axis to the fastest axis + permutation[0] = static_cast(listAxis); // Shift the list axis to the fastest axis for( int i = 1; i < DATA_DIMENSION; i++ ) { if( permuteCounter == static_cast(listAxis) ) @@ -272,7 +272,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized) if( normalized->content != NULL ) { free( normalized->content ); - normalized->content = NULL; // Get rid of the content field + normalized->content = NULL; // Get rid of the content field } // Add the key/value pairs back to the normalized data int totalGradientCounter = 0; diff --git a/ukf/filter_Full1T_FW.h b/ukf/filter_Full1T_FW.h index da79ae9..c2a56a5 100644 --- a/ukf/filter_Full1T_FW.h +++ b/ukf/filter_Full1T_FW.h @@ -34,15 +34,15 @@ class Full1T_FW : public FilterModel // Setting the constraints according to D'*x >= -d _D(6, 0) = -1; - _d(0) = 1; // w <= 1 + _d(0) = 1; // w <= 1 _D(6, 1) = 1; - _d(1) = 0; // w >= 0 + _d(1) = 0; // w >= 0 _D(3, 2) = 1; - _d(2) = 0; // l1 >= 0 + _d(2) = 0; // l1 >= 0 _D(4, 3) = 1; - _d(3) = 0; // l2 >= 0 + _d(3) = 0; // l2 >= 0 _D(5, 4) = 1; - _d(4) = 0; // l3 >= 0 + _d(4) = 0; // l3 >= 0 } diff --git a/ukf/filter_Full2T_FW.h b/ukf/filter_Full2T_FW.h index 8223ee6..46eeac5 100644 --- a/ukf/filter_Full2T_FW.h +++ b/ukf/filter_Full2T_FW.h @@ -35,21 +35,21 @@ class Full2T_FW : public FilterModel // Setting the constraints according to D'*x >= -d _D(12, 0) = -1; - _d(0) = 1; // w <= 1 + _d(0) = 1; // w <= 1 _D(12, 1) = 1; - _d(1) = 0; // w >= 0 + _d(1) = 0; // w >= 0 _D(3, 2) = 1; - _d(2) = 0; // l11 >= 0 + _d(2) = 0; // l11 >= 0 _D(4, 3) = 1; - _d(3) = 0; // l21 >= 0 + _d(3) = 0; // l21 >= 0 _D(5, 4) = 1; - _d(4) = 0; // l31 >= 0 + _d(4) = 0; // l31 >= 0 _D(9, 5) = 1; - _d(5) = 0; // l12 >= 0 + _d(5) = 0; // l12 >= 0 _D(10, 6) = 1; - _d(6) = 0; // l22 >= 0 + _d(6) = 0; // l22 >= 0 _D(11, 7) = 1; - _d(7) = 0; // l32 >= 0 + _d(7) = 0; // l32 >= 0 } virtual ~Full2T_FW() diff --git a/ukf/filter_NODDI1F.h b/ukf/filter_NODDI1F.h index 89da9a3..08b1109 100644 --- a/ukf/filter_NODDI1F.h +++ b/ukf/filter_NODDI1F.h @@ -26,17 +26,17 @@ class NODDI1F : public FilterModel // Setting the constraints according to D'*x >= -d _D(5, 0) = -1; - _d(0) = 1; // Viso <= 1 + _d(0) = 1; // Viso <= 1 _D(5, 1) = 1; - _d(1) = 0; // Viso >= 0 + _d(1) = 0; // Viso >= 0 _D(3, 2) = 1; - _d(2) = 0; // Vic >= 0 + _d(2) = 0; // Vic >= 0 _D(3, 3) = -1; - _d(3) = 1; // Vic <= 1 + _d(3) = 1; // Vic <= 1 _D(4, 4) = 1; - _d(4) = 0; // kappa >= 0 + _d(4) = 0; // kappa >= 0 } diff --git a/ukf/filter_NODDI2F.h b/ukf/filter_NODDI2F.h index 7b0f511..6257e7b 100644 --- a/ukf/filter_NODDI2F.h +++ b/ukf/filter_NODDI2F.h @@ -25,25 +25,25 @@ class NODDI2F : public FilterModel // Setting the constraints according to D'*x >= -d _D(10, 0) = -1; - _d(0) = 1; // Viso <= 1 + _d(0) = 1; // Viso <= 1 _D(10, 1) = 1; - _d(1) = 0; // Viso >= 0 + _d(1) = 0; // Viso >= 0 _D(3, 2) = 1; - _d(2) = 0; // Vic >= 0 + _d(2) = 0; // Vic >= 0 _D(3, 3) = -1; - _d(3) = 1; // Vic <= 1 + _d(3) = 1; // Vic <= 1 _D(4, 4) = 1; - _d(4) = 0; // kappa >= 0 + _d(4) = 0; // kappa >= 0 _D(8, 5) = 1; - _d(5) = 0; // Vic >= 0 + _d(5) = 0; // Vic >= 0 _D(8, 6) = -1; - _d(6) = 1; // Vic <= 1 + _d(6) = 1; // Vic <= 1 _D(9, 7) = 1; - _d(7) = 0; // kappa >= 0 + _d(7) = 0; // kappa >= 0 } diff --git a/ukf/filter_Simple1T_FW.h b/ukf/filter_Simple1T_FW.h index e3a8579..2621c13 100644 --- a/ukf/filter_Simple1T_FW.h +++ b/ukf/filter_Simple1T_FW.h @@ -34,13 +34,13 @@ class Simple1T_FW : public FilterModel // Setting the constraints according to D'*x >= -d _D(5, 0) = -1; - _d(0) = 1; // w <= 1 + _d(0) = 1; // w <= 1 _D(5, 1) = 1; - _d(1) = 0; // w >= 0 + _d(1) = 0; // w >= 0 _D(3, 2) = 1; - _d(2) = 0; // l1 >= 0 + _d(2) = 0; // l1 >= 0 _D(4, 3) = 1; - _d(3) = 0; // l2 >= 0 + _d(3) = 0; // l2 >= 0 } diff --git a/ukf/filter_Simple2T_FW.h b/ukf/filter_Simple2T_FW.h index 51a2f0a..60a6f46 100644 --- a/ukf/filter_Simple2T_FW.h +++ b/ukf/filter_Simple2T_FW.h @@ -34,17 +34,17 @@ class Simple2T_FW : public FilterModel // Setting the constraints according to D'*x >= -d _D(10, 0) = -1; - _d(0) = 1; // w <= 1 + _d(0) = 1; // w <= 1 _D(10, 1) = 1; - _d(1) = 0; // w >= 0 + _d(1) = 0; // w >= 0 _D(3, 2) = 1; - _d(2) = 0; // l11 >= 0 + _d(2) = 0; // l11 >= 0 _D(4, 3) = 1; - _d(3) = 0; // l21 >= 0 + _d(3) = 0; // l21 >= 0 _D(8, 4) = 1; - _d(4) = 0; // l12 >= 0 + _d(4) = 0; // l12 >= 0 _D(9, 5) = 1; - _d(5) = 0; // l22 >= 0 + _d(5) = 0; // l22 >= 0 } virtual ~Simple2T_FW() diff --git a/ukf/tractography.cc b/ukf/tractography.cc index d852756..1dfef4d 100644 --- a/ukf/tractography.cc +++ b/ukf/tractography.cc @@ -206,8 +206,8 @@ void Tractography::UpdateFilterModelType() } // Double check branching. - _is_branching = _num_tensors > 1 && _cos_theta_max < ukfOne; // The branching is enabled when the maximum branching - // angle is not 0 + _is_branching = _num_tensors > 1 && _cos_theta_max < ukfOne; // The branching is enabled when the maximum branching + // angle is not 0 std::cout << "Branching " << (_is_branching ? "enabled" : "disabled") << std::endl << std::endl; if( !_is_branching ) { @@ -418,7 +418,7 @@ void Tractography::Init(std::vector& seed_infos) if( seeds.size() == 1 && _seeds_per_voxel == 1 ) // if there is only one seed don't use offset so fibers can be // compared { - rand_dirs.push_back(vec3_t(0,0,0) /* make_vec(0, 0, 0) */); // in the test cases. + rand_dirs.push_back(vec3_t(0,0,0) /* make_vec(0, 0, 0) */); // in the test cases. } else { @@ -626,9 +626,9 @@ void Tractography::Init(std::vector& seed_infos) { minnmse = nmse; Viso = Visoperm[c]; - tmp_info_state[3] = Vic[b]; // Vic + tmp_info_state[3] = Vic[b]; // Vic tmp_info_state[4] = kappas[a]; // Kappa - tmp_info_inv_state[3] = Vic[b]; // Vic + tmp_info_inv_state[3] = Vic[b]; // Vic tmp_info_inv_state[4] = kappas[a]; // Kappa } } @@ -643,10 +643,10 @@ void Tractography::Init(std::vector& seed_infos) tmp_info_inv_state[5] = info_inv.start_dir[0]; tmp_info_inv_state[6] = info_inv.start_dir[1]; tmp_info_inv_state[7] = info_inv.start_dir[2]; - tmp_info_state[8] = tmp_info_state[3]; // Vic - tmp_info_state[9] = tmp_info_state[4]; // Kappa + tmp_info_state[8] = tmp_info_state[3]; // Vic + tmp_info_state[9] = tmp_info_state[4]; // Kappa tmp_info_inv_state[8] = tmp_info_inv_state[3]; // Vic - tmp_info_inv_state[9] = tmp_info_inv_state[4]; //kappa + tmp_info_inv_state[9] = tmp_info_inv_state[4]; // kappa } } else @@ -704,14 +704,14 @@ void Tractography::Init(std::vector& seed_infos) info.state = ConvertVector(tmp_info_state); info_inv.state = ConvertVector(tmp_info_inv_state); seed_infos.push_back(info); - seed_infos.push_back(info_inv); // NOTE that the seed in reverse direction is put directly after the seed in - // original direction + seed_infos.push_back(info_inv); // NOTE that the seed in reverse direction is put directly after the seed in + // original direction } } bool Tractography::Run() { - assert(_signal_data); // The _signal_data is initialized in Tractography::LoadFiles(), + assert(_signal_data); // The _signal_data is initialized in Tractography::LoadFiles(), // Thus Run() must be invoked after LoadFiles() // Initialize and prepare seeds. @@ -734,7 +734,7 @@ bool Tractography::Run() _ukf.reserve(num_of_threads); //Allocate, but do not assign for( int i = 0; i < num_of_threads; i++ ) { - _ukf.push_back(new UnscentedKalmanFilter(_model) ); // Create one Kalman filter for each thread + _ukf.push_back(new UnscentedKalmanFilter(_model) ); // Create one Kalman filter for each thread } std::vector raw_primary; @@ -1295,7 +1295,7 @@ void Tractography::Follow2T(const int thread_id, int fiber_size = 100; int fiber_length = 0; // Unpack the fiberStartSeed information. - vec3_t x = fiberStartSeed.point; // NOTICE that the x here is in ijk coordinate system + vec3_t x = fiberStartSeed.point; // NOTICE that the x here is in ijk coordinate system State state = fiberStartSeed.state; ukfMatrixType p(fiberStartSeed.covariance); @@ -1634,7 +1634,7 @@ void Tractography::Step2T(const int thread_id, state = state_new; covariance = covariance_new; - const vec3_t old_dir = m1; // Direction in last step + const vec3_t old_dir = m1; // Direction in last step ukfPrecisionType fa_tensor_1 = ukfZero; ukfPrecisionType fa_tensor_2 = ukfZero; if(_noddi) @@ -1652,7 +1652,7 @@ void Tractography::Step2T(const int thread_id, } else { - _model->State2Tensor2T(state, old_dir, m1, l1, m2, l2); // The returned m1 and m2 are unit vector here + _model->State2Tensor2T(state, old_dir, m1, l1, m2, l2); // The returned m1 and m2 are unit vector here trace = l1[0] + l1[1] + l1[2]; trace2 = l2[0] + l2[1] + l2[2]; fa_tensor_1 = l2fa(l1[0], l1[1], l1[2]); @@ -1677,7 +1677,7 @@ void Tractography::Step2T(const int thread_id, trace= trace2; trace2=tmpScalar; ukfMatrixType old = covariance; - SwapState2T(state, covariance); // Swap the two tensors + SwapState2T(state, covariance); // Swap the two tensors } if(tensor_angle <= 20) @@ -1689,7 +1689,7 @@ void Tractography::Step2T(const int thread_id, m2 = tmp; ukfMatrixType old = covariance; - SwapState2T(state, covariance); // Swap the two tensors + SwapState2T(state, covariance); // Swap the two tensors } else if (std::min(fa_tensor_1, fa_tensor_2) <= 0.2 ) { @@ -1710,7 +1710,7 @@ void Tractography::Step2T(const int thread_id, ukfMatrixType old = covariance; - SwapState2T(state, covariance); // Swap the two tensors + SwapState2T(state, covariance); // Swap the two tensors } } } @@ -1728,7 +1728,7 @@ void Tractography::Step2T(const int thread_id, } vec3_t dx; { - const vec3_t dir = m1; // The dir is a unit vector in ijk coordinate system indicating the direction of step + const vec3_t dir = m1; // The dir is a unit vector in ijk coordinate system indicating the direction of step const vec3_t voxel = _signal_data->voxel(); dx << dir[2] / voxel[0], // By dividing by the voxel size, it's guaranteed that the step // represented by dx is 1mm in RAS coordinate system, no matter whether diff --git a/ukf/ukffiber.cc b/ukf/ukffiber.cc index 8fc0d73..368248c 100644 --- a/ukf/ukffiber.cc +++ b/ukf/ukffiber.cc @@ -241,7 +241,7 @@ void PostProcessFibers( const std::vector& raw_primary, const UKFFiber& first_half = raw_primary[first_half_index]; const UKFFiber& second_half = raw_primary[second_half_index]; - const UKFFiber& branch = raw_branch[i]; // This is the un-back-traced branch + const UKFFiber& branch = raw_branch[i]; // This is the un-back-traced branch fibers[counter].position.resize(num_points_on_branch[i]); if( record_fa ) diff --git a/ukf/vtk_writer.cc b/ukf/vtk_writer.cc index be2f02d..b5a091b 100644 --- a/ukf/vtk_writer.cc +++ b/ukf/vtk_writer.cc @@ -700,7 +700,7 @@ PointConvert(const vec3_t& point) { vec3_t rval; ukfVectorType p(4); - p[0] = point[2]; // NOTICE the change of order here. Flips back to the original axis order + p[0] = point[2]; // NOTICE the change of order here. Flips back to the original axis order p[1] = point[1]; p[2] = point[0]; @@ -708,7 +708,7 @@ PointConvert(const vec3_t& point) { p[3] = ukfOne; ukfVectorType p_new(4); - p_new = _signal_data->i2r() * p; // ijk->RAS transform + p_new = _signal_data->i2r() * p; // ijk->RAS transform rval[0] = p_new[0]; rval[1] = p_new[1]; rval[2] = p_new[2];