├── .gitignore ├── Makefile ├── README.md ├── data ├── stack-1.nii.gz ├── stack-2.nii.gz ├── stack-3.nii.gz ├── stack-4.nii.gz ├── stack-5.nii.gz ├── stack-6.nii.gz ├── stack-7.nii.gz └── stack-8.nii.gz ├── img ├── bare_stack-1.png ├── bare_stack-2.png ├── bare_stack-3.png ├── bare_stack-4.png ├── bare_stack-5.png ├── bare_stack-6.png ├── bare_stack-7.png ├── bare_stack-8.png ├── detection_stack-1.png ├── detection_stack-2.png ├── detection_stack-3.png ├── detection_stack-4.png ├── detection_stack-5.png ├── detection_stack-6.png ├── detection_stack-7.png ├── detection_stack-8.png ├── masked_stack-1.png ├── masked_stack-2.png ├── masked_stack-3.png ├── masked_stack-4.png ├── masked_stack-5.png ├── masked_stack-6.png ├── masked_stack-7.png ├── masked_stack-8.png ├── motion_corrected_volume.png ├── proba_stack-1.png ├── proba_stack-2.png ├── proba_stack-3.png ├── proba_stack-4.png ├── proba_stack-5.png ├── proba_stack-6.png ├── proba_stack-7.png ├── proba_stack-8.png ├── res_stack-1.png ├── res_stack-2.png ├── res_stack-3.png ├── res_stack-4.png ├── res_stack-5.png ├── res_stack-6.png ├── res_stack-7.png ├── res_stack-8.png ├── seg_stack-1.png ├── seg_stack-2.png ├── seg_stack-3.png ├── seg_stack-4.png ├── seg_stack-5.png ├── seg_stack-6.png ├── seg_stack-7.png ├── seg_stack-8.png ├── stack-1.png ├── stack-2.png ├── stack-3.png ├── stack-4.png ├── stack-5.png ├── stack-6.png ├── stack-7.png ├── stack-8.png ├── very_large_stack-1.png ├── very_large_stack-2.png ├── very_large_stack-3.png ├── very_large_stack-4.png ├── very_large_stack-5.png ├── very_large_stack-6.png ├── very_large_stack-7.png └── very_large_stack-8.png ├── model ├── mser_detector_0_linearSVM ├── mser_detector_0_linearSVM_01.npy ├── mser_detector_0_linearSVM_02.npy ├── mser_detector_0_linearSVM_03.npy ├── mser_detector_0_linearSVM_04.npy ├── mser_detector_0_linearSVM_05.npy └── vocabulary_0.npy ├── output_detection ├── stack-1.nii.gz ├── stack-2.nii.gz ├── stack-3.nii.gz ├── stack-4.nii.gz ├── stack-5.nii.gz ├── stack-6.nii.gz ├── stack-7.nii.gz └── stack-8.nii.gz ├── output_reconstruction └── motion_corrected_volume.nii.gz ├── output_segmentation ├── bare_stack-1.nii.gz ├── bare_stack-2.nii.gz ├── bare_stack-3.nii.gz ├── bare_stack-4.nii.gz ├── bare_stack-5.nii.gz ├── bare_stack-6.nii.gz ├── bare_stack-7.nii.gz ├── bare_stack-8.nii.gz ├── masked_stack-1.nii.gz ├── masked_stack-2.nii.gz ├── masked_stack-3.nii.gz ├── masked_stack-4.nii.gz ├── masked_stack-5.nii.gz ├── masked_stack-6.nii.gz ├── masked_stack-7.nii.gz ├── masked_stack-8.nii.gz ├── proba_stack-1.nii.gz ├── proba_stack-2.nii.gz ├── proba_stack-3.nii.gz ├── proba_stack-4.nii.gz ├── proba_stack-5.nii.gz ├── proba_stack-6.nii.gz ├── proba_stack-7.nii.gz ├── proba_stack-8.nii.gz ├── res_stack-1.nii.gz ├── res_stack-2.nii.gz ├── res_stack-3.nii.gz ├── res_stack-4.nii.gz ├── res_stack-5.nii.gz ├── res_stack-6.nii.gz ├── res_stack-7.nii.gz ├── res_stack-8.nii.gz ├── seg_stack-1.nii.gz ├── seg_stack-2.nii.gz ├── seg_stack-3.nii.gz ├── seg_stack-4.nii.gz ├── seg_stack-5.nii.gz ├── seg_stack-6.nii.gz ├── seg_stack-7.nii.gz ├── seg_stack-8.nii.gz ├── very_large_stack-1.nii.gz ├── very_large_stack-2.nii.gz ├── very_large_stack-3.nii.gz ├── very_large_stack-4.nii.gz ├── very_large_stack-5.nii.gz ├── very_large_stack-6.nii.gz ├── very_large_stack-7.nii.gz └── very_large_stack-8.nii.gz ├── run.sh ├── show.py └── train.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | 3 | # C extensions 4 | *.so 5 | 6 | # Packages 7 | *.egg 8 | *.egg-info 9 | dist/ 10 | build/ 11 | eggs/ 12 | parts/ 13 | bin/ 14 | var/ 15 | sdist/ 16 | develop-eggs/ 17 | .installed.cfg 18 | lib/ 19 | lib64/ 20 | tmp/ 21 | __pycache__ 22 | 23 | # Installer logs 24 | pip-log.txt 25 | 26 | # Unit test / coverage reports 27 | .coverage 28 | .tox 29 | nosetests.xml 30 | 31 | # Translations 32 | *.mo 33 | 34 | # Mr Developer 35 | .mr.developer.cfg 36 | .project 37 | .pydevproject 38 | 39 | # latex 40 | auto/ 41 | *.aux 42 | *.glo 43 | *.idx 44 | *.log 45 | *.toc 46 | *.ist 47 | *.acn 48 | *.acr 49 | *.alg 50 | *.bbl 51 | *.blg 52 | *.dvi 53 | *.glg 54 | *.gls 55 | *.ilg 56 | *.ind 57 | *.lof 58 | *.lot 59 | *.maf 60 | *.mtc 61 | *.mtc1 62 | *.out 63 | *.synctex.gz 64 | *.nav 65 | *.pyg2 66 | *.snm 67 | *.vrb 68 | 69 | # emacs 70 | *~ 71 | \#* 72 | .\#* 73 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | ./run.sh 3 | 4 | png: 5 | python show.py 6 | 7 | clean: 8 | rm -r output_detection 9 | rm -r output_segmentation 10 | rm -r output_reconstruction 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Automated Fetal Brain Segmentation from 2D MRI Slices for Motion Correction 2 | =========================================================================== 3 | 4 | This GitHub repository contains a complete example to segment 5 | the fetal brain in MRI and perform motion correction in a fully automatic way 6 | using the code from [1] and [3], which is publicly available at: 7 | 8 | https://github.com/BioMedIA/IRTK 9 | 10 | A step-by-step installation guide with a frozen version of IRTK is available at: 11 | 12 | http://kevin-keraudren.blogspot.co.uk/2014/10/automated-segmentation-of-fetal-brain.html 13 | 14 | 15 | Prerequisites 16 | ------------- 17 | 18 | In order to install a working Python environment with all the necessary packages 19 | (numpy, scipy,cython, scikit-learn and OpenCV), it is simpler to use a 20 | prepackaged installation such as the one provided by Continuum Analytics in 21 | Anaconda. 22 | 23 | http://continuum.io/downloads 24 | 25 | Then you need to build IRTK, enabling the Python wrappers: 26 | 27 | git clone https://github.com/BioMedIA/IRTK.git 28 | cd IRTK 29 | mkdir build 30 | cd build 31 | cmake -D BUILD_WITH_PNG=ON -D WRAP_CYTHON=ON .. 32 | make -j 3 33 | 34 | Lastly, you now need to update your PYTHONPATH: 35 | get the full path of "irtk/build/lib" and add to your `~/.bashrc` : 36 | 37 | export PYTHONPATH=full_path/irtk/build/lib:$PYTHONPATH 38 | 39 | **Note:** 40 | This code was last tested with Anaconda 2.1.0, which comes with the following versions of the different Python modules: 41 | https://docs.continuum.io/anaconda/old-pkg-lists/2.1.0/py27 42 | 43 | In particular, scikit-learn 0.15.2 was used when training and saving the provided models. Using a different version of scikit-learn may lead to the following error message: `AttributeError: 'LinearSVC' object has no attribute 'classes_'`. 44 | 45 | 46 | Training a model 47 | ---------------- 48 | 49 | Trained models are already provided in the "model/" folder. 50 | If you wish to train models on your own data, you need to install SimpleITK, 51 | which can be done with the following command: 52 | 53 | easy_install SimpleITK 54 | 55 | 1. Learn a vocabulary of 2D SIFT features (extracted using OpenCV) with 56 | MiniBatchKmean from scikit-learn and taking the cluster centers: 57 | ``create_bow.py`` 58 | 59 | 2. Train an SVM classifier on histogram of SIFT features extractede within MSER regions 60 | (which are first filtered by size using the gestational age): 61 | ``learn_mser.py`` 62 | 63 | 64 | Running the example 65 | ------------------- 66 | 67 | In order to run the example, you first need to edit the script "runs.sh" so that 68 | the variables SCRIPT_DIR and BIN_DIR point respectively to 69 | The example can be run with the following command: 70 | 71 | ``./run.sh -a`` 72 | 73 | It performs the following 3 steps on the dataset provided in the folder "data": 74 | 75 | 1. Brain detection 76 | 77 | 2. Brain segmentation 78 | 79 | 3. Motion correction 80 | 81 | ``` 82 | Usage: ./run.sh -a 83 | 84 | Valid options are: -1, -2, -3, -a, -d 85 | -1 to run only the detection step 86 | -2 to run only the segmentation step 87 | -3 to only the motion correction step 88 | -a to run all steps 89 | -d for debugging 90 | ``` 91 | 92 | Dataset 93 | ------- 94 | 95 | The folder "data/" contains 8 stacks of a subject at 29.7 gestational weeks. 96 | 97 | 2 coronal stacks (1-2): 98 | 99 | 100 | 101 | 2 sagittal stacks (3-4): 102 | 103 | 104 | 105 | and 4 transverse stacks (5-8): 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Output 114 | ------ 115 | 116 | Segmented brains: 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | Motion corrected volume: 131 | 132 | 133 | 134 | 135 | References 136 | ---------- 137 | 138 | [1] Keraudren, K., Kuklisova-Murgasova, M., Kyriakopoulou, V., Malamateniou, C., 139 | Rutherford, M.A., Kainz, B., Hajnal, J.V., Rueckert, D., 2014. Automated Fetal Brain 140 | Segmentation from 2D MRI Slices for Motion Correction. NeuroImage. 141 | http://www.sciencedirect.com/science/article/pii/S1053811914005953 142 | 143 | [2] Keraudren, K., Kyriakopoulou, V., Rutherford, M., Hajnal, J., Rueckert, D., 144 | 2013. Localisation of the Brain in Fetal MRI Using Bundled SIFT Features, in: 145 | MICCAI, Springer. 146 | http://www.doc.ic.ac.uk/~kpk09/publications/MICCAI-2013.pdf 147 | 148 | [3] Kuklisova-Murgasova, M., Quaghebeur, G., Rutherford, M.A., Hajnal, J.V., 149 | Schnabel, J.A., 2012. Reconstruction of Fetal Brain MRI with Intensity Matching 150 | and Complete Outlier Removal. Medical Image Analysis. 151 | http://www.medicalimageanalysisjournal.com/article/S1361-8415(12)00096-5/fulltext 152 | -------------------------------------------------------------------------------- /data/stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-1.nii.gz -------------------------------------------------------------------------------- /data/stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-2.nii.gz -------------------------------------------------------------------------------- /data/stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-3.nii.gz -------------------------------------------------------------------------------- /data/stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-4.nii.gz -------------------------------------------------------------------------------- /data/stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-5.nii.gz -------------------------------------------------------------------------------- /data/stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-6.nii.gz -------------------------------------------------------------------------------- /data/stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-7.nii.gz -------------------------------------------------------------------------------- /data/stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/data/stack-8.nii.gz -------------------------------------------------------------------------------- /img/bare_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-1.png -------------------------------------------------------------------------------- /img/bare_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-2.png -------------------------------------------------------------------------------- /img/bare_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-3.png -------------------------------------------------------------------------------- /img/bare_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-4.png -------------------------------------------------------------------------------- /img/bare_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-5.png -------------------------------------------------------------------------------- /img/bare_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-6.png -------------------------------------------------------------------------------- /img/bare_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-7.png -------------------------------------------------------------------------------- /img/bare_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/bare_stack-8.png -------------------------------------------------------------------------------- /img/detection_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-1.png -------------------------------------------------------------------------------- /img/detection_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-2.png -------------------------------------------------------------------------------- /img/detection_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-3.png -------------------------------------------------------------------------------- /img/detection_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-4.png -------------------------------------------------------------------------------- /img/detection_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-5.png -------------------------------------------------------------------------------- /img/detection_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-6.png -------------------------------------------------------------------------------- /img/detection_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-7.png -------------------------------------------------------------------------------- /img/detection_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/detection_stack-8.png -------------------------------------------------------------------------------- /img/masked_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-1.png -------------------------------------------------------------------------------- /img/masked_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-2.png -------------------------------------------------------------------------------- /img/masked_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-3.png -------------------------------------------------------------------------------- /img/masked_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-4.png -------------------------------------------------------------------------------- /img/masked_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-5.png -------------------------------------------------------------------------------- /img/masked_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-6.png -------------------------------------------------------------------------------- /img/masked_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-7.png -------------------------------------------------------------------------------- /img/masked_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/masked_stack-8.png -------------------------------------------------------------------------------- /img/motion_corrected_volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/motion_corrected_volume.png -------------------------------------------------------------------------------- /img/proba_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-1.png -------------------------------------------------------------------------------- /img/proba_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-2.png -------------------------------------------------------------------------------- /img/proba_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-3.png -------------------------------------------------------------------------------- /img/proba_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-4.png -------------------------------------------------------------------------------- /img/proba_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-5.png -------------------------------------------------------------------------------- /img/proba_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-6.png -------------------------------------------------------------------------------- /img/proba_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-7.png -------------------------------------------------------------------------------- /img/proba_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/proba_stack-8.png -------------------------------------------------------------------------------- /img/res_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-1.png -------------------------------------------------------------------------------- /img/res_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-2.png -------------------------------------------------------------------------------- /img/res_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-3.png -------------------------------------------------------------------------------- /img/res_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-4.png -------------------------------------------------------------------------------- /img/res_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-5.png -------------------------------------------------------------------------------- /img/res_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-6.png -------------------------------------------------------------------------------- /img/res_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-7.png -------------------------------------------------------------------------------- /img/res_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/res_stack-8.png -------------------------------------------------------------------------------- /img/seg_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-1.png -------------------------------------------------------------------------------- /img/seg_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-2.png -------------------------------------------------------------------------------- /img/seg_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-3.png -------------------------------------------------------------------------------- /img/seg_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-4.png -------------------------------------------------------------------------------- /img/seg_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-5.png -------------------------------------------------------------------------------- /img/seg_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-6.png -------------------------------------------------------------------------------- /img/seg_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-7.png -------------------------------------------------------------------------------- /img/seg_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/seg_stack-8.png -------------------------------------------------------------------------------- /img/stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-1.png -------------------------------------------------------------------------------- /img/stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-2.png -------------------------------------------------------------------------------- /img/stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-3.png -------------------------------------------------------------------------------- /img/stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-4.png -------------------------------------------------------------------------------- /img/stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-5.png -------------------------------------------------------------------------------- /img/stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-6.png -------------------------------------------------------------------------------- /img/stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-7.png -------------------------------------------------------------------------------- /img/stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/stack-8.png -------------------------------------------------------------------------------- /img/very_large_stack-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-1.png -------------------------------------------------------------------------------- /img/very_large_stack-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-2.png -------------------------------------------------------------------------------- /img/very_large_stack-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-3.png -------------------------------------------------------------------------------- /img/very_large_stack-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-4.png -------------------------------------------------------------------------------- /img/very_large_stack-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-5.png -------------------------------------------------------------------------------- /img/very_large_stack-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-6.png -------------------------------------------------------------------------------- /img/very_large_stack-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-7.png -------------------------------------------------------------------------------- /img/very_large_stack-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/img/very_large_stack-8.png -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM_01.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM_01.npy -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM_02.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM_02.npy -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM_03.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM_03.npy -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM_04.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM_04.npy -------------------------------------------------------------------------------- /model/mser_detector_0_linearSVM_05.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/mser_detector_0_linearSVM_05.npy -------------------------------------------------------------------------------- /model/vocabulary_0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/model/vocabulary_0.npy -------------------------------------------------------------------------------- /output_detection/stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-1.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-2.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-3.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-4.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-5.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-6.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-7.nii.gz -------------------------------------------------------------------------------- /output_detection/stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_detection/stack-8.nii.gz -------------------------------------------------------------------------------- /output_reconstruction/motion_corrected_volume.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_reconstruction/motion_corrected_volume.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/bare_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/bare_stack-8.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/masked_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/masked_stack-8.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/proba_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/proba_stack-8.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/res_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/res_stack-8.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/seg_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/seg_stack-8.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-1.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-1.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-2.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-2.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-3.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-3.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-4.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-4.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-5.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-5.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-6.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-6.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-7.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-7.nii.gz -------------------------------------------------------------------------------- /output_segmentation/very_large_stack-8.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevin-keraudren/example-motion-correction/7c8ac54213cecd4fbb15f700b14d73f7086cf11d/output_segmentation/very_large_stack-8.nii.gz -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | do_detection=false 6 | do_segmentation=false 7 | do_reconstruction=false 8 | debug=false 9 | 10 | function usage { 11 | echo "Usage: $0 -a" >&2 12 | echo "" >&2 13 | echo "Valid options are: -1, -2, -3, -a, -d" >&2 14 | echo " -1 to run only the detection step" >&2 15 | echo " -2 to run only the segmentation step" >&2 16 | echo " -3 to only the motion correction step" >&2 17 | echo " -a to run all steps" >&2 18 | echo " -d for debugging" >&2 19 | exit 1 20 | } 21 | 22 | # getopts (with an "s") only deals with short options 23 | while getopts "123ad" opt 24 | do 25 | case $opt in 26 | 1) 27 | do_detection=true 28 | ;; 29 | 2) 30 | do_segmentation=true 31 | ;; 32 | 3) 33 | do_reconstruction=true 34 | ;; 35 | a) 36 | do_detection=true 37 | do_segmentation=true 38 | do_reconstruction=true 39 | ;; 40 | d) 41 | set -x 42 | debug=true 43 | ;; 44 | \?) 45 | echo "Invalid option: -$OPTARG" >&2 46 | usage 47 | ;; 48 | esac 49 | done 50 | 51 | echo \ 52 | "This script is an example of a fully automated motion correction of the 53 | fetal brain, as described in \"Automated Fetal Brain Segmentation from 2D MRI 54 | Slices for Motion Correction\", K. Keraudren et al. (2014)" 55 | echo "" 56 | 57 | if [ "$do_detection" = false ] && [ "$do_segmentation" = false ] && [ "$do_reconstruction" = false ] 58 | then 59 | usage 60 | fi 61 | 62 | # Parameters for all steps 63 | ROOT_DIR="/home/kke14/Prachi/" 64 | SCRIPT_DIR="$ROOT_DIR/irtk/wrapping/cython/scripts/" 65 | BIN_DIR="$ROOT_DIR/irtk/build/bin/" 66 | ga=29.7 67 | NEW_SAMPLING=0.8 68 | 69 | # Brain detection 70 | vocabulary="model/vocabulary_0.npy" 71 | mser_detector="model/mser_detector_0_linearSVM" 72 | detection_folder="output_detection" 73 | 74 | mkdir -p $detection_folder 75 | 76 | if [ "$do_detection" = true ] 77 | then 78 | echo "Performing brain detection" 79 | echo 80 | for filename in data/*.nii.gz 81 | do 82 | mask_file=${detection_folder}/`basename $filename` 83 | 84 | python $SCRIPT_DIR/fetalMask_detection.py \ 85 | $filename \ 86 | $ga \ 87 | $mask_file \ 88 | --classifier $mser_detector \ 89 | --vocabulary $vocabulary \ 90 | --new_sampling $NEW_SAMPLING 91 | done 92 | fi 93 | 94 | # Brain segmentation 95 | segmentation_folder="output_segmentation" 96 | 97 | mkdir -p $segmentation_folder 98 | 99 | if [ "$do_segmentation" = true ] 100 | then 101 | echo "Performing brain segmentation" 102 | echo 103 | for filename in data/*.nii.gz 104 | do 105 | mask_file=${detection_folder}/`basename $filename` 106 | 107 | python $SCRIPT_DIR/fetalMask_segmentation.py \ 108 | --img $filename \ 109 | --ga $ga \ 110 | --mask $mask_file \ 111 | --output_dir $segmentation_folder \ 112 | --cpu 5 \ 113 | --do_3D \ 114 | --mass 115 | done 116 | fi 117 | 118 | # Motion correction 119 | reconstruction_folder="output_reconstruction" 120 | template_counter=1 121 | motion_corrected_volume="motion_corrected_volume.nii.gz" 122 | N=8 # Number of stacks. 123 | 124 | mkdir -p $reconstruction_folder 125 | 126 | # we pass the masked_* files, the registration parameters, the proba_* files 127 | # and the very_large_* files 128 | cmd="/usr/bin/time --verbose --output time.txt $BIN_DIR/reconstructionMasking $motion_corrected_volume $N ../$segmentation_folder/masked_stack-${template_counter}.nii.gz" 129 | transformation_list="id" 130 | proba_list=../$segmentation_folder/proba_stack-${template_counter}.nii.gz 131 | second_list=../$segmentation_folder/very_large_stack-${template_counter}.nii.gz 132 | 133 | cd $reconstruction_folder 134 | for COUNTER in {2..8} 135 | do 136 | # register all stacks to template stack 137 | $BIN_DIR/rreg ../data/stack-${template_counter}.nii.gz ../data/stack-${COUNTER}.nii.gz \ 138 | -dofout dof_${COUNTER}.dof \ 139 | -center 140 | 141 | # fill in the lists 142 | # the small boxes cropped around the brain 143 | cmd="$cmd ../$segmentation_folder/masked_stack-${COUNTER}.nii.gz" 144 | # the registration parameters to the template stack 145 | transformation_list="$transformation_list dof_${COUNTER}.dof" 146 | # the probabibilistic segmentations 147 | proba_list="$proba_list ../$segmentation_folder/proba_stack-${COUNTER}.nii.gz" 148 | # the large boxes cropped around the brain 149 | second_list="$second_list ../$segmentation_folder/very_large_stack-${COUNTER}.nii.gz" 150 | done 151 | 152 | cmd="$cmd $transformation_list -log_prefix myprefix_ \ 153 | -smooth_mask 4 \ 154 | -resolution 0.75 \ 155 | -info slice_info.tsv \ 156 | -proba $proba_list \ 157 | -second $second_list \ 158 | -ga $ga" 159 | 160 | # for debugging 161 | if [ "$debug" = true ] 162 | then 163 | cmd="$cmd -debug" 164 | echo $cmd 165 | fi 166 | 167 | # start the motion correction 168 | if [ "$do_reconstruction" = true ] 169 | then 170 | echo "Performing motion correction" 171 | echo 172 | $cmd 173 | fi 174 | -------------------------------------------------------------------------------- /show.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import irtk 4 | from glob import glob 5 | import os 6 | 7 | def show(all_files,prefix="",saturate=False): 8 | for f in all_files: 9 | name = os.path.basename(f)[:-len('.nii.gz')] 10 | img = irtk.imread(f,dtype="float32") 11 | if saturate: 12 | img = img.saturate().rescale() 13 | png_name = "img/"+prefix+name+".png" 14 | print png_name 15 | irtk.imshow(img,filename=png_name) 16 | 17 | show(glob("data/*.nii.gz"),saturate=True) 18 | show(glob("output_detection/*.nii.gz"),"detection_") 19 | show(glob("output_segmentation/*.nii.gz"),saturate=True) 20 | show(["output_reconstruction/motion_corrected_volume.nii.gz"],saturate=True) 21 | 22 | -------------------------------------------------------------------------------- /train.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | set -e 5 | 6 | SRC_DIR="/vol/biomedic/users/kpk09/gitlab/irtk/wrapping/cython/scripts/machine_learning/fetal-brain-detection" 7 | 8 | fold=$1 9 | 10 | mkdir -p model 11 | 12 | training_patients="10_folds/training_$fold.tsv" 13 | original_folder="/vol/biomedic/users/kpk09/DATASETS/Originals/" 14 | clean_brainboxes="metadata/list_boxes.tsv" 15 | NEW_SAMPLING=0.8 16 | vocabulary="model/vocabulary_$fold.npy" 17 | vocabulary_step=2 18 | mser_detector="model/mser_detector_${fold}_linearSVM" 19 | ga_file="metadata/ga.csv" 20 | 21 | python $SRC_DIR/create_bow.py \ 22 | --training_patients $training_patients \ 23 | --new_sampling $NEW_SAMPLING \ 24 | --original_folder $original_folder \ 25 | --step $vocabulary_step \ 26 | --output $vocabulary 27 | 28 | python $SRC_DIR/learn_mser.py \ 29 | --training_patients $training_patients \ 30 | --new_sampling $NEW_SAMPLING \ 31 | --original_folder $original_folder \ 32 | --clean_brainboxes $clean_brainboxes \ 33 | --ga_file $ga_file \ 34 | --vocabulary $vocabulary \ 35 | --output $mser_detector 36 | 37 | 38 | --------------------------------------------------------------------------------