Comments (4)
I've not used the list option but I believe you would need to replace file names with pointers to antsImage objects using antsrGetPointerName
, eg
img_pt <- antsrGetPointerName( antsImageClone( img ))
I include the clone here from the man example, the antsRegistration function also clones the input image.
from antsr.
You'll have to look through the antsRegistration
code in ANTsR and ANTsRCore probably more specifically, because I don't believe there is a way to add any additional parameters. Happy to accept a PR if you think something is missing... it should be easy to just add the function argument to antsRegistration
and then add that arg to the parameters that are built up.
from antsr.
@cookpa
Thanks for the pointer info. However, if I do antsImageClone, the pointer address changes every time. Is there reason antsr is not directly using the actual address of the image?
> fi <- antsImageRead(getANTsRData("r16") )
> mi <- antsImageRead(getANTsRData("r64") )
>
> antsrGetPointerName(fi)
[1] "0x561b9ba33b30"
> antsrGetPointerName(mi)
[1] "0x561b9bd504e0"
>
>
> mytx2 <- antsRegistration(fi, mi, typeofTransform = 'Affine', printArgs = T)
antsRegistration -d 2 -r [0x561b9c78e900,0x561b9c7cec50,1] -m mattes[0x561b9c78e900,0x561b9c7cec50,1,32,regular,0.2] -t Affine[0.25] -c 2100x1200x1200x10 -s 3x2x1x0 -f 6x4x2x1 -u 0 -z 1 -o [/tmp/Rtmp01coMb/file118bd916264147,0x561b9bd30860,0x561b98aece90] -x [NA,NA] --float 1 --random-seed 1 --write-composite-transform 0
> antsrGetPointerName(antsImageClone(fi))
[1] "0x561b9bc6f0c0"
> antsrGetPointerName(antsImageClone(fi))
[1] "0x561b9bed7170"
clearly antsRegistration is using the antsImageClone too, since every call has a different pointer address. So not sure how to do convert this a list call
> mytx2 <- antsRegistration(fi, mi, typeofTransform = 'Affine', printArgs = T)
antsRegistration -d 2 -r [0x561b9ba32fd0,0x561b9bac0570,1] -m mattes[0x561b9ba32fd0,0x561b9bac0570,1,32,regular,0.2] -t Affine[0.25] -c 2100x1200x1200x10 -s 3x2x1x0 -f 6x4x2x1 -u 0 -z 1 -o [/tmp/Rtmp01coMb/file118bd91a9f7941,0x561b9f72e800,0x561b9bc68ab0] -x [NA,NA] --float 1 --random-seed 1 --write-composite-transform 0
> mytx2 <- antsRegistration(fi, mi, typeofTransform = 'Affine', printArgs = T)
antsRegistration -d 2 -r [0x561b9bc68fc0,0x561b9cbdb9c0,1] -m mattes[0x561b9bc68fc0,0x561b9cbdb9c0,1,32,regular,0.2] -t Affine[0.25] -c 2100x1200x1200x10 -s 3x2x1x0 -f 6x4x2x1 -u 0 -z 1 -o [/tmp/Rtmp01coMb/file118bd96a38f2d9,0x561b9c6a47c0,0x561b9bd303f0] -x [NA,NA] --float 1 --random-seed 1 --write-composite-transform 0
from antsr.
Yes you'd get another pointer each time, they are pointers to copies of the image. Sorry, the example I gave was probably not very useful. To avoid garbage collection you'd need to keep a reference around, so something like
fi_for_reg = antsImageClone(fi)
mi_for_reg = antsImageClone(mi)
Then in your antsRegistration parameter list, you'd replace the file names with antsrGetPointerName(fi_for_reg) and antsrGetPointerName(mi_for_reg)
I don't actually know why antsRegistration clones the input images this way, but it does.
from antsr.
Related Issues (20)
- Installation fails on Ubuntu 22.04LTS with R4.2.0 HOT 3
- ERROR: Parsing error: The keyword 'const' is reserved
- Errors in buliding ANTsR vigniettes HOT 1
- AAL template extends beyond MNI cortical surface HOT 7
- installation problem antsLibs() Makevars:6: *** missing separator. Stop. HOT 5
- Error
- antsMotionCalculation Error HOT 1
- colorbar key for antsrSurf HOT 6
- Installation fail with devtools HOT 5
- details about mnib HOT 1
- Failing on ITK when running LINDA HOT 6
- Proper similarity metric for Affine registration HOT 3
- MVPA using ANTsR?
- ITK bug in createJacobianDeterminantImage after upgrade HOT 14
- aslPerfusion HOT 11
- Installation error on Mac OS 12.6.3 with devtools HOT 11
- R version issues HOT 3
- ITK_GLOBAL_NUMBER_OF_THREADS is ignored HOT 2
- Guidance on Extracting Numeric Values of Gaussian Curvature from Image Class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antsr.