Read .1D files in python

Hy guys,

Do anyone of you know a way of reading afni .1D files in python? Thank you in advance

Cheers,
Vicente

Hi, Vicente-

Can you please be a bit a bit more descriptive? Do you want to plot lines or something else? For some plotting, see 1dplot and 1dplot.py.

Inputwise, do you want to avoid “# commented lines” that start with a “#”? Or is it just columns of numbers?

For more general reading in, there is a library in AFNI called lib_afni1D.py, and a class Afni1D. You can do something like:


import lib_afni1D.py as LAD

my_dat = LAD.Afni1D(filename)

… and you are off and running (you can read the code to see all the aspects of my_dat after this kind of import).

Really depends what your are looking to do.

–pt