We see here in the Rshiny app that what we want is the data that gets written to cor-vbm-utm.Rdata.
Assuming RNifiti is installed (see #111), here is a code snippet that worked for me when testing out writing an image as nifti:
library(RNifti)
load('cor-vbm-utm.Rdata') # From within UTM analysis results directory, where `'cor-vbm-utm.Rdata'` was saved.
img = cor.res[[1]]$im$allocation # an example img to work with
writeNifti(img, 'example_nifti.nii.gz') # IDK if it compresses it when we use gz in extn, but this did work for me
We want to write out cor.res[[j]]$name (string), cor.res[[j]]$im$allocation (nifti), cor.res[[j]]$pim$allocation (nifti), cor.res[[j]]$im$transport (nifti), cor.res[[j]]$pim$transport (nifti), cor.res[[j]]$im$vbm (nifti), cor.res[[j]]$pim$vbm (nifti).
We probably want to do that just before or after this line.
This issue will be closed by a PR on https://github.com/kitwaremedical/utm
We see here in the Rshiny app that what we want is the data that gets written to
cor-vbm-utm.Rdata
.Assuming RNifiti is installed (see #111), here is a code snippet that worked for me when testing out writing an image as nifti:
We want to write out
cor.res[[j]]$name
(string),cor.res[[j]]$im$allocation
(nifti),cor.res[[j]]$pim$allocation
(nifti),cor.res[[j]]$im$transport
(nifti),cor.res[[j]]$pim$transport
(nifti),cor.res[[j]]$im$vbm
(nifti),cor.res[[j]]$pim$vbm
(nifti).We probably want to do that just before or after this line.
See RNifti documentation here.