file = system.file("extdata", "example.nii.gz", package = "RNifti")
img = RNifti::readNifti(file)
intent_p1(img)
intent_p1(img) = 2
stopifnot(intent_p1(img) == 2)
intent_p2(img)
intent_p2(img) = 2
stopifnot(intent_p2(img) == 2)
intent_p3(img)
intent_p3(img) = 2
stopifnot(intent_p3(img) == 2)
Run the code above in your browser using DataLab