Comments (14)
Okay, I don't know why this is happening on your systems but the CMake magic that is supposed to register the IO factories is just not working when compiling ANTsR but not with ANTsRCore. That's why createJacobianDeterminantImage
doesn't work but antsImageRead
does. I wish I figured out a fix it but the issue appears to be system-specific and I don't have more time to play around with this at the moment. In fact, if I had more time, I would avoid having it read the file and simply input the actual ANTs image. Perhaps you should add that as a wish-list item.
For now, a workaround is to manually add the required IO factories prior to calling R CMD INSTALL ANTsR
. For example, to register the NiftiIO, you would add the line
itk::NiftiImageIOFactory::RegisterOneFactory();
before line 40 of CreateJacobianDeterminantImage
. You would also need to include the corresponding header #include "itkNiftiImageIOFactory.h"
at the top. Fortunately, it looks like this is the only file affected.
from antsr.
I'm not able to reproduce. And that ITK error looks wrong as it's missing several file types. You mention that you ugraded ANTsRCore and ANTsR but I don't see where you completely re-installed ITKR. You might want to try that for a possible fix.
from antsr.
Sorry, yes ITKR also got reinstalled. And I would agree this is an ITK issue, except that antsImageRead seem to work fine with the same input.
As a temporary work around I brought back the older libraries, and everything is back to working.
I will try to rebuild the ITKR cleanly one more and see if it fixes.
from antsr.
antsImageRead seem to work fine with the same input.
"input", I assume, refers to the temporary warp file, mytx$fwdtransforms[[1]]
, correct?
from antsr.
it I used the hard coded path reported in the error, because I suspected the file got corrupted for some reason.
antsImageRead("/tmp/RtmpB9ydC3/file20a543a7faac81Warp.nii.gz")
from antsr.
Okay, just wanted to confirm as "input" was ambiguous and the antsImageRead call of the temp warp file is missing. I just tried it and wasn't able to reproduce the error:
> mytx$fwdtransforms[[1]]
[1] "/var/folders/5h/62f7bql14zvgx34nqwd7xvnc0000gn/T//RtmpaA01Qa/file2f11583079921Warp.nii.gz"
> antsImageRead( mytx$fwdtransforms[[1]] )
antsImage
Pixel Type : float
Components Per Pixel: 2
Dimensions : 128x128
Voxel Spacing : 2x2
Origin : 0 0
Direction : 1 0 0 1
Filename : /var/folders/5h/62f7bql14zvgx34nqwd7xvnc0000gn/T//RtmpaA01Qa/file2f11583079921Warp.nii.gz
from antsr.
This is what I am getting
> fi<-antsImageRead( getANTsRData("r16") ,2)
> mi<-antsImageRead( getANTsRData("r64") ,2)
> fi<-resampleImage(fi,c(128,128),1,0)
> mi<-resampleImage(mi,c(128,128),1,0)
> mytx<-antsRegistration(fixed=fi , moving=mi, typeofTransform = c("SyN") )
> jac<-createJacobianDeterminantImage(fi,mytx$fwdtransforms[[1]],1)
ITK ExceptionObject caught!
Error in createJacobianDeterminantImage(fi, mytx$fwdtransforms[[1]], 1) :
/usr/local/lib/R/site-library/ITKR/libs/include/ITK-5.3/itkImageFileReader.hxx:132:
Could not create IO object for reading file /tmp/RtmpUA2gDC/file211d1753c51c041Warp.nii.gz
Tried to create one of the following:
MGHImageIO
You probably failed to set a file suffix, or
set the suffix to an unsupported type.
> test = antsImageRead(mytx$fwdtransforms[[1]])
> print(test)
antsImage
Pixel Type : float
Components Per Pixel: 2
Dimensions : 128x128
Voxel Spacing : 2x2
Origin : 0 0
Direction : 1 0 0 1
Filename : /tmp/RtmpUA2gDC/file211d1753c51c041Warp.nii.gz
Will try to rebuild ITKR from scratch
from antsr.
Himm, this is what I did
root@magalab-ML:~# cd ITKR
root@magalab-ML:~/ITKR# ./cleanup
root@magalab-ML:~/ITKR# git pull origin
Already up to date.
root@magalab-ML:~/ITKR# cd ..
root@magalab-ML:~# R CMD INSTALL ITKR
successful build, but resulted in the same error. any other suggestions
from antsr.
Is the error reproducible on a different machine?
from antsr.
Yep, it does on a cloud Ubuntu machine I have. Same error. I can give you access, if it helps:
from antsr.
I am still getting the same error after building ITKR, ANTsCore, ANTsR via R CMD INSTALL with fresh clones from the primary repo on a new system. Any help will be greatly appreciated...
from antsr.
I don't know. I'd have to explore a bit. If you can provide access, I can try to take a look later this week.
from antsr.
just sent you an email with access information.
from antsr.
What a bizarre situation. Thank you very much for finding a workaround. Much appreciated
from antsr.
Related Issues (20)
- 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?
- 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
- How to pass command line arguments to antsRegistration? HOT 4
- Guidance on Extracting Numeric Values of Gaussian Curvature from Image Class HOT 1
- Resampling an image to source image geometry HOT 2
- Failing on antsRegistration HOT 1
- Python 2.7 Error HOT 1
- multiChannelPCA is failing in R 4.3.1 HOT 2
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.