-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MRIcron as viewer #25
Comments
I think you would want to use the standard plot or orthographic views for this and not an external viewer. This is especially important because you can create reproducible PNGs and PDFs using standard devices and plot(). |
We already have plot.antsImage, which does basic visualization. The 2015-03-27 1:24 GMT-04:00 John Muschelli [email protected]:
|
Personally, I have changed my mind on the viewer to integrate for quick visualization. I would go with ITKsnap instead of MRIcron. It has better management of layers, colormaps, changes in transparency, etc. If I would be wanting to see an image with an external viewer, it would probably be to use overlays more than just viewing a single image. MRIcron doesn't even allow to unload a single overlay, or to change the order of overlays, or to set specific transparency+colormap options for each overlay. I think the type of user that will be using ANTsR will appreciate more ITKsnap. |
I talked about this with Brian, and we decided against adding it to ANTsR. The main issue is that it introduces an external dependency that will add significant complexity: Maintenance of interface, ability to control the spawned process from R, etc., so it would go too far afield from the core purpose of ANTsR, which is to provide reproducible R-based processing of images. If you wanted to do this on your own machine, a sample script would look something like: itksnap <- function(image, overlay=NA) {
tempname1 <- paste(tempfile(), '.nii.gz', sep='')
antsImageWrite(image, tempname1)
command <- paste('itksnap -g', tempname1)
if (!is.na(overlay)) {
tempname2 <- paste(tempfile(), '.nii.gz', sep='')
antsImageWrite(overlay, tempname2)
command <- paste(command, '-o', tempname2)
}
system(command)
} You could expand this by adding support for multiple overlays, segmentations, etc. |
thanks @bkandel brian On Wed, Jun 10, 2015 at 3:59 PM, bkandel [email protected] wrote:
|
As we talked, Shiny can now be used for a similar purpose. Simple interaction with three views. |
Yes! That would be better. If you are able to put up a general-purpose 2015-06-10 16:28 GMT-04:00 dorianps [email protected]:
|
agreed - would be nice to have that documented somewhere ... i recall brian On Wed, Jun 10, 2015 at 4:30 PM, bkandel [email protected] wrote:
|
Just FYI - We have tried this to some degree. You can try papayar (https://github.com/muschellij2/papayar), which is based on Papaya/Mango (https://github.com/rii-mango/Papaya/). devtools::install_github("muschellij2/papayar")
library(papayar)
URL <- "http://nifti.nimh.nih.gov/nifti-1/data/zstat1.nii.gz"
urlfile <- file.path(tempdir(), "zstat1.nii.gz")
download.file(URL, dest=urlfile, quiet=TRUE)
papaya(urlfile) Then if you change the windowing to [0, 10] and see the image. You can also use devtools::install_github("muschellij2/itksnapr")
library(itksnapr)
URL <- "http://nifti.nimh.nih.gov/nifti-1/data/zstat1.nii.gz"
urlfile <- file.path(tempdir(), "zstat1.nii.gz")
download.file(URL, dest=urlfile, quiet=TRUE)
itksnap(urlfile) |
Papaya did not work for me in the cluter, requires safari which is not there. ITKsnap solution looks great and worked right away. It just needs a tiny change to accept antsImage class. If input is antsImage, save it to temp folder, then call itksnap. I would also suggest to keep -g background and -o overlays as separate arguments instead of expecting them together in a list. Thank you. |
Have a viewer (decided for MRIcron) that can be launched from R to view an antsImage.
The text was updated successfully, but these errors were encountered: