hi simon

thank you for your questions ---- answers here:

I won't answer your question directly but some suggestions:
> a) does adding PACKAGE="ANTsR" to .Call change anything? (It should really
> be there if you are using strings as names)
>

this does change things .... for instance, this works:

library(ANTsR)
filename<-getANTsRData('r16')
.Call("antsImageRead", filename,'double',2) #  Succeeds!
.Call("antsImageRead", filename,'double',2,PACKAGE=ANTsR) #  Fails!
# Error in .Call("antsImageRead", filename, "double", 2, PACKAGE = "ANTsR")
:
#  "antsImageRead" not available for .Call() for package "ANTsR"

the problem is when we call this function:

antsImageRead <- function( filename , dimension , pixeltype = "float" )
{
    rval <- (.Call("antsImageRead", filename, pixeltype, dimension))
    return(rval)
}

the we get the error   antsImageRead not resolved from current namespace ,
e.g.:

> antsImageRead(filename,2)
Error in .Call("antsImageRead", filename, pixeltype, dimension) :
  "antsImageRead" not resolved from current namespace (ANTsR)
>


b) you may want to consider use the more efficient registration - either
> explicit or in NAMESPACE - so in your case you could use
> NAMESPACE: useDynLib(ANTsR, antsImageRead, ...)
> foo.R: .Call(antsImageRead, ...)
>

yes - we have all of our shared libraries registered in the NAMESPACE file
e.g.

useDynLib(libRantsImageRead)

etcetera ....

	[[alternative HTML version deleted]]

