Closed muschellij2 closed 4 years ago
documentation issue. see the error reported: "JPEG supports unsigned char/int only" which suggests that one must do:
antsImageWrite( antsImageClone( ri(1), out_pixeltype='unsigned char'), '/tmp/temp.jpg' )
noting that some value conversions to [0,255] would also be needed, in general.
Describe the bug Cannot write out JPG files due to linking with ITKR:
To Reproduce
Created on 2019-11-22 by the reprex package (v0.3.0.9000)
Session info
``` r sessioninfo::session_info() #> ─ Session info ────────────────────────────────────────────────────────── #> setting value #> version R version 3.6.0 (2019-04-26) #> os macOS Mojave 10.14.6 #> system x86_64, darwin15.6.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/New_York #> date 2019-11-22 #> #> ─ Packages ────────────────────────────────────────────────────────────── #> package * version date lib source #> ANTsRCore * 0.7.3 2019-11-05 [1] Github (ANTsX/ANTsRCore@f564041) #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) #> cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) #> digest 0.6.22 2019-10-21 [1] CRAN (R 3.6.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.0) #> ITKR 0.5.2 2019-11-05 [1] Github (stnava/ITKR@fe97efa) #> knitr 1.24.3 2019-08-28 [1] Github (muschellij2/knitr@abcea3d) #> lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.0) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) #> Matrix 1.2-17 2019-03-22 [1] CRAN (R 3.6.0) #> Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.0) #> RcppEigen 0.3.3.5.0 2018-11-24 [1] CRAN (R 3.6.0) #> rlang 0.4.1 2019-10-24 [1] CRAN (R 3.6.0) #> rmarkdown 1.16 2019-10-01 [1] CRAN (R 3.6.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) #> stringi 1.4.3 2019-03-12 [1] CRAN (R 3.6.0) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) #> xfun 0.11 2019-11-12 [1] CRAN (R 3.6.0) #> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.0) #> #> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library ```Expected behavior ANTsR I/O supports JPEG