diff --git a/Applications/src/construct-atlas.py b/Applications/src/construct-atlas.py index 9fa53fff4..e478115b8 100755 --- a/Applications/src/construct-atlas.py +++ b/Applications/src/construct-atlas.py @@ -11,8 +11,13 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description=""" Construct (spatio-temporal) atlas from images of the same anatomy of different subjects. + To construct a spatio-temporal atlas, images of subjects at different ages spread over - the atlas time range are required.""") + the atlas time range are required. Please cite the following preprint when you use this + command in your research (or the respective peer-reviewed article when accepted): + + Schuh et al., "Unbiased construction of a temporally consistent morphological + atlas of neonatal brain development", bioRxiv, 2018. doi:10.1101/251512""") parser.add_argument("config", help="JSON file with atlas configuration.") parser.add_argument("-a", "--ages", "--means", dest="means", type=float, nargs="+", help="Discrete time points for which to construct atlas.") diff --git a/Docker/Completion/Bash/docker-mirtk b/Docker/Completion/Bash/docker-mirtk index 424b35282..a9396df5f 100644 --- a/Docker/Completion/Bash/docker-mirtk +++ b/Docker/Completion/Bash/docker-mirtk @@ -13,7 +13,7 @@ # _docker_mirtk() { - local commands='deform-mesh recon-neonatal-cortex calculate-boundary-map calculate-surface-map calculate-volume-map compose-maps evaluate-surface-map evaluate-volume-map calculate-filtering calculate-gradients change-label measure-volume padding fill-holes fill-holes-nn-based em draw-em em-hard-segmentation kmeans normalize split-labels help-rst info aggregate-images average-images calculate-element-wise calculate-distance-map calculate-exponential-map calculate-lie-bracket calculate-logarithmic-map close-image combine-images convert-image cut-brain detect-edges dilate-image downsample-image edit-image erode-image evaluate-overlap extract-connected-components extract-image-region flip-image open-image reflect-image resample-image smooth-image subdivide-brain-image evaluate-similarity average-measure average-overlap register construct-atlas evaluate-atlas edit-dof invert-dof average-dofs bisect-dof compose-dofs convert-dof evaluate-dof evaluate-jacobian init-dof transform-image calculate-surface-attributes calculate-surface-spectrum close-scalars copy-pointset-attributes decimate-surface delete-pointset-attributes dilate-scalars erode-scalars evaluate-cardiac-motion evaluate-distance evaluate-distortion evaluate-surface-mesh evaluate-surface-overlap extract-connected-points offset-surface open-scalars project-onto-surface remesh-surface smooth-surface blend-surface convert-mris convert-pointset extract-pointset-cells extract-pointset-surface extract-surface merge-surfaces transform-points match-points convert-pointset-to-mat copy-pointset-attributes-from-mat' + local commands='deform-mesh recon-neonatal-cortex calculate-boundary-map calculate-surface-map calculate-volume-map compose-maps evaluate-surface-map evaluate-volume-map calculate-filtering calculate-gradients change-label measure-volume padding fill-holes fill-holes-nn-based em draw-em em-hard-segmentation kmeans normalize split-labels help-rst info aggregate-images average-images calculate-element-wise calculate-distance-map calculate-exponential-map calculate-lie-bracket calculate-logarithmic-map close-image combine-images convert-image cut-brain detect-edges dilate-image downsample-image edit-image erode-image evaluate-overlap extract-connected-components extract-image-region extract-image-slice extract-image-volume flip-image match-histogram open-image reflect-image resample-image smooth-image subdivide-brain-image evaluate-similarity average-measure average-overlap register construct-atlas evaluate-atlas edit-dof invert-dof average-dofs bisect-dof compose-dofs convert-dof evaluate-dof evaluate-jacobian init-dof transform-image calculate-surface-attributes calculate-surface-spectrum close-scalars copy-pointset-attributes decimate-surface delete-pointset-attributes dilate-scalars erode-scalars evaluate-cardiac-motion evaluate-distance evaluate-distortion evaluate-surface-mesh evaluate-surface-overlap extract-connected-points offset-surface open-scalars project-onto-surface remesh-surface smooth-surface blend-surface convert-mris convert-pointset extract-pointset-cells extract-pointset-surface extract-surface merge-surfaces transform-points match-points' local noreply='true' local nodocker='false' if [ $COMP_CWORD -gt 2 ] && [ ${COMP_WORDS[1]} = run ]; then diff --git a/Documentation/commands/_descriptions/construct-atlas.rst b/Documentation/commands/_descriptions/construct-atlas.rst index 9e90394be..d9e69aad8 100644 --- a/Documentation/commands/_descriptions/construct-atlas.rst +++ b/Documentation/commands/_descriptions/construct-atlas.rst @@ -3,4 +3,8 @@ Construct (spatio-temporal) atlas from images of the same anatomy of different subjects. To construct a spatio-temporal atlas, images of subjects at -different ages spread over the atlas time range are required. +different ages spread over the atlas time range are required. Please cite the +following preprint when you use this command in your research (or the +respective peer-reviewed article when accepted): Schuh et al., "Unbiased +construction of a temporally consistent morphological atlas of neonatal brain +development", bioRxiv, 2018. doi:10.1101/251512 diff --git a/Documentation/commands/_summaries/construct-atlas.rst b/Documentation/commands/_summaries/construct-atlas.rst index 83f729aa0..42784a60b 100644 --- a/Documentation/commands/_summaries/construct-atlas.rst +++ b/Documentation/commands/_summaries/construct-atlas.rst @@ -4,4 +4,8 @@ Construct (spatio-temporal) atlas from images of the same anatomy of different subjects. To construct a spatio-temporal atlas, images of subjects at - different ages spread over the atlas time range are required. + different ages spread over the atlas time range are required. Please cite the + following preprint when you use this command in your research (or the + respective peer-reviewed article when accepted): Schuh et al., "Unbiased + construction of a temporally consistent morphological atlas of neonatal brain + development", bioRxiv, 2018. doi:10.1101/251512 diff --git a/Documentation/download.rst b/Documentation/download.rst index 7ea327133..59840c234 100644 --- a/Documentation/download.rst +++ b/Documentation/download.rst @@ -60,15 +60,7 @@ of the downloaded MIRTK repository: after the initial clone command without any directory path argument. To download only selected additional files, run one or more of the following commands. -The MIRTK group hosts Git submodule repositories with copies of the Boost_ and Eigen_ -library header files required to build the core modules of the MIRTK -(see `MIRTK/Boost `__ and -`MIRTK/Eigen `__ projects on GitHub). Note that -these unofficial copies may not be suitable to build also the optional MIRTK Packages -below if these require additional header files not included in these repositories. -It is therefore recommended to install a compatible version of Boost and Eigen using -the official installation packages available for your operating system instead. -Other optional third-party libraries for which no binary installation packages for the +Optional third-party libraries for which no binary installation packages for the supported operating systems exists are included as Git submodules under the ThirdParty/ subdirectory of the MIRTK project. To download these third-party source files, run the following command(s): @@ -95,11 +87,10 @@ update the desired Git submodules before (re-)configuring the build files, e.g.: # Or download one or more of the following packages only git submodule update --init -- Packages/Deformable git submodule update --init -- Packages/Mapping + git submodule update --init -- Packages/Scripting git submodule update --init -- Packages/DrawEM -.. _Git: https://git-scm.com -.. _Boost: http://www.boost.org .. _Eigen: http://eigen.tuxfamily.org @@ -118,11 +109,9 @@ The license enables usage of MIRTK in both commercial and non-commercial applica without restrictions on the licensing applied to the combined work. The MIRTK Git repository includes source files and references to Git submodule repositories -whose source files are covered by their own respective license terms which are compatible +whose source files are covered by their own respective license terms, which are compatible with the MIRTK license. See the following links for details: -- `ThirdParty/Boost `__: `Boost Software License Version 1.0 `__ -- `ThirdParty/Eigen `__: `Mozilla Public License Version 2.0 `__ - `ThirdParty/LBFGS `__: `The MIT License `__ - `NIfTI C library `__: `Public domain `__ - `GIFTI C library `__: `Public domain `__ diff --git a/Documentation/getstarted.rst b/Documentation/getstarted.rst index f4cd7b519..b09162dfe 100644 --- a/Documentation/getstarted.rst +++ b/Documentation/getstarted.rst @@ -9,6 +9,8 @@ Get Started Install the software -------------------- +**Custom build** + Before you can start using the MIRTK or develop your own MIRTK applications, you have to install the desired modules and available applications on your system including their prerequisites. For a manual installation of the MIRTK, @@ -16,21 +18,44 @@ please follow the :doc:`download` and :doc:`install` instructions which list the third-party libraries required by each module and describe how to build the MIRTK from its publicly available source code. + +**Using Docker** + Instead of manually installing the MIRTK locally on your system, you can use the pre-made `biomedia/mirtk `_ Docker image to run the :doc:`commands` inside a `Docker container`_. - For a guide to install and use Docker_, see the `official docs `__. +**AppImage for Linux** + +For Linux users, the easiest way to get started with MIRTK without the need for the Docker +runtime environment is the `MIRTK AppImage`_ available on Bintray_. An AppImage_ contains +all the required shared libraries and pre-built MIRTK commands. It can be executed on any +Linux system with a compatible minimum glibc version (>=2.15). With this AppImage, there is no +actual need for an installation. Simply download the file, make it executable, and copy it to +a directory that is in your PATH, e.g.,:: + + wget -O mirtk https://bintray.com/schuhschuh/AppImages/download_file?file_path=MIRTK%2Bview-latest-x86_64-glibc2.15.AppImage + chmod a+x mirtk + sudo mv mirtk /usr/bin + +This AppImage is updated automatically when a change is committed to the master branch. + + .. _BashCompletion: -Bash completion ---------------- +Enable Bash completion +---------------------- + +**Custom build** For information on how to enable auto-completion_ when running ``mirtk`` commands of a manual MIRTK installation in the Bash_ shell, see the :doc:`install` instructions. + +**Using Docker** + To enable Bash completion for running the MIRTK commands with Docker, copy the `docker `__ and `docker-mirtk `__ @@ -47,7 +72,7 @@ On OS X with Homebrew, use these commands instead:: brew install bash-completion curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > $(brew --prefix)/etc/bash_completion.d/docker - curl -L https://raw.githubusercontent.com/BioMedIA/MIRTK/develop/Docker/Completion/Bash/docker-mirtk > $(brew --prefix)/etc/bash_completion.d/docker-mirtk + curl -L https://raw.githubusercontent.com/BioMedIA/MIRTK/master/Docker/Completion/Bash/docker-mirtk > $(brew --prefix)/etc/bash_completion.d/docker-mirtk Alternatively, save the files to your home directory at, for example, ``$HOME/bash_completion/`` and add the following lines to your ``.bashrc`` (Linux) or ``.bash_profile`` (OS X) file:: @@ -56,6 +81,22 @@ and add the following lines to your ``.bashrc`` (Linux) or ``.bash_profile`` (OS [ ! -f "$HOME/bash_completion/docker-mirtk" ] || . "$HOME/bash_completion/docker-mirtk" +**Using AppImage** + +To enable Bash completion for running the MIRTK commands in Bash using the AppImage for Linux, +copy `this file `__ +to ``/etc/bash_completion.d/``. + +This can be done with the following Terminal command:: + + sudo curl -L https://raw.githubusercontent.com/BioMedIA/MIRTK/master/Scripts/mirtk_bash_completion.sh > /etc/bash_completion.d/mirtk + +Alternatively, save the file to your home directory at, for example, ``$HOME/bash_completion/``, +rename it to ``mirtk``, and add the following line to your ``.bashrc`` file:: + + [ ! -f "$HOME/bash_completion/mirtk" ] || . "$HOME/bash_completion/mirtk" + + Run the commands ---------------- @@ -115,6 +156,9 @@ guidelines for more information on how to contribute your code to the MIRTK sour or develop your own MIRTK Package. +.. _AppImage: https://appimage.org/ +.. _MIRTK AppImage: https://bintray.com/schuhschuh/AppImages/MIRTK/master +.. _Bintray: https://bintray.com/schuhschuh/AppImages/MIRTK/master .. _Bash: https://www.gnu.org/software/bash/ .. _auto-completion: https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html .. _Homebrew: http://brew.sh diff --git a/Documentation/install.rst b/Documentation/install.rst index fa6fbad24..5495133d4 100644 --- a/Documentation/install.rst +++ b/Documentation/install.rst @@ -19,6 +19,7 @@ for Linux and OS X is 2.8.12, while version 3.4 or newer is needed on Windows. For the compilation of the MIRTK source code, a C++ compiler with support for the `C++11`_ standard is required. On Windows, the minimum required Visual Studio compiler version is 18.0. A compatible compiler is shipped with Visual Studio 2013 or newer. +For Unix operation systems, we recommend the use of the `GNU Compiler Collection`_ (GCC). To execute the :doc:`MIRTK commands `, a Python_ installation is required. Note that Python has to be installed before configuring the MIRTK build using CMake. @@ -68,6 +69,7 @@ Module Requires module(s) |Registration| |Common|, |Numerics|, |Image|, |Transformation| |PointSet|, |Deformable| |Deformable| |Common|, |Numerics|, |Image|, |Transformation|, |PointSet| |Mapping| |Common|, |Numerics|, |Image|, |PointSet| +|Scripting| |DrawEM| |Common|, |Numerics|, |Image|, |IO| =================== =========================================================== ======================================== @@ -260,6 +262,7 @@ The Bash completions are then available when a new Terminal window is opened. .. _C++11: https://isocpp.org/wiki/faq/cpp11 +.. _GNU Compiler Collection: https://gcc.gnu.org/ .. _Python: https://www.python.org .. _Boost: http://www.boost.org .. _Eigen: http://eigen.tuxfamily.org diff --git a/Documentation/modules.rst b/Documentation/modules.rst index 5873b3ba7..77253179e 100644 --- a/Documentation/modules.rst +++ b/Documentation/modules.rst @@ -17,6 +17,7 @@ Modules modules/registration modules/deformable modules/mapping + modules/scripting modules/drawem .. Replacements for use by descriptions included below to refer to other modules @@ -115,6 +116,14 @@ Mapping :doc:`[more] ` +Scripting +--------- + +.. include:: modules/_descriptions/scripting.rst + +:doc:`[more] ` + + Draw-EM ------- diff --git a/Documentation/modules/_descriptions/scripting.rst b/Documentation/modules/_descriptions/scripting.rst new file mode 100644 index 000000000..bcd77e711 --- /dev/null +++ b/Documentation/modules/_descriptions/scripting.rst @@ -0,0 +1,2 @@ +The Scripting module is a library of modules written in commonly used scripting +languages which can be used to write custom scripts for medical image analysis. diff --git a/Documentation/modules/_overview.rst b/Documentation/modules/_overview.rst index a5809c227..4cf62a546 100644 --- a/Documentation/modules/_overview.rst +++ b/Documentation/modules/_overview.rst @@ -11,6 +11,7 @@ Module Brief Description |Registration| Image and point set registration library. |Deformable| Library for Euler integration of deformable meshes such as cortical surfaces. |Mapping| Filters for the mapping of brain surfaces and volumes. +|Scripting| Collection of auxiliary modules for scripting languages such as Python. |DrawEM| Structural and tissue segmentation of neonatal brain MR images. =================== ============================================================================== diff --git a/Documentation/modules/_refs.rst b/Documentation/modules/_refs.rst index 58fb8af64..39972c068 100644 --- a/Documentation/modules/_refs.rst +++ b/Documentation/modules/_refs.rst @@ -7,4 +7,5 @@ .. |Registration| replace:: :doc:`Registration ` .. |Deformable| replace:: :doc:`Deformable ` .. |Mapping| replace:: :doc:`Mapping ` +.. |Scripting| replace:: :doc:`Scripting ` .. |DrawEM| replace:: :doc:`Draw-EM ` diff --git a/Documentation/modules/scripting.rst b/Documentation/modules/scripting.rst new file mode 100644 index 000000000..7cb0dace0 --- /dev/null +++ b/Documentation/modules/scripting.rst @@ -0,0 +1,7 @@ +================ +Scripting Module +================ + +.. include:: _descriptions/scripting.rst + +.. todo:: Document main module classes and their usage. diff --git a/Documentation/publications.rst b/Documentation/publications.rst index ad48bfe38..1f3f4a893 100644 --- a/Documentation/publications.rst +++ b/Documentation/publications.rst @@ -17,21 +17,24 @@ Publications ============ +Registration +------------ + **Classic free-form deformation** The following papers introduce the classic B-spline free-form deformation (FFD) algorithm. -.. [MICCAI01] `A generic framework for non-rigid registration based on non-uniform multi-level free-form deformations `__. |br| +.. [Schnabel01] `A generic framework for non-rigid registration based on non-uniform multi-level free-form deformations `__. |br| J. A. Schnabel, D. Rueckert, M. Quist, J. M. Blackall, A. D. Castellano Smith, T. Hartkens, G. P. Penney, W. A. Hall, H. Liu, C. L. Truwit, F.A. Gerritsen, D. L. G. Hill, and D.J. Hawkes. In 4th Int. Conf. on Medical Image Computing and Computer-Assisted Intervention (MICCAI '01), LNCS 2208:573-581, Utrecht, NL, October 2001. -.. [TMI99] `Non-rigid registration using free-form deformations: Application to breast MR images `__. |br| +.. [Rueckert99] `Non-rigid registration using free-form deformations: Application to breast MR images `__. |br| D. Rueckert, L. I. Sonoda, C. Hayes, D. L. G. Hill, M. O. Leach, and D. J. Hawkes. IEEE Transactions on Medical Imaging, 18(8):712-721, 1999. -.. [JCAT99] `Comparison and evaluation of rigid and non-rigid registration of breast MR images `__. |br| +.. [Denton99] `Comparison and evaluation of rigid and non-rigid registration of breast MR images `__. |br| E. R. E. Denton, L. I. Sonoda, D. Rueckert, S. C. Rankin, C. Hayes, M. Leach, D. L. G. Hill, and D. J. Hawkes. Journal of Computer Assisted Tomography, 23:800-805, 1999. @@ -41,7 +44,7 @@ The following papers introduce the classic B-spline free-form deformation (FFD) The use of the sparsity constraint for the spatio-temporal registration of cardiac image sequences was first published in the following conference article. -.. [MICCAI12] `Registration Using Sparse Free-Form Deformations `__. |br| +.. [Shi12] `Registration Using Sparse Free-Form Deformations `__. |br| W. Shi, X. Zhuang, L. Pizarro, W. Bai, H. Wang, K.-P. Tung, P. Edwards, and D. Rueckert. In 15th Int. Conf. on Medical Image Computing and Computer-Assisted Intervention (MICCAI '12), LNCS 7511:659-666, 2012. @@ -52,14 +55,14 @@ was first published in the following conference article. The following publications learn a statistical free-form deformation model from a training dataset to restrict the deformation on new images to the learned plausible deformations. -.. [TMI03] `Automatic Construction of 3D Statistical Deformation Models Using Non-rigid Registration `__. |br| +.. [Rueckert03] `Automatic Construction of 3D Statistical Deformation Models Using Non-rigid Registration `__. |br| D. Rueckert, A. F. Frangi, J. A. Schnabel. In 4th Int. Conf. on Medical Image Computing and Computer-Assisted Intervention (MICCAI '01), LNCS 2208:77-84, Utrecht, NL, October 2001. -.. [SPIE12] `Nonrigid free-form registration using landmark-based statistical deformation models. `__. |br| +.. [Pszczolkowski12] `Nonrigid free-form registration using landmark-based statistical deformation models. `__. |br| S. Pszczolkowski, L. Pizarro, R. Guerrero, D. Rueckert. - Proc. SPIE 8314, Medical Imaging 2012: Image Processing, 831418 (February 23, 2012) + Proc. SPIE 8314, Medical Imaging 2012: Image Processing, 831418, February 2012. **Symmetric/Diffeomorphic free-form deformation** @@ -68,17 +71,45 @@ The details and application of the symmetric diffeomorphic registration which pa non-rigid transformation by a stationary velocity field with B-spline interpolation can be found in the following workshop paper. -.. [STIA14] `Construction of a 4D Brain Atlas and Growth Model using Diffeomorphic Registration `__. |br| +.. [Schuh14] `Construction of a 4D Brain Atlas and Growth Model using Diffeomorphic Registration `__. |br| A. Schuh, M. Murgasova, A. Makropoulos, C. Ledig, S. J. Counsell, J. V. Hajnal, P. Aljabar D. Rueckert. In 3rd MICCAI Workshop on Spatiotemporal Image Analysis for Longitudinal and Time-Series Image Data (STIA), - LNCS 8682, pp. 27-37, Boston, MA (2014) + LNCS 8682, pp. 27-37, Boston, MA, 2014. + +.. [Schuh18] `Unbiased construction of a temporally consistent morphological atlas of neonatal brain development `__. |br| + A. Schuh, A. Makropoulos, E. C. Robinson, L. Cordero-Grande, E. Hughes, J. Hutter, A. N. Price, M. Murgasova, R. Pedro A. G. Teixeira, N. Tusor, J. K. Steinweg, S. Victor, M. A. Rutherford, J. V. Hajnal, A. D. Edwards, D. Rueckert. + bioRxiv, 2018. + -**Draw-EM: Developing brain Region Annotation With Expectation-Maximization** +Draw-EM +------- -.. [TMI14] `Automatic whole brain MRI segmentation of the developing neonatal brain `__. |br| +When you use the Developing brain Region Annotation With Expectation-Maximization (Draw-EM) package, please cite the following article: + +.. [Makropoulos14] `Automatic whole brain MRI segmentation of the developing neonatal brain `__. |br| A. Makropoulos, I. S. Gousias, C. Ledig, P. Aljabar, A. Serag, J. V. Hajnal, A. D. Edwards, S. J. Counsell, D. Rueckert. IEEE Transactions on Medical Imaging, vol. 33 (9), pp. 1818-1831, 2014. + +Deformable +---------- + +**Neonatal cortex reconstruction** + +The reconstruction of the neonatal cortex from T2-weighted (and T1-weighted) brain MR images is detailed in: + +.. [Schuh17] `A deformable model for the reconstruction of the neonatal cortex `__. |br| + A. Schuh, A. Makropoulos, R. Wright, E. C. Robinson, N. Tusor, J. Steinweg, E. Hughes, L. Cordero-Grande, A. N. Price, J. Hutter, J. V. Hajnal, D. Rueckert. + In 14th IEEE International Symposium on Biomedical Imaging (ISBI), April 2017. + +.. [Makropoulos18] `The developing human connectome project: A minimal processing pipeline for neonatal cortical surface reconstruction `__. |br| + A. Makropoulos, E. C Robinson, A. Schuh, R. Wright, S. Fitzgibbon, J. Bozek, S. J. Counsell, J. Steinweg, J. Passerat-Palmbach, G. Lenz, F. Mortari, T. Tenev, E. P. Duff, M. Bastiani, L. Cordero-Grande, E. Hughes, N. Tusor, J.-D. Tournier, J. Hutter, A. N. Price, M. Murgasova, C. Kelly, M. A. Rutherford, S. M. Smith, A. D. Edwards, J. V. Hajnal, M. Jenkinson, D. Rueckert. + NeuroImage, vol. 173, pp. 88-112, 2018. + + +Point Set +--------- + **Spectral surface matching** The spectral surface matching implementations are based on the MATLAB code provided by diff --git a/Scripts/mirtk_bash_completion.sh b/Scripts/mirtk_bash_completion.sh new file mode 100644 index 000000000..fe10eacc6 --- /dev/null +++ b/Scripts/mirtk_bash_completion.sh @@ -0,0 +1,36 @@ + +# Auto-generated by MIRTK root CMakeLists.txt during CMake configure. +# +# To enable Bash completion of "mirtk" subcommands, add the following to your +# ~/.bashrc (Linux) or ~/.bash_profile (OS X) file: +# +# [ ! -f "$MIRTK_ROOT/share/completion/bash/mirtk" ] || +# source "$MIRTK_ROOT/share/completion/bash/mirtk" +# [ ! -f "$MIRTK_ROOT/share/mirtk/completion/bash/mirtk" ] || +# source "$MIRTK_ROOT/share/mirtk/completion/bash/mirtk" +# +# Alternatively, copy this file to: +# - /etc/bash_completion.d/ (Linux) +# - $(brew --prefix)/etc/bash_completion.d/ (OS X, Homebrew) +# +_mirtk_complete() +{ + local commands='deform-mesh recon-neonatal-cortex calculate-boundary-map calculate-surface-map calculate-volume-map compose-maps evaluate-surface-map evaluate-volume-map calculate-filtering calculate-gradients change-label measure-volume padding fill-holes fill-holes-nn-based em draw-em em-hard-segmentation kmeans normalize split-labels help-rst info aggregate-images average-images calculate-element-wise calculate-distance-map calculate-exponential-map calculate-lie-bracket calculate-logarithmic-map close-image combine-images convert-image cut-brain detect-edges dilate-image downsample-image edit-image erode-image evaluate-overlap extract-connected-components extract-image-region extract-image-slice extract-image-volume flip-image match-histogram open-image reflect-image resample-image smooth-image subdivide-brain-image evaluate-similarity average-measure average-overlap register construct-atlas evaluate-atlas edit-dof invert-dof average-dofs bisect-dof compose-dofs convert-dof evaluate-dof evaluate-jacobian init-dof transform-image calculate-surface-attributes calculate-surface-spectrum close-scalars copy-pointset-attributes decimate-surface delete-pointset-attributes dilate-scalars erode-scalars evaluate-cardiac-motion evaluate-distance evaluate-distortion evaluate-surface-mesh evaluate-surface-overlap extract-connected-points offset-surface open-scalars project-onto-surface remesh-surface smooth-surface blend-surface convert-mris convert-pointset extract-pointset-cells extract-pointset-surface extract-surface merge-surfaces transform-points match-points' + local noreply='true' + if [ $COMP_CWORD -eq 2 ]; then + if [ ${COMP_WORDS[1]} = help ] || [ ${COMP_WORDS[1]} = help-rst ]; then + COMPREPLY=( `compgen -W "$commands" -- ${COMP_WORDS[COMP_CWORD]}` ) + noreply='false' + fi + elif [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( `compgen -W "help help-rst $commands" -- ${COMP_WORDS[COMP_CWORD]}` ) + noreply='false' + fi + if [ $noreply = true ]; then + local IFS=$' +' + COMPREPLY=(`compgen -o plusdirs -f -- "${COMP_WORDS[COMP_CWORD]}"`) + compopt -o filenames +o nospace 2>/dev/null || compgen -f /non-existing-dir/ > /dev/null + fi +} +complete -F _mirtk_complete mirtk