Closed ntustison closed 6 years ago
I think this would be useful. Perhaps it would be good to add to antsAI
?
Thanks @cookpa . That would be fine with me. It doesn't look like antsAI
is in ANTsR
just yet although the old antsAffineInitializer
is there. @stnava---would you prefer this route?
By the way, @cookpa , you should check out the BrainExtraction example we have over at ANTsRNetExamples
if you're interested. I've been training the model on the ~1100 subjects we used for our cross-sectional cortical thickness paper and you can do brain extraction in < 10 seconds on a laptop where the majority of time is spent in antsRegistration( ..., transform type = "QuickRigid" ... )
.
Very cool, I will look at it.
Regardless, @cookpa , I'll go ahead and add that to antsAI
. I think that is a really good idea.
another alternative:
fi<-antsImageRead( getANTsRData("r16"))
com1<-getCenterOfMass( fi ) # intensity
com2<-getCenterOfMass( fi * 0 + 1 ) # geometric
and then build/apply antsrTransforms
fi<-antsImageRead( getANTsRData("r16"))
mi<-antsImageRead( getANTsRData("r64"))
comf<-getCenterOfMass( fi ) # intensity
comm<-getCenterOfMass( mi ) # intensity
tx = createAntsrTransform( type="Rigid2DTransform", center=comf,translation=comm-comf )
wimg = applyAntsrTransformToImage(tx, mi, fi )
plot( fi, mi, alpha=0.5 )
plot( fi, wimg, alpha=0.5 )
could be worth wrapping cleanly in a function.
Ah, brilliant. Thanks.
I'd like to be able to align the image geometric centers or centers of mass only which would be useful for the deep learning stuff we're doing over at ANTsRNetExamples. It seems that the easiest route would be to add those two options to
antsRegistration
. Equivalent would be something likeWould this be okay? If so, I can make a pull request. Or, if not, would there be a better route for doing this?
Thanks, Nick