t1 = neurobase::readnii("training01_01_t1.nii.gz")
t1 = neurobase::readnii("training01_01_t1.nii.gz")
Let’s do a marginal density of the values:
plot(density(t1)) # large spike at 0
You can also pass in a mask to most standard functions:
plot(density(t1, mask = t1 > 0))
Note the high intensities:
hist(t1)
The neurobase::ortho2
function displays nifti objects in 3 different planes.
neurobase::ortho2(t1)
We see a dark image; a this single large value affects how values are mapped. The function robust_window
calculates Winsorizes an image, by default the 0 (min) and 99.9th quantile, and sets values outside of this range to that quantile (97.5th below).
ortho2(robust_window(t1, probs = c(0, 0.975)))