What to do with NA/NaN/Inf values in RMINC results?

Asked by KateH

[A bit of an artificial question since Jason actually answered it, but I hope this will get the conversational ball rolling for other RMINC users]

Hi Jason,

Using your April 2008 tutorial, we've been able to do a lot with RMINC. Thanks!

We've been able to generate a simple model of seven subjects divided into 'user' and 'control' groups:

R> tmap <- mincLm(file ~ group, gf)

which gives us:

R> tmap
Multidimensional MINC volume
Columns: F-statistic (Intercept) groupuser
[1] "./4006/VBM/user_4006_smooth_8mm_gm.mnc"

When we try to save the 'groupuser' column to a minc file (following the example on page 12 of your April 2008 RMINC tutorial) we get the following error message:

R> mincWriteVolume(tmap, "simple_lm.mnc", "groupuser")
Writing column groupuser to file simple_lm.mnc
Sizes: 181 217 181
Error in mincWriteVolume.default(buffer[, column], output.filename, +like.filename) :
  NA/NaN/Inf in foreign function call (arg 5)

If we try this syntax (as suggested by the previous error message):

R> mincWriteVolume(tmap[, "groupuser"], "simple_lm.mnc", gf$file[1])

we get this error message:

Sizes: 181 217 181
Error in mincWriteVolume.default(tmap[, "groupuser"], "simple_lm.mnc", :
  NA/NaN/Inf in foreign function call (arg 5)

Yoiks! I'm not sure if this means the results are NaN/Inf-laden or if we're just not using the tools correctly. Your insights??

Ciao for now,
Kate.

Question information

Language:
English Edit question
Status:
Solved
For:
RMINC Edit question
Assignee:
No assignee Edit question
Solved by:
KateH
Solved:
Last query:
Last reply:
Revision history for this message
KateH (kate-hanratty) said :
#1

[Here is Jason's reply]

Try the following:

 > tmap[is.na(tmap}] <- 0
 > mincWriteVolume(tmap, "simple_lm.mnc", "groupuser")

(I.e. MINC does not like NA's, so if there were some generated by the LM call they have to be removed first).

Cheers,

Jason

Revision history for this message
KateH (kate-hanratty) said :
#2
Revision history for this message
KateH (kate-hanratty) said :
#3

Here is Jason's parenthetically consistent reply:

 > tmap[is.na(tmap)] <- 0
 > mincWriteVolume(tmap, "simple_lm.mnc", "groupuser")