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

New commands: peaksconvert, peakscheck #2918

Draft
wants to merge 226 commits into
base: dwi_metadata
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
cd8bbfb
Created custom callables for different datatypes on cmd
ankitasanil Feb 6, 2023
075db52
Used callable types in commands - mrtrix_cleanup and dwicat
ankitasanil Feb 6, 2023
8d91a38
Changes done as instructed in the review
ankitasanil Feb 7, 2023
ebd36cf
Used callable types in few more commands
ankitasanil Feb 7, 2023
2988229
Python API: Integrate argument types across commands
Lestropie Feb 7, 2023
481462f
Changed the syntax as per https://github.com/ankitasanil/mrtrix3/pull…
ankitasanil Feb 7, 2023
54bca48
Python API: Used Python list comprehension as per https://github.com/…
ankitasanil Feb 7, 2023
cd33930
population_template: Refine cmdline interface
Lestropie Feb 7, 2023
9f3d624
Change interfaces for robust linear registration estimators
Lestropie Feb 10, 2023
51ccc67
Python API: Updated class names as per https://github.com/ankitasanil…
ankitasanil Feb 13, 2023
47fec95
Modifications in existing code to handle new argument types
ankitasanil Feb 13, 2023
b72c211
Modifications in existing code to handle new argument types (contd.)
ankitasanil Feb 14, 2023
6dcfe53
Added inheritance for TracksIn checks as per (https://github.com/anki…
ankitasanil Feb 14, 2023
935a8aa
Python API: Ability to handle piped commands
ankitasanil Mar 7, 2023
e749fe9
Changes for output image piping
ankitasanil Mar 14, 2023
a830bf4
Python CLI: Tweaks to custom types
Lestropie Jul 12, 2023
4560880
Python CLI: Code cleanup
Lestropie Jul 13, 2023
2894b1d
Move handling of envvar MRTRIX_PRESERVE_TMPFILE
Lestropie Aug 10, 2023
294ea57
Fix pylint warnings for python_cmd_changes branch
Lestropie Aug 10, 2023
70c154e
Python: Move some functions from path to utils module
Lestropie Aug 10, 2023
e9393d7
First functional version of image piping with Python scripts
Lestropie Aug 10, 2023
913ce00
mrtrix3.app: Terminate if piping image to stdout
Lestropie Aug 10, 2023
2e1efdb
mrtrix3.app: Improvements to __print_full_usage__ behaviour
Lestropie Aug 11, 2023
ff56d40
dwibiascorrect ants: Change command-line options
Lestropie Aug 11, 2023
a847938
mrtrix3.app: Fix __print_full_usage__ for subparser algorithms
Lestropie Aug 11, 2023
94abafa
Docs: Improved metavar usage in Python scripts
Lestropie Aug 11, 2023
dda5db7
Merge branch 'dev' into python_cmd_changes
Lestropie Aug 11, 2023
1a9759e
dwi2mask consensus: Generalise -algorithm interface
Lestropie Aug 11, 2023
a22382f
dwi2mask legacy: Make use of Python command image piping
Lestropie Aug 11, 2023
4208d2e
Initial support for macOS app bundles for GUI apps
bjeurissen Oct 25, 2023
ee13d9d
Clean up app bundle generation
bjeurissen Oct 26, 2023
1f846cf
Add macos icons
bjeurissen Oct 26, 2023
17ce416
This should probably be defined when calling cmake instead
bjeurissen Oct 26, 2023
dc81d10
Fix typo
bjeurissen Oct 26, 2023
659ebbf
Include application icons with app bundle
bjeurissen Oct 27, 2023
15bb65f
Include file association icons with app bundle
bjeurissen Oct 27, 2023
52f8769
Only add app bundle icons on macos
bjeurissen Oct 27, 2023
7f27e89
Python API: Ranged integers and floats
Lestropie Jan 30, 2024
18e6850
Python: Broad fixing of typed command-line argument usage
Lestropie Feb 4, 2024
d511e3d
Python API: Multiple related changes
Lestropie Feb 13, 2024
b31c9d9
New unit test for Python CLI typing
Lestropie Feb 14, 2024
7791a38
Fix Python help pages for bound integers & floats
Lestropie Feb 18, 2024
4da90a0
Python API: Multiple API/CLI changes
Lestropie Feb 18, 2024
4c74759
Testing: Verify piped image support for Python scripts
Lestropie Feb 19, 2024
ff86c44
Python API: Fix __print_full_usage__ for algorithm wrappers
Lestropie Feb 19, 2024
24f1c32
Fix Python issues identified by latest tests
Lestropie Feb 19, 2024
48d8997
Merge branch 'dev' into cmake_app_bundles
bjeurissen Feb 19, 2024
6778522
Merge remote-tracking branch 'origin/dev' into python_cmd_changes
Lestropie Feb 28, 2024
a483d00
Python: Code formatting & documentation regeneration
Lestropie Feb 28, 2024
9822d58
Python CLI: Better metavar handling
Lestropie Feb 28, 2024
d158891
clang-format and clang-tidy fixes for #2678
Lestropie Feb 28, 2024
d5a4596
Add unit testing of Python CLI
Lestropie Feb 28, 2024
4c331e2
Merge remote-tracking branch 'origin/dev' into python_cmd_changes
Lestropie Feb 28, 2024
9cee5ae
dwicat: Use F-strings
Lestropie Feb 28, 2024
d783f8c
population_template: Resolve merge conflicts
Lestropie Feb 28, 2024
55929b0
5ttgen: Algorithms return path of final image to test using 5ttcheck
Lestropie Feb 29, 2024
db3ca00
Resolution of pylint errors for #2678
Lestropie Feb 29, 2024
ff983de
Python CLI: Fixes to typing & alternative typing interface
Lestropie Mar 1, 2024
553a4fb
Python CLI: Move relevant functions / classes into Parser class
Lestropie Mar 1, 2024
e25e977
Fix for population_template for #2678
Lestropie Mar 1, 2024
23f436d
Python API: Fixes to typed CLI
Lestropie Mar 4, 2024
45738a2
Python CLI: Default flags to None
Lestropie Mar 4, 2024
2e6c28a
Merge remote-tracking branch 'origin/dev' into python_cmd_changes
Lestropie Mar 5, 2024
e98ecc6
Testing: Finalise Python CLI testing
Lestropie Mar 5, 2024
40b7a7c
population_template: Syntax fixes
Lestropie Mar 5, 2024
8a0d639
Python CLI: Fix for __print_usage_markdown__
Lestropie Mar 5, 2024
e384c18
Add argument to specify environment for bash tests
daljit46 Mar 5, 2024
7790fd3
testing: Set PYTHONPATH for non-cpp-standalone unit tests
Lestropie Mar 5, 2024
d9587e6
Testing: DO not use sed in Python CLI tests
Lestropie Mar 6, 2024
8065803
Testing: Add C++ CLI evaluation
Lestropie Mar 11, 2024
be75618
CI: Fix PYTHONPATH setting in MSYS2
Lestropie Mar 11, 2024
08bc526
CI: Fix CLI dunder function checks on MSYS2
Lestropie Mar 11, 2024
e014b24
Merge remote-tracking branch 'origin/python_cmd_changes' into fix_pyt…
Lestropie Mar 11, 2024
4c9247b
CI: Fix C++ CLI tests on MSYS2
Lestropie Mar 11, 2024
f57bbd8
Merge pull request #2846 from MRtrix3/fix_python_cli_ci_test
Lestropie Mar 11, 2024
d6a84ba
CI: Final fixes for addition of C++ CLI tests
Lestropie Mar 12, 2024
f458793
Fix compilation of big object files in MINGW debug builds
daljit46 May 9, 2024
9ce93f3
Merge remote-tracking branch 'origin/dev' into python_cmd_changes
Lestropie May 13, 2024
65ba856
Testing: Greater testing of Python image piping support
Lestropie May 13, 2024
99dd927
mask2glass: Ensure input image is 3D
Lestropie May 13, 2024
7115593
Testing: Verify that Python commands handle paths with whitespaces
Lestropie May 13, 2024
4095d76
Testing: Import new test data for new mask2glass tests
Lestropie May 13, 2024
05b68d5
Python: Multiple fixes following merge of split tests & CLI changes
Lestropie May 14, 2024
69d3590
Merge remote-tracking branch 'origin/dev' into python_cmd_changes
Lestropie May 15, 2024
92f9a89
5ttgen hsvs: Fixes to whitespace handling changes
Lestropie May 16, 2024
fc4b798
population_template: Fix handling of output directory paths
Lestropie May 16, 2024
f34730d
dwi2mask consensus: Fix for whitespace in scratch directory path
Lestropie May 16, 2024
2a55a43
Testing: Whitespaces in scratch directory paths
Lestropie May 17, 2024
ef5b8c5
mrtrix3.app: Fix argparse exception on existing output filesystem path
Lestropie May 18, 2024
40fdc8e
Testing: Fix execution of bash unit tests
Lestropie May 18, 2024
b3d98c1
Testing: Add comments to CLI tests
Lestropie May 18, 2024
4d8f766
Python CLI & testing fixes
Lestropie May 18, 2024
de5ebe7
Docs: Auto update for changes to -scratch option
MRtrixBot May 20, 2024
2eefdcd
Add missing windows.h include header
daljit46 May 22, 2024
961eeb2
OpenGL: Minimise what is imported by windows.h
Lestropie May 23, 2024
eac5823
Merge pull request #2914 from MRtrix3/fix_msys2_compilation_minimise_…
Lestropie May 23, 2024
c2b2e76
Merge branch 'dev' into python_cmd_changes
Lestropie May 23, 2024
cda68bd
Merge pull request #2678 from MRtrix3/python_cmd_changes
Lestropie May 23, 2024
a05cef6
Merge remote-tracking branch 'origin/dev' into cmake_app_bundles
daljit46 May 30, 2024
05d4fa5
New option to build non-core code as a static lib
daljit46 May 15, 2024
7b01831
Rename MRTRIX_BUILD_STATIC to MRTRIX_BUILD_NON_CORE_STATIC
daljit46 May 16, 2024
1a015dd
Move cmake/bundle to packaging/macos
daljit46 May 31, 2024
1eafc83
Add MacOSBundle.cmake module
daljit46 May 31, 2024
fc07064
New commands: peaksconvert, peakscheck
Lestropie Jun 5, 2024
dab9d53
Merge pull request #2897 from MRtrix3/fix_mingw_debug
Lestropie Jun 6, 2024
419ab8f
Add warning if cmake generator is not Ninja
daljit46 Jun 6, 2024
a805ef3
Create wrapper scripts for mrview and shview
daljit46 Jun 4, 2024
b053f7c
Set CMAKE_OSX_DEPLOYMENT_TARGET for MacOS
daljit46 Jun 4, 2024
f4bee41
Set copyright year in MacOSBundle.cmake
daljit46 Jun 4, 2024
3c804f6
Set correct icons for mrview
daljit46 Jun 6, 2024
399cf16
Merge pull request #2739 from MRtrix3/cmake_app_bundles
bjeurissen Jun 7, 2024
93f3741
Major changes to Python handling following cmake adoption
Lestropie Jun 9, 2024
71bc07c
update_copyright: Changes to reflect post-cmake refactoring
Lestropie Jun 9, 2024
9b3de4d
population_template: Split source code between files
MRtrixBot Jun 9, 2024
6a65e81
git blame: Ignore splitting of population_template code
Lestropie Jun 9, 2024
9ff374b
Avoid using CMAKE_SOURCE_DIR
daljit46 Jun 13, 2024
9195a11
Merge pull request #2919 from MRtrix3/generator_warning
daljit46 Jun 13, 2024
398cc04
CMakeList.txt: fix very minor typo in warning message
jdtournier Jun 14, 2024
6ca8fd0
Merge pull request #2924 from MRtrix3/cmakelist_typo
daljit46 Jun 14, 2024
4e2bc42
Remove app bundle related files and logic now that cmake takes care i…
bjeurissen Jun 19, 2024
2f8df8d
Remove MRTRIX_USE_QT6 as it is no longer supported
bjeurissen Jun 19, 2024
73e4687
Make sure app bundles can find the bundled qt6 plugins
bjeurissen Jun 19, 2024
96ed3f1
remove TIFF from build system following removal from code
jdtournier Jun 19, 2024
648cc08
Merge pull request #2927 from MRtrix3/macos_binary_fixes
bjeurissen Jun 19, 2024
29c8f8d
Merge pull request #2928 from MRtrix3/remove_tiff_from_build
bjeurissen Jun 19, 2024
94cecc2
Bump up OSX_DEPLOYMENT_TARGET to 11.00
bjeurissen Jun 19, 2024
47915bd
Merge pull request #2930 from MRtrix3/ox-deployment-target
bjeurissen Jun 19, 2024
291a747
Cleanup cmake scripts for Python commands
daljit46 Jun 12, 2024
70fea8d
Add CMake targets for Python files
daljit46 Jun 14, 2024
6f2948a
Change/extend inputs for MakePythonExecutable
daljit46 Jun 20, 2024
1f1fb1d
Fix execution of unit tests
daljit46 Jun 20, 2024
cee8d41
Fix permissions with CMake < 3.19
daljit46 Jun 20, 2024
6424277
Merge pull request #2907 from MRtrix3/build_static
Lestropie Jun 20, 2024
f87bc0e
Merge remote-tracking branch 'origin/dev' into cmake_python_changes
Lestropie Jun 21, 2024
3fce648
Fix Python commands, documentation generation, CLI test
Lestropie Jun 21, 2024
561dd2d
Merge pull request #2920 from MRtrix3/cmake_python_changes
daljit46 Jun 21, 2024
2c76370
Disable PCHs when building macos release
daljit46 Jun 25, 2024
27d377a
Enable MRTRIX_BUILD_NON_CORE_STATIC for releases
daljit46 Jun 25, 2024
225f7d7
Merge pull request #2932 from MRtrix3/packaging_changes
daljit46 Jun 25, 2024
38cc992
Modified FindFFTW to only look for double precision version of fftw3,…
bjeurissen Jun 26, 2024
8266d9f
Merge pull request #2934 from MRtrix3/fftw_double_only
bjeurissen Jun 27, 2024
07c5290
New command: dirrotate
Lestropie Jul 17, 2024
49f7ede
dirmerge: Better selection of first volume
Lestropie Jul 17, 2024
e1f0c99
Add interface library for project-wide compile options
daljit46 Jul 30, 2024
79d4edf
Use string_view in dash detection/removal
daljit46 May 3, 2024
3ab8fd9
Replace union with std::variant for argument choices
daljit46 May 21, 2024
b0f8018
Use std::string for app CLI
daljit46 Jun 7, 2024
6286158
Use std::string in rest of the code
daljit46 Jun 18, 2024
54b9672
Cleanup MRView::Window::parse_arguments
daljit46 May 27, 2024
c21d48d
Store index of args in raw CL input in ParsedArgument
daljit46 Jun 7, 2024
f30a90d
Update copyright script with new APP_CPP_STRING
daljit46 Jun 18, 2024
11421f3
Fix parsing of arguments in mrcalc
daljit46 Jun 19, 2024
4a76d09
Fix command line history string construction
daljit46 Jun 19, 2024
32babf0
Remove unnecessary comment
daljit46 Jun 19, 2024
5495bbe
Update error message in mrview CLI
daljit46 Jun 19, 2024
032fb56
Add further tests for app CLI
daljit46 Jun 19, 2024
a6ab4e1
Skip dash tests on MSYS2
daljit46 Aug 2, 2024
1f394fb
dwi2tensor: Update reference for constrained fit
Lestropie Aug 5, 2024
ac48d3a
Fix warning with GCC14
daljit46 Aug 8, 2024
6da0f39
Python API: Support Python 3.12
Lestropie Aug 9, 2024
1f9d3b4
mrtrix3.app: Pylint fixes for 3.12 compatibility
Lestropie Aug 12, 2024
5b5a0ea
mrtrix3.run: Improved shebang parsing
Lestropie Aug 12, 2024
7b10856
Merge pull request #2957 from MRtrix3/python_support_3_12
Lestropie Aug 12, 2024
1a7c2d9
Merge pull request #2956 from MRtrix3/dwi2tensor_constrained_reference
Lestropie Aug 12, 2024
2104608
mrtrix3.run: Further refinement to _shebang()
Lestropie Aug 12, 2024
9c32534
Merge pull request #2950 from MRtrix3/mrtrix-common-target
daljit46 Aug 12, 2024
eab106d
ZMerge remote-tracking branch 'origin/dev' into python_shebang_parser
Lestropie Aug 12, 2024
d3bb1b4
Merge pull request #2911 from MRtrix3/no_char_arguments
daljit46 Aug 13, 2024
fb7d615
run._shebang(): Fix non-use of determined shebang
Lestropie Aug 14, 2024
129bbf5
mrtrix3.run: Some renaming "shebang" -> "interpreter"
Lestropie Aug 14, 2024
cd0d42f
Merge pull request #2958 from MRtrix3/python_shebang_parser
Lestropie Aug 15, 2024
5193816
Fix drag & drop on Windows for mrview
daljit46 Apr 25, 2024
1f2656d
Parse URLs in GUI drop events using helper function
daljit46 May 30, 2024
bc57d8d
Move external deps in thirdparty
daljit46 Aug 19, 2024
28706ea
Update CI workflows for new handling of external deps
daljit46 Aug 19, 2024
47641c8
Patch Eigen configuration with custom patch
daljit46 Mar 12, 2024
61aa984
Provide option to specify local dependencies folder
daljit46 Aug 20, 2024
fa12bdb
Link pch_cmd against half
daljit46 Jul 10, 2024
a4ef4f0
Change location of FETCHCONTENT_BASE_DIR
daljit46 Jul 11, 2024
0978325
Use compressed release artefacts rather than cloning repos
daljit46 Jul 12, 2024
3014111
Avoid configuring Eigen via FetchContent_MakeAvaiable
daljit46 Jul 12, 2024
6736038
Don't set custom FETCHCONTENT_BASE_DIR
daljit46 Jul 25, 2024
10c4993
Remove core/file/json.h and core/half.hpp
MRtrixBot Aug 19, 2024
d591658
Fix invalid memory access when reading colour maps
daljit46 Aug 21, 2024
ab987ea
clang-format-all: Fix shebang
Lestropie Aug 20, 2024
f53b197
Merge pull request #2975 from MRtrix3/clang-format-all-shebang
Lestropie Aug 23, 2024
a3b583d
Update .git-blame-ignore-devs
MRtrixBot Aug 23, 2024
64e6647
Merge pull request #2976 from MRtrix3/update_git_blame
Lestropie Aug 26, 2024
4f52a59
dirmerge: Code formatting fixes from CI
Lestropie Aug 27, 2024
d9ddbd4
Merge pull request #2886 from MRtrix3/fix_drag_drop_mrview_windows
daljit46 Aug 28, 2024
02c8a76
Fetch NIfTI headers from remote host
daljit46 Aug 29, 2024
b17370c
Remove NIfTI headers from codebase
MRtrixBot Aug 29, 2024
c7638ab
CMake: Add NIfTI headers to documentation list of external dependencies
Lestropie Aug 30, 2024
78c8e4a
Remove duplicate line
daljit46 Aug 30, 2024
f0f4a4c
Merge pull request #2979 from MRtrix3/remote_nifti_headers
daljit46 Aug 30, 2024
f5ec480
5ttgen hsvs: Fix execution where FAST is not available
Lestropie Sep 2, 2024
769a4ca
Merge pull request #2981 from MRtrix3/5ttgen_hsvs_fix
Lestropie Sep 2, 2024
abf0985
dwibiasnormmask: Fix masking algorithm selection
Lestropie Sep 2, 2024
7817fda
Merge pull request #2983 from MRtrix3/dwibiasnormmask_maskalgo_fix
Lestropie Sep 2, 2024
b6f8d65
dirmerge: New option -firstisfirst
Lestropie Sep 2, 2024
a47ed52
New tests for dirmerge command
Lestropie Sep 2, 2024
2a40671
Merge pull request #2944 from MRtrix3/dirmerge_firstvol
Lestropie Sep 2, 2024
1434c49
Fix warnings from new pylint version
Lestropie Sep 2, 2024
025eb0f
Python executables shebang: use env
Lestropie Aug 16, 2024
07693ac
Revisions for new command dirrotate
Lestropie Sep 10, 2024
34f4a83
dirrotate: Reduce default number of rotations evaluated
Lestropie Sep 10, 2024
ba814f1
Add tests for dirrotate
Lestropie Sep 10, 2024
5c1f6ec
Merge remote-tracking branch 'origin/dev' into dirrotate
Lestropie Sep 10, 2024
f30ab69
Merge pull request #2943 from MRtrix3/dirrotate
Lestropie Sep 10, 2024
2f27ac6
Disable the use of LLD by default
daljit46 Sep 10, 2024
153d03c
Use ExternalProject to download test data at build time
daljit46 Aug 27, 2024
5fba417
Remove testing data submodules
daljit46 Aug 28, 2024
3a7d2f7
Update commit hashes for testing data repos
daljit46 Sep 10, 2024
91ac695
Log location of local testing data directories
daljit46 Sep 10, 2024
de81d47
Disable download logs for NIfTI headers to the console
daljit46 Sep 10, 2024
7bd2a1d
dwibiasnormmask minor tweaks
Lestropie Sep 11, 2024
0b27783
responsemean: Fix terminal message for 1 b-value
Lestropie Sep 11, 2024
ad3f5b6
Download NIfTI headers from GitHub
daljit46 Sep 11, 2024
bb38d56
Merge pull request #2993 from MRtrix3/fix_nifti_download
bjeurissen Sep 11, 2024
45e3d96
Merge pull request #2848 from MRtrix3/remove_data_submodule
daljit46 Sep 12, 2024
39d61f8
Merge pull request #2989 from MRtrix3/mrtrix_use_lld_option
daljit46 Sep 12, 2024
81d10ef
peaksconvert: Fix compilation
Lestropie Sep 16, 2024
68aa74b
Merge remote-tracking branch 'origin/dev' into new_peaks_cmds
Lestropie Sep 17, 2024
9939209
peaksconvert: Resolutions following merge
Lestropie Sep 17, 2024
19176e9
mrcalc: Support -config option
Lestropie May 20, 2024
22178a1
peakscheck: Updates following merge
Lestropie Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,13 @@ cd8a6f1c2d0debcf3a6de185f8b92fc0be3e1401
#Author: MRtrixBot <[email protected]>
#Date: Fri, 5 Apr 2024 14:06:00 +0100
# Replace include guards with #pragma once

9b3de4d4defc3c7572bcd3ab9f214b72ce91abf3
#Author: MRtrixBot <[email protected]>
#Date: Sun Jun 9 20:33:33 2024 +1000
# population_template: Split source code between files

10c49930a63e6a2b0ce7d25d3f6d8dde290b2719
#Author: MRtrixBot <[email protected]>
#Date: Mon, 19 Aug 2024 16:18:12 +0100
# Remove core/file/json.h and core/half.hpp
10 changes: 3 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build python3-distutils python3-numpy
sudo apt-get install clang qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-distutils python3-numpy

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install g++-9 qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy
sudo apt-get install g++-9 qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
Expand Down Expand Up @@ -208,10 +208,8 @@ jobs:
${{env.MINGW_PACKAGE_PREFIX}}-bc
${{env.MINGW_PACKAGE_PREFIX}}-cmake
${{env.MINGW_PACKAGE_PREFIX}}-diffutils
${{env.MINGW_PACKAGE_PREFIX}}-eigen3
${{env.MINGW_PACKAGE_PREFIX}}-fftw
${{env.MINGW_PACKAGE_PREFIX}}-gcc
${{env.MINGW_PACKAGE_PREFIX}}-libtiff
${{env.MINGW_PACKAGE_PREFIX}}-ninja
${{env.MINGW_PACKAGE_PREFIX}}-pkg-config
${{env.MINGW_PACKAGE_PREFIX}}-qt6-base
Expand Down Expand Up @@ -268,7 +266,6 @@ jobs:

- name: pylint
run: |
echo "__version__ = 'pylint testing' #pylint: disable=unused-variable" > ./python/lib/mrtrix3/_version.py
./run_pylint || { cat pylint.log; false; }

- name: check copyright headers
Expand All @@ -284,5 +281,4 @@ jobs:
extensions: 'h,cpp'
clangFormatVersion: 16
# Ignore third party headers
exclude: './core/file/json.h ./core/file/nifti1.h ./core/file/nifti2.h'

exclude: './thirdparty ./_deps'
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: ZedThree/[email protected]
id: review
with:
apt_packages: g++,qt6-base-dev,libqt6opengl6-dev,libglvnd-dev,libeigen3-dev,zlib1g-dev,libfftw3-dev,ninja-build
apt_packages: g++,qt6-base-dev,libqt6opengl6-dev,libglvnd-dev,zlib1g-dev,libfftw3-dev,ninja-build
config_file: .clang-tidy

- uses: ZedThree/clang-tidy-review/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@
.check_syntax.tmp
.check_syntax2.tmp
build/
CMakeLists.txt.user
CMakeLists.txt.user
testing/data/tmp*
testing/data/*-tmp-*
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
[submodule "testing/data"]
path = testing/binaries/data
url = https://github.com/MRtrix3/test_data
ignore = dirty
[submodule "testing/script_data"]
path = testing/scripts/data
url = https://github.com/MRtrix3/script_test_data.git
ignore = dirty
57 changes: 42 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

set(CMAKE_OSX_DEPLOYMENT_TARGET 11.00 CACHE STRING "")
project(mrtrix3 LANGUAGES CXX VERSION 3.0.4)

if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
message(WARNING "It is recommended to use the Ninja generator to build MRtrix3. "
"To use it, run cmake with -G Ninja or set the CMAKE_GENERATOR "
"environment variable to Ninja.")
endif()

include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand All @@ -15,6 +22,17 @@ option(MRTRIX_STL_DEBUGGING "Enable STL debug mode" OFF)
option(MRTRIX_BUILD_TESTS "Build tests executables" OFF)
option(MRTRIX_STRIP_CONDA "Strip ananconda/mininconda from PATH to avoid conflicts" ON)
option(MRTRIX_USE_PCH "Use precompiled headers" ON)
option(MRTRIX_PYTHON_SOFTLINK "Build directory softlink to Python source code rather than copying" ON)
option(MRTRIX_BUILD_NON_CORE_STATIC "Build MRtrix's non-core code as a static library" OFF)
option(MRTRIX_USE_LLD "Use lld as the linker" OFF)

set(MRTRIX_DEPENDENCIES_DIR "" CACHE PATH
"An optional local directory containing all thirdparty dependencies:\n \
- Eigen3 https://gitlab.com/libeigen/eigen (version 3.4.0 in .tar.gz format)\n \
- Json for Modern C++ https://github.com/nlohmann/json (version 3.11.3 in .tar.xz format)\n \
- Half https://half.sourceforge.net/ (version 2.1.0 in zip format)\n \
- NIfTI C headers https://nifti.nimh.nih.gov/pub/dist/src/nifti2/ (nifti1.h and nifti2.h stored in nifti/ subdirectory)\n"
)

if(MRTRIX_BUILD_TESTS)
if(CMAKE_VERSION VERSION_GREATER 3.17)
Expand Down Expand Up @@ -59,6 +77,10 @@ include(LinkerSetup)
include(FindFFTW)
include(CompilerCache)
include(ECMEnableSanitizers)
include(Dependencies)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
include(MacOSBundle)
endif()

use_compiler_cache()

Expand All @@ -69,30 +91,35 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git AND NOT EXISTS ${CMAKE_CURRENT_SOURCE
"and then run `pre-commit install` from the ${CMAKE_CURRENT_SOURCE_DIR} directory.")
endif()


add_compile_definitions(
add_library(mrtrix-common INTERFACE)
add_library(mrtrix::common ALIAS mrtrix-common)
target_compile_definitions(mrtrix-common INTERFACE
MRTRIX_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
$<$<PLATFORM_ID:Windows>:MRTRIX_WINDOWS>
$<$<PLATFORM_ID:Darwin>:MRTRIX_MACOSX>
$<$<PLATFORM_ID:FreeBSD>:MRTRIX_FREEBSD>
)

if(MRTRIX_STL_DEBUGGING AND $<NOT:$<CONFIG:Debug>>)
if(MSVC)
add_compile_definitions(_ITERATOR_DEBUG_LEVEL=1)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(_LIBCPP_DEBUG)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_compile_options(_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC)
endif()
if(MRTRIX_STL_DEBUGGING AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Enabling STL debug mode")
target_compile_definitions(mrtrix-common INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:_ITERATOR_DEBUG_LEVEL=1>
$<$<CXX_COMPILER_ID:GNU>:_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC>
$<$<CXX_COMPILER_ID:Clang>:_LIBCPP_DEBUG=1>
)
endif()

if(MRTRIX_WARNINGS_AS_ERRORS)
if (MSVC)
add_compile_options(/WX)
else()
add_compile_options(-Werror)
endif()
message(STATUS "Enabling warnings as errors")
target_compile_options(mrtrix-common INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/WX>
$<$<CXX_COMPILER_ID:GNU,Clang>:-Werror>
)
endif()

# Allow compilation of big object of files in debug mode on MINGW
if(MINGW AND CMAKE_BUILD_TYPE MATCHES "Debug")
target_compile_options(mrtrix-common INTERFACE -Wa,-mbig-obj)
endif()


Expand Down
2 changes: 1 addition & 1 deletion clang-format-all
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/env/python3
#!/usr/bin/env python3

# Copyright (c) 2008-2024 the MRtrix3 contributors.
#
Expand Down
7 changes: 4 additions & 3 deletions cmake/BashTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function(add_bash_test)
message(FATAL_ERROR "bash not found")
endif()

set(singleValueArgs FILE_PATH PREFIX WORKING_DIRECTORY)
set(singleValueArgs FILE_PATH PREFIX WORKING_DIRECTORY ENVIRONMENT)
set(multiValueArgs EXEC_DIRECTORIES LABELS)
cmake_parse_arguments(
ARG
Expand All @@ -20,6 +20,7 @@ function(add_bash_test)
set(prefix ${ARG_PREFIX})
set(working_directory ${ARG_WORKING_DIRECTORY})
set(exec_directories ${ARG_EXEC_DIRECTORIES})
set(environment ${ARG_ENVIRONMENT})
set(labels ${ARG_LABELS})

# Regenerate tests when the test script changes
Expand Down Expand Up @@ -47,11 +48,11 @@ function(add_bash_test)
)
set_tests_properties(${test_name}
PROPERTIES
ENVIRONMENT "PATH=${exec_directories}"
ENVIRONMENT "PATH=${exec_directories};${environment}"
)
if(labels)
set_tests_properties(${test_name} PROPERTIES LABELS "${labels}")
endif()

message(VERBOSE "Add bash tests commands for ${test_name}: ${line}")
message(VERBOSE "Added bash test command ${test_name}")
endfunction()
92 changes: 92 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
include(FetchContent)

if(NOT ${MRTRIX_DEPENDENCIES_DIR} STREQUAL "")
message(STATUS "Using local dependencies at ${MRTRIX_DEPENDENCIES_DIR}")
set(MRTRIX_LOCAL_DEPENDENCIES ON)
else()
set(MRTRIX_LOCAL_DEPENDENCIES OFF)
endif()

# Eigen
# We avoid configuring the Eigen library via FetchContent_MakeAvaiable
# to avoid the verbosity of Eigen's CMake configuration output.
if(MRTRIX_LOCAL_DEPENDENCIES)
set(eigen_url ${MRTRIX_DEPENDENCIES_DIR}/eigen-3.4.0.tar.gz)
else()
set(eigen_url "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz")
endif()

FetchContent_Declare(
eigen3
DOWNLOAD_EXTRACT_TIMESTAMP ON
URL ${eigen_url}
)
FetchContent_GetProperties(Eigen3)
if(NOT eigen3_POPULATED)
FetchContent_Populate(Eigen3)
add_library(Eigen3 INTERFACE)
add_library(Eigen3::Eigen ALIAS Eigen3)
target_include_directories(Eigen3 INTERFACE "${eigen3_SOURCE_DIR}")
endif()

# Json for Modern C++
if(MRTRIX_LOCAL_DEPENDENCIES)
set(json_url ${MRTRIX_DEPENDENCIES_DIR}/json.tar.xz)
else()
set(json_url "https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz")
endif()
FetchContent_Declare(
json
DOWNLOAD_EXTRACT_TIMESTAMP ON
URL ${json_url}
)
FetchContent_MakeAvailable(json)


# Half-precision floating-point library
if(MRTRIX_LOCAL_DEPENDENCIES)
set(half_url ${MRTRIX_DEPENDENCIES_DIR}/half-2.1.0.zip)
else()
set(half_url "https://sourceforge.net/projects/half/files/half/2.1.0/half-2.1.0.zip/download")
endif()
FetchContent_Declare(
half
DOWNLOAD_EXTRACT_TIMESTAMP ON
URL ${half_url}
)
FetchContent_MakeAvailable(half)

add_library(half INTERFACE)
add_library(half::half ALIAS half)
target_include_directories(half INTERFACE "${half_SOURCE_DIR}/include")


# Nifti headers
add_library(nifti INTERFACE)
add_library(nifti::nifti ALIAS nifti)

if(MRTRIX_LOCAL_DEPENDENCIES)
target_include_directories(nifti INTERFACE "${MRTRIX_DEPENDENCIES_DIR}/nifti")
else()
include(ExternalProject)
ExternalProject_Add(
nifti1
PREFIX nifti
URL "https://raw.githubusercontent.com/NIFTI-Imaging/nifti_clib/master/nifti2/nifti1.h"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
DOWNLOAD_NO_EXTRACT ON
DOWNLOAD_NO_PROGRESS ON
LOG_DOWNLOAD ON
)
ExternalProject_Add(
nifti2
PREFIX nifti
URL "https://raw.githubusercontent.com/NIFTI-Imaging/nifti_clib/master/nifti2/nifti2.h"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
DOWNLOAD_NO_EXTRACT ON
DOWNLOAD_NO_PROGRESS ON
LOG_DOWNLOAD ON
)
target_include_directories(nifti INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/nifti/src/")
endif()

37 changes: 2 additions & 35 deletions cmake/FindFFTW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,6 @@ if( FFTW_ROOT )
NO_DEFAULT_PATH
)

find_library(
FFTWF_LIB
NAMES "fftw3f"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)

find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)

#find includes
find_path(
FFTW_INCLUDES
Expand All @@ -87,19 +71,6 @@ else()
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)

find_library(
FFTWF_LIB
NAMES "fftw3f"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)


find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)

find_path(
FFTW_INCLUDES
NAMES "fftw3.h"
Expand All @@ -108,17 +79,13 @@ else()

endif()

set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})

if(FFTWL_LIB)
set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
endif()
set(FFTW_LIBRARIES ${FFTW_LIB})

set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_INCLUDES FFTW_LIBRARIES)

mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB)

Loading