3dLME -dataTable file error

Dear AFNI gurus,

I’m having a trouble loading a .txt file for the -dataTable argument of 3dLME.

Using R, I’ve created a .txt file to load via the -dataTable argument of 3dLME. The two attachments included here are the script and the .txt file, so that you can see what they look like. I’ve checked both with afni file_tool, which finds no problems with either. When I run the script, it terminates with an error saying that the data sets can’t be loaded.

However, when I paste the exact same dataTable from the .txt file into the script itself, it runs fine, loading all the files named in dataTable and completing the analysis.

So, the text in the file is fine, given that it’s ready properly when embedded in the 3dLME script. Additionaly, the files are all there and load successfully, given that the script runs and completes successfully. There appears to be some kind of problem associated with trying to access the files when they’re read in via the file instead of when they’re read in directly from the script.

Here’s the error message that occurs, in case it’s helpful…

***** End of data structure information *****

Reading input files now…

** ERROR: Dset s001_training_condition_betas+tlrc’[healthy#0]’ could not be loaded
** ERROR: Dset s001_training_condition_betas+tlrc’[healthy#0]’ could not be loaded
** ERROR: Dset s001_training_condition_betas+tlrc’[tasty#0]’ could not be loaded
** ERROR: Dset s004_training_condition_betas+tlrc’[healthy#0]’ could not be loaded

One perhaps strange thing to note above is that there are 2 error messages for Dset s001_training_condition_betas+tlrc’[healthy#0]'. For every other dataset, there is only 1 error message. It’s also the case that this dataset is only listed once in the dataTable (see the next attachment). So, perhaps this offers a clue as to the problem?

Finally, the following error message appears after the final error message about failing to load the files. However, I don’t think that that the claim of this message is correct (different dimensions), given that all the same files load fine when called directly from the script:

** Error:
At least one of the input files has different dimensions!
Run “3dinfo -header_line -prefix -same_grid -n4 *.HEAD” in the directory where
the files are stored, and pinpoint out which file(s) is the trouble maker.
Replace *.HEAD with *.nii or something similar for other file formats.

Do you have any thoughts about the possible problem, or about other solutions? We need to be able to input the dataTables via files because we’re going to be running many different analyses with the same script but with different dataTables, trying to do all of this automatically instead of by hand.

We’re most grateful for your help and expertise. Best regards, Larry


Try removing those quotes surrounding the square brackets […] (sub-brick selector) for the input files. You need those quotes when you put the data table as part of the script, but you don’t when the table is a separate text file.

Yes!!! Thanks so much Gang! Removing the quotes solves the problem.

Can you tell me why quotes matter in the script but not in the file, for my continuing education?

Thanks again, Larry

When the data table is part of the 3dLME or 3dMVM script, the quotes are required because the special characters (square brackets […]) will be kept intact by the shell command. However, when the input files are listed in a table as a separate files, the table is directly passed through the shell command without any interpretation, so the quotes should not be included; otherwise, the quotes would be directly passed to the C program, triggering misinterpretation. We’ll try to find a solution in the near future to resolve this inconsistency at the user interface level.

Thanks again for everything, Gang!