Analysis on R

#1
Hi there,
I began using R last week and... It drives me crazy!
However, I'm using the package "AnalyzefMRI" and that's right, but I have some problems related to atomic vector.
Here's my code:

>library(AnalyzeFMRI)
> fM0223_004 <- "C:/Users/IVACCHIERI/Downloads/fM00223.fM0223_004.img"

> img <- f.read.analyze.volume(fM0223_004)
Error in hdr$dim : $ operator is invalid for atomic vectors

It's ok, until the last command.
Any help? What's the problem on the header file?:confused:
I understood the story about atomic, recursive, matrix and vectors, but I can't see how it's linked to my case... Thanks!:wave:
 

sirps

New Member
#2
Hi,

Did you find a solution? I'm having the same problem and receiving the same error message. I too have read the story about atomic, recursive, matrix, and vectors and cannot see how it relates to the problem. Thanks!
 

sirps

New Member
#3
Hi!

Just to let you know, my problem was in the earlier code.

for (t in 1: length(files)) {file = files[t]; img = f.read.analyze.volume(file)[, , slice, 1]; data[, , t] <- img}

My variable slice was out of bounds and for some reason this gave me the error:
Error in hdr$dim : $ operator is invalid for atomic vectors

When I reduced the value of slice, the commands ran smoothly.
 
#4
Hi everybody!
Yes, I solved the problem. In my case it was a problem of format: my images were DICOM, but f.read.analyze.volume can read only Analyze format :yup: