Closed ntustison closed 4 years ago
@stnava , @muschellij2 --- it looks like the failures stem from this ANTs pull request due to a switch in ITK from using Type
to Enum
. I'm assuming this will have to be updated in ITKR. Do you want me to do that?
I would appreciate it as I would not know how to best address this. I don't know if @stnava has any concerns of breaks? Best, John
On Fri, Feb 21, 2020 at 10:21 AM Nick Tustison notifications@github.com wrote:
@stnava https://github.com/stnava , @muschellij2 https://github.com/muschellij2 --- it looks like the failures stem from this ANTs pull request https://github.com/ANTsX/ANTs/commit/76b0cc051bc0edefc9c638969264d23f36bdce6c due to a switch in ITK from using Type to Enum. I'm assuming this will have to be updated in ITKR. Do you want me to do that?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/pull/112?email_source=notifications&email_token=AAIGPLQQROUULMCJRSWBZVLRD7WOBA5CNFSM4KY3KLVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMTBMMY#issuecomment-589698611, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLSFR4R4BF3EXZW2RHTRD7WOBANCNFSM4KY3KLVA .
Thanks @muschellij2 . I don't have much familiarity with pull requests for ITKR so I'll wait until @stnava weighs in.
Got it - I misunderstood. Do you want me to change the ITK tag in ITKR to bcd762e7bd743341c2dce84852ced49d8292f293 ? Best, John
On Fri, Feb 21, 2020 at 10:47 AM Nick Tustison notifications@github.com wrote:
Thanks @muschellij2 https://github.com/muschellij2 . I don't have much familiarity with pull requests for ITKR so I'll wait until @stnava https://github.com/stnava weighs in.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/pull/112?email_source=notifications&email_token=AAIGPLXA3RV352RPP7OQZATRD7ZPRA5CNFSM4KY3KLVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMTEHNY#issuecomment-589710263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLWYCIEXCZVH4KUMBSTRD7ZPRANCNFSM4KY3KLVA .
Also you need to re-document as the NAMESPACE was deleted.
@muschellij2 Sorry about that---yeah, if you could clean up the mess I created, that would be great.
Hey @muschellij2 and @stnava --- getting back to the N4 segfault issue. @stnava merged the updated ITKR with the new ITK git tag. You can see that the travis builds are still failing due to the same issue. Is there someplace in ANTsRCore where I need to update the ITKR git tag?
I don't think it is needed, we can close Best, John
On Wed, Mar 18, 2020 at 2:26 PM Nick Tustison notifications@github.com wrote:
@ntustison commented on this pull request.
In NAMESPACE https://github.com/ANTsX/ANTsRCore/pull/112#discussion_r394554900:
@@ -1,224 +1,5 @@
Generated by roxygen2: do not edit by hand
-S3method(apply,antsImage)
Sure. I have no idea why these lines were deleted or even if this pull is still needed.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/pull/112#discussion_r394554900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLW6GFPM5XKAEZM253DRIEG5ZANCNFSM4KY3KLVA .
This still segfaults for me after fresh install yesterday. I can't do a reprex
because it segfaults:
sessioninfo::session_info("ANTsRCore")
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.6.2 (2019-12-12)
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 2020-03-19
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
ANTsRCore 0.7.3.1 2020-03-19 [1] Github (ANTsX/ANTsRCore@5749f7c)
ITKR 0.5.3 2020-03-18 [1] Github (stnava/ITKR@715331d)
lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.2)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.2)
Rcpp 1.0.4.2 2020-03-19 [1] Github (RcppCore/Rcpp@20e462f)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
Is this still the example that faults?
fname = getANTsRData("r16")
in_img = antsImageRead(fname)
full_image = in_img > -1
n4 = n4BiasFieldCorrection(in_img, mask = full_image)
If it does, I just updated and ran it on two of my macs and our dgx. I can't reproduce.
On the DGX:
> fname = getANTsRData("r16")
> in_img = antsImageRead(fname)
> full_image = in_img > -1
> n4 = n4BiasFieldCorrection(in_img, mask = full_image)
> sessioninfo::session_info( "ANTsRCore" )
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.6.1 (2019-07-05)
os Ubuntu 18.04.2 LTS
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/New_York
date 2020-03-19
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
ANTsRCore * 0.7.3.1 2020-03-19 [1] Github (ANTsX/ANTsRCore@5749f7c)
ITKR 0.5.3 2020-03-19 [1] Github (stnava/ITKR@715331d)
lattice 0.20-38 2018-11-04 [4] CRAN (R 3.6.1)
magrittr 1.5 2014-11-22 [2] CRAN (R 3.6.1)
Matrix 1.2-17 2019-03-22 [4] CRAN (R 3.6.1)
Rcpp 1.0.4 2020-03-17 [1] CRAN (R 3.6.1)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.1)
[1] /home/ntustison/R/x86_64-pc-linux-gnu-library/3.6
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library
On my newish iMac:
> fname = getANTsRData("r16")
> in_img = antsImageRead(fname)
> full_image = in_img > -1
> n4 = n4BiasFieldCorrection(in_img, mask = full_image)
> sessioninfo::session_info( "ANTsRCore" )
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.6.2 (2019-12-12)
os macOS Catalina 10.15.3
system x86_64, darwin15.6.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Los_Angeles
date 2020-03-19
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
ANTsRCore * 0.7.3.1 2020-03-19 [1] Github (ANTsX/ANTsRCore@5749f7c)
ITKR 0.5.3 2020-03-19 [1] Github (stnava/ITKR@715331d)
lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.2)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.2)
Rcpp 1.0.4.3 2020-03-19 [1] Github (RcppCore/Rcpp@5ea44f1)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
Perhaps @stnava can see if it fails for him
Since you're running Mojave, I'll also include my older iMac (running High Sierra):
> fname = getANTsRData("r16")
> in_img = antsImageRead(fname)
> full_image = in_img > -1
> n4 = n4BiasFieldCorrection(in_img, mask = full_image)
> sessioninfo::session_info( "ANTsRCore" )
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.6.3 (2020-02-29)
os macOS High Sierra 10.13.6
system x86_64, darwin15.6.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Los_Angeles
date 2020-03-19
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
ANTsRCore * 0.7.3.1 2020-03-19 [1] Github (ANTsX/ANTsRCore@5749f7c)
ITKR 0.5.3 2020-03-19 [1] Github (stnava/ITKR@715331d)
lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.3)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.3)
Rcpp 1.0.4.3 2020-03-19 [1] Github (RcppCore/Rcpp@5ea44f1)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
That works fine for me.
This one fails (only difference is the mask > 0 vs. > -1): fname = getANTsRData("r16") in_img = antsImageRead(fname) mask = in_img > 0 n4 = n4BiasFieldCorrection(in_img, mask = mask)
Best, John
On Thu, Mar 19, 2020 at 7:36 PM Nick Tustison notifications@github.com wrote:
Since you're running Mojave, I'll also include my older iMac (running High Sierra):
fname = getANTsRData("r16")
in_img = antsImageRead(fname)
full_image = in_img > -1
n4 = n4BiasFieldCorrection(in_img, mask = full_image)
sessioninfo::session_info( "ANTsRCore" )
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.6.3 (2020-02-29)
os macOS High Sierra 10.13.6
system x86_64, darwin15.6.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Los_Angeles
date 2020-03-19
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
ANTsRCore * 0.7.3.1 2020-03-19 [1] Github (ANTsX/ANTsRCore@5749f7c)
ITKR 0.5.3 2020-03-19 [1] Github (stnava/ITKR@715331d)
lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.3)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.3)
Rcpp 1.0.4.3 2020-03-19 [1] Github (RcppCore/Rcpp@5ea44f1)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/pull/112#issuecomment-601464560, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLQFS22N2PGF4LVHD6TRIKUAZANCNFSM4KY3KLVA .
Thanks @muschellij2 . Unfortunately, all three of my machines also work with in_img > 0
.
Still failing on mine, just reinstalled ANTsRCore. I don't really know what to do here, but it's making the n4 bias field correction unusable.
library(ANTsRCore) fname = getANTsRData("r16")
in_img = antsImageRead(fname)
full_image = in_img > -1
n4 = n4BiasFieldCorrection(in_img, mask = full_image)
Attaching package: ‘ANTsRCore’
The following objects are masked from ‘package:stats’:
sd, var
The following objects are masked from ‘package:base’:
all, any, apply, max, min, prod, range, sum
fname = getANTsRData("r16")
in_img = antsImageRead(fname)
full_image = in_img > -1
THIS WORKS FINE
n4 = n4BiasFieldCorrection(in_img, mask = full_image)
SEGFAULTS
n4 = n4BiasFieldCorrection(in_img, mask = in_img > 0)
caught segfault
caught segfault address 0x10d006000, cause 'memory not mapped'
caught segfault address 0x10d012000, cause 'memory not mapped' address 0x10d00a000, cause 'memory not mapped'
Traceback:
Traceback: 1: 1: .helpn4BiasFieldCorrection(args).helpn4BiasFieldCorrection(args)
caught segfault 2: 2: address 0x10d00e000, cause 'memory not mapped' Traceback: n4BiasFieldCorrection(in_img, mask = in_img > 0) n4BiasFieldCorrection(in_img, mask = in_img > 0) 1: .helpn4BiasFieldCorrection(args)
Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace
I am on 3.6.2, so maybe that could be a reason? I highly doubt it:
sessioninfo::session_info("ANTsRCore") ─ Session info ─────────────────────────────────────────────────────────────── setting value version R version 3.6.2 (2019-12-12) 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 2020-03-20
─ Packages ─────────────────────────────────────────────────────────────────── package * version date lib source ANTsRCore 0.7.3.1 2020-03-20 [1] Github (muschellij2/ANTsRCore@b6218e1) ITKR 0.5.3 2020-03-18 [1] Github (stnava/ITKR@715331d) lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.2) magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.2) Rcpp 1.0.4.3 2020-03-20 [1] Github (RCppCore/Rcpp@5ea44f1) RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
On Thu, Mar 19, 2020 at 9:54 PM Nick Tustison notifications@github.com wrote:
Thanks @muschellij2 https://github.com/muschellij2 . Unfortunately, all three of my machines also work with in_img > 0.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/pull/112#issuecomment-601493832, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLSDUWY3T6LEETTFZB3RILEGBANCNFSM4KY3KLVA .
Can you set verbose = TRUE
and copy-and-paste the output?
It segfaults immediately:
> n4 = n4BiasFieldCorrection(in_img, mask = mask, verbose = TRUE)
Running N4 for 2-dimensional images.
*** caught segfault ***
address 0x10cc89000, cause 'memory not mapped'
Traceback:
1: .helpn4BiasFieldCorrection(args)
2: n4BiasFieldCorrection(in_img, mask = mask, verbose = TRUE)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
*** caught segfault ***
*** caught segfault ***
address 0x10cc91000, cause 'memory not mapped'
address 0x10cc95000, cause 'memory not mapped'
So it seems like it's some weird ordering effect:
Can you try this full example:
library(ANTsRCore)
dims = c(50, 50)
img<-makeImage(imagesize = dims, rnorm(prod(dims)) )
n4img<-n4BiasFieldCorrection(img)
n4img<-n4BiasFieldCorrection(img, mask = img > 0)
testthat::expect_error(n4BiasFieldCorrection(img, weight_mask = "somepath"))
testthat::expect_error(n4BiasFieldCorrection(img, splineParam = rep(200, 3)))
n4img<-n4BiasFieldCorrection(img, splineParam = c(200, 20))
rm(img); gc()
rm(n4img); gc()
fname = getANTsRData("r16")
in_img = antsImageRead(fname)
n4 = n4BiasFieldCorrection(in_img)
rm(n4); gc()
mask = in_img > 0
mask2 = antsImageClone(mask, out_pixeltype = "float")
# fails
mask
sum(mask)
n4 = n4BiasFieldCorrection(in_img, mask = mask, verbose = TRUE)
# fails
n4 = n4BiasFieldCorrection(in_img, mask = mask2)
I deleted the stuff before getANTsRData and it works fine!!
library(ANTsRCore)
#>
#> Attaching package: 'ANTsRCore'
#> The following objects are masked from 'package:stats':
#>
#> sd, var
#> The following objects are masked from 'package:base':
#>
#> all, any, apply, max, min, prod, range, sum
fname = getANTsRData("r16")
in_img = antsImageRead(fname)
n4 = n4BiasFieldCorrection(in_img)
rm(n4); gc()
#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
#> Ncells 1849107 98.8 3536408 188.9 NA 2688371 143.6
#> Vcells 3302746 25.2 8388608 64.0 16384 5650762 43.2
mask = in_img > 0
mask2 = antsImageClone(mask, out_pixeltype = "float")
mask
#> antsImage
#> Pixel Type : unsigned char
#> Components Per Pixel: 1
#> Dimensions : 256x256
#> Voxel Spacing : 1x1
#> Origin : 0 0
#> Direction : 1 0 0 1
sum(mask)
#> [1] 19278
n4 = n4BiasFieldCorrection(in_img, mask = mask, verbose = TRUE)
n4 = n4BiasFieldCorrection(in_img, mask = mask2)
Created on 2020-03-20 by the reprex package (v0.3.0.9001)
So none of the normal screen dump gets printed to the screen?
It's hard to demonstrate, but I made a quick video: https://youtu.be/dVcidFCeTZ0
Awesome. Thanks for the video. I'm pretty sure I found it although it's not obvious. Let me push to the ANTs repository, I'll point out the issue, you can update the ANTs git tag, and see if it works for you.
Installing now - will let you know if same behavior develops.
I think this should do it.