Hi, Philipp-
The output:
1 1 1 1 1 ACW_Awake_Global.nii
1 1 1 1 1 Resample_Yeo7N_1000ribbon.nii
... suggests that these two files are on the same grid.
I wouldn't do any ad hoc coordinate adjustments in Python. That would mean that header information could easily become incorrect, and that is possibly happening here? I am not sure---but I don't see any reason to introduce a coordinate change within Python.
As far as I see it, you have file of xyz coords and N values per line that you read into Python:
x0 y0 y0 vala valb valc vald ....
x1 y1 y1 vala valb valc vald ....
x2 y2 y2 vala valb valc vald ....
...
so you should just be able to output then output a file that has the exact same coords in each row and the new quantity for each row:
x0 y0 y0 py_out0
x1 y1 y1 py_out1
x2 y2 y2 py_out2
...
Then use 3dUndump on this new dataset; I don't think you should even need to use a mask in that command, since you only have values within the original mask, anyways.
-----------------------------------------------
However, I am a little confused about your analysis here. Do you have 2 different "input" files on which you are running 3dmaskdump---one being a 4D dataset, and one being a template or atlas, from which you want coordinates? I don't see why you would want coordinates from a separate dataset.
So, perhaps could you first explain what your starting point information is (one 4D dataset of time series that is in standard space, and then a template or atlas in the same standard space?), and what you want to do with each piece of information? That will help.
thanks,
pt