Dear all, i am very new to R=)
Actually it is my first day here. I am trying to read the folder with several DICOM files and find a mean value in aech of the slice of the 3 D image
Here is what I wrote so far... But seems that I have only calculated mean value for the fist image in a stack... or not? I expected to get a vector not a value...
thank you in advance
library("oro.dicom")
current_folder <- "C:/NRA/DICOM_test"
DCM <- readDICOM(current_folder, verbose=TRUE)
# remove dicom header, leave just the image part
image<-DCM$img
# remove dicom header, leave just the image part
image<-DCM$img
#rewrite image (mode lyst as a matrix 512 by 512)
#matrix_512 <- matrix(unlist(image), byrow=TRUE, 512)
matrix_512 <- matrix(unlist(image), 512, 512)
# creat image
image(t(matrix_512), col=grey(0:64/64), axes=FALSE, xlab="", ylab="")
# 1step: find HU mean
for(i in 1:512)
{
for(j in 1:512)
{
# meam
M<- mean(matrix_512[,])
}
break
}
print(M)