Comments (6)
One easy solution off the top of my head:
colorbarImage <- as.antsImage( rbind( 1:100, 1:100, 1:100, 1:100, 1:100, 1:100, 1:100, 1:100, 1:100, 1:100 ) )
from antsr.
yes -- the "plot a color bar" then add numbers on your own approach is good. antsSurf
just uses standard color maps. you can google color bars for the standard maps and then amend those. @ntustison - do you agree?
from antsr.
Yeah, agreed. Whenever I need to make custom color bars, I create my own using convertScalarImageToRGB
but, correct me if I'm wrong, I don't think that functionality is available in the ANTsR package.
from antsr.
pretty sure convertScalarImageToRGB
is wrapped in some way within R
... I know it's called directly ... anyway this entire pipeline of functionality is very powerful but could be greatly improved -- probably a useful thing to target for our recent funding.
from antsr.
I see from calling convertScalarImageToRGB that it requires an input image. What's an easy way to create a 2D image that has, say, 10 pixels in the x dimension and 100 in the y dimension, with the y values going from 1 to 100? If I understand correctly, convertScalarImageToRGB would translate that into an appropriate colorbar matching the colormap I use?
from antsr.
Thank you for the hint! For future reference to anyone else needing the same thing, here is what I got to work:
- created two files in ANTsR, one the image to be colored, the other a mask, and wrote them to disk:
> colorbarImage <- as.antsImage( rbind( 100:1, 100:1, 100:1, 100:1, 100:1, 100:1, 100:1, 100:1, 100:1, 100:1 ) )
> antsImageWrite(colorbarImage,"colorbarImage.nii")
> colorbarImageMask <- makeImage( c(10,100),1)
> antsImageWrite(colorbarImageMask,"colorbarImageMask.nii")
NOTE: The ordering of numbers "100:1" in the rbind command above puts the highest values at the top of the image, and lowest values at the bottom, which is typically what you want for colorbar legends
- on the command line (outside of R), using ANTS' convertScalarImageToRGB:
ConvertScalarImageToRGB 2 colorbarImage.nii colorbarImageJet.jpg colorbarImageMask.nii jet
This creates a jpg of a bar with the range of colors matching, in this case, the "jet" colormap. Reading this into whatever you use to create figures (e.g., powerpoint) allows you to add text indicating values for different parts of the range.
from antsr.
Related Issues (20)
- installation problem antsLibs() Makevars:6: *** missing separator. Stop. HOT 5
- Error
- antsMotionCalculation Error HOT 1
- 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
- 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.