Cortical Thickness Estimation

All code for this document is located at here.

base_fname = "113-01-T1"
orig = file.path("..", 
                 "brain_extraction",
                 paste0(base_fname, "_SS.nii.gz")
)
stub = file.path("..", "tissue_class_segmentation", 
                base_fname)
seg = paste0(stub, "_Seg.nii.gz")
wm_prob = paste0(stub, "_prob_2.nii.gz")
gm_prob = paste0(stub, "_prob_3.nii.gz")
s = antsImageRead(seg)
g = antsImageRead(gm_prob)
w = antsImageRead(wm_prob)
out = kellyKapowski(s = s, g = g, w = w, its = 50, r = 0.025, m = 1.5)
cort = extrantsr::ants2oro(out)
ortho2(cort)

hist(c(cort[cort > 0]), breaks = 2000)

ortho2(cort, cort > 0.1)

ortho2(img, cort)

Session Info

devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.2 (2020-06-22)
 os       macOS Catalina 10.15.7      
 system   x86_64, darwin17.0          
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2021-02-16                  

─ Packages ───────────────────────────────────────────────────────────────────
 ! package      * version   date       lib
   abind          1.4-5     2016-07-21 [2]
   animation    * 2.6       2018-12-11 [2]
   ANTsR        * 0.5.6.1   2020-06-01 [2]
 R ANTsRCore    * 0.7.4.6   <NA>       [2]
   assertthat     0.2.1     2019-03-21 [2]
   bitops         1.0-6     2013-08-17 [2]
   cachem         1.0.4     2021-02-13 [1]
   callr          3.5.1     2020-10-13 [1]
   cli            2.3.0     2021-01-31 [1]
   codetools      0.2-18    2020-11-04 [1]
   colorout     * 1.2-2     2020-06-01 [2]
   colorspace     2.0-0     2020-11-11 [1]
   crayon         1.4.1     2021-02-08 [1]
   DBI            1.1.1     2021-01-15 [1]
   desc           1.2.0     2020-06-01 [2]
   devtools     * 2.3.2     2020-09-18 [1]
   digest         0.6.27    2020-10-24 [1]
   dplyr        * 1.0.4     2021-02-02 [1]
   ellipsis       0.3.1     2020-05-15 [2]
   evaluate       0.14      2019-05-28 [2]
   extrantsr    * 3.9.13.1  2020-09-03 [2]
   fastmap        1.1.0     2021-01-25 [1]
   fs             1.5.0     2020-07-31 [2]
   fslr         * 2.25.0    2021-02-16 [1]
   generics       0.1.0     2020-10-31 [1]
   ggplot2      * 3.3.3     2020-12-30 [1]
   git2r          0.28.0    2021-01-11 [1]
   glue           1.4.2     2020-08-27 [1]
   gtable         0.3.0     2019-03-25 [2]
   highr          0.8       2019-03-20 [2]
   htmltools      0.5.1.1   2021-01-22 [1]
   ITKR           0.5.3.3.0 2021-02-15 [1]
   kirby21.base * 1.7.4     2020-10-01 [1]
   kirby21.fmri * 1.7.0     2018-08-13 [2]
   kirby21.t1   * 1.7.3.2   2021-01-09 [1]
   knitr          1.31      2021-01-27 [1]
   lattice        0.20-41   2020-04-02 [2]
   lifecycle      1.0.0     2021-02-15 [1]
   magrittr       2.0.1     2020-11-17 [1]
   matlabr        1.6.0     2020-07-01 [2]
   Matrix         1.3-2     2021-01-06 [1]
   matrixStats  * 0.58.0    2021-01-29 [1]
   memoise        2.0.0     2021-01-26 [1]
   mgcv           1.8-33    2020-08-27 [1]
   munsell        0.5.0     2018-06-12 [2]
   neurobase    * 1.31.0    2020-10-07 [1]
   nlme           3.1-152   2021-02-04 [1]
   oro.nifti    * 0.11.0    2020-09-04 [2]
   pillar         1.4.7     2020-11-20 [1]
   pkgbuild       1.2.0     2020-12-15 [1]
   pkgconfig      2.0.3     2019-09-22 [2]
   pkgload        1.1.0     2020-05-29 [2]
   plyr           1.8.6     2020-03-03 [2]
   prettyunits    1.1.1     2020-01-24 [2]
   processx       3.4.5     2020-11-30 [1]
   ps             1.5.0     2020-12-05 [1]
   purrr          0.3.4     2020-04-17 [2]
   R.matlab       3.6.2     2018-09-27 [2]
   R.methodsS3  * 1.8.1     2020-08-26 [1]
   R.oo         * 1.24.0    2020-08-26 [1]
   R.utils      * 2.10.1    2020-08-26 [1]
   R6             2.5.0     2020-10-28 [1]
   RColorBrewer * 1.1-2     2014-12-07 [2]
   Rcpp           1.0.6     2021-01-15 [1]
   RcppEigen      0.3.3.9.1 2020-12-17 [1]
   remotes        2.2.0     2020-07-21 [2]
   reshape2     * 1.4.4     2020-04-09 [2]
   rlang          0.4.10    2020-12-30 [1]
   rmarkdown    * 2.6       2020-12-14 [1]
   RNifti       * 1.3.0     2020-12-04 [1]
   rprojroot      2.0.2     2020-11-15 [1]
   rstudioapi     0.13      2020-11-12 [1]
   scales         1.1.1     2020-05-11 [2]
   sessioninfo    1.1.1     2018-11-05 [2]
   spm12r       * 2.8.2     2021-01-11 [1]
   stapler        0.7.2     2020-07-09 [2]
   stringi        1.5.3     2020-09-09 [1]
   stringr      * 1.4.0     2019-02-10 [2]
   testthat       3.0.2     2021-02-14 [1]
   tibble         3.0.6     2021-01-29 [1]
   tidyselect     1.1.0     2020-05-11 [2]
   usethis      * 2.0.1     2021-02-10 [1]
   vctrs          0.3.6     2020-12-17 [1]
   WhiteStripe    2.3.2     2019-10-01 [2]
   withr          2.4.1     2021-01-26 [1]
   xfun           0.21      2021-02-10 [1]
   yaml         * 2.2.1     2020-02-01 [2]
   zoo          * 1.8-8     2020-05-02 [2]
 source                                
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 Github (ANTsX/ANTsR@9c7c9b7)          
 <NA>                                  
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 Github (jalvesaq/colorout@726d681)    
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 Github (muschellij2/desc@b0c374f)     
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 Github (muschellij2/extrantsr@00c75ad)
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 local                                 
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 Github (ropensci/git2r@4e342ca)       
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 Github (stnava/ITKR@ea0ac19)          
 local                                 
 CRAN (R 4.0.0)                        
 local                                 
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 local                                 
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 local                                 
 CRAN (R 4.0.2)                        
 local                                 
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        
 local                                 
 Github (muschellij2/stapler@79e23d2)  
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.2)                        
 CRAN (R 4.0.0)                        
 CRAN (R 4.0.0)                        

[1] /Users/johnmuschelli/Library/R/4.0/library
[2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

 R ── Package was removed from disk.

References