Thank you Rick for your explanations.
There was no doubt that the real-time system will work. I simply asked my questions to understand better how it works and see if I can simply start from those demo programs (I think this is easiest because I have the data sent directly in real time from the scanner to the Mac already, which is similar to running the demo).
I understand from your answer that using realtime_receiver.py is optional. So I think my first question is in case I am not using it, what should I do to interact with AFNI and the RT-plugin to extract the data at each time point? I guess this will require anyway a piece of afni scripts to change some variables in the RT-Options so the RT-plugin knows what to compute and write out, e.g. a text file that contains the ROI mean.
However, If using realtime_receiver is easier, I would rather go from there (But wait! there must be a reason you said it is not necessary for the real-time system).
With the goal to have a txt file generated after each TR, I am wading thru the realtime_receiver Python code now ...
In 'realtime_receiver.py' and 'compute_TR_data()', it looks like 'rti.extras[[i]][j]' stores the mean of ROI [[i]] at time point [j]. And then this data at the said time point is appended to 'self.TR_data' under 'process_one_TR()'.
I think what I should do next is add a few lines under 'def process_demo_data(self):' to allow for the last value in 'self.TR_data' written out to a txt file.
I am planning to add the following but not sure if it will work since I am not familiar with Python:
-----
def process_demo_data(self):
...
file_name = "timepoint"+str(length)+".txt"
txt_file = open(file_name, "w")
txt_file.write("%s" % self.TR_data[length-1][0])
txt_file.close()
...
-----
Maybe you can give me a better way to do.
Again, thank you very much for your helps.
Duong
Edited 2 time(s). Last edit at 12/21/2017 01:17PM by dlhuynh.