AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 14, 2008 03:44PM
Hi Folks

A couple of people here are working on a project that will involve some real time data analysis that will heavily employ MATLAB. To this end, they would like to have real time, or near real time access to data.

I have been trying to coax the real time plugin to write data out to disk after each volume is acquired and registered. In the RT_process_image function, I added some code after the "rtin->reg_mode" case-switch structure, i.e. after the RT_registration_2D_realtime and RT_registration_3D_realtime choices. I used the THD_copy_dset_subs function on either rtin->dset or rtin->reg_dset depending on if the user wanted the original data, or registered data in "real time", and just having that function access the last volume and try to write it out to disk. The added code looks something like:

switch ( RTdatamode )
{
case RT_WRITE_ACQUIRED:
{
RT_dset_written = THD_copy_dset_subs (rtin->dset[0], RT_sub_brick_id);
}
break ;

case RT_WRITE_REGISTERED:
{
RT_dset_written = THD_copy_dset_subs (rtin->reg_dset, RT_sub_brick_id);
}
break ;
#endif /* ALLOW_REGISTRATION */
}

sprintf (RT_written_prefix, "%s_%06d",
rtin->root_prefix,
RT_written);

fprintf (stdout, "Trying to write data set %s \n",
RT_written_prefix);
fflush (stdout);

EDIT_dset_items( RT_dset_written,
ADN_prefix , RT_written_prefix,
ADN_label1 , RT_written_prefix,
ADN_none ) ;

DSET_overwrite (RT_dset_written) ;

RT_written++ ;

However, THD_copy_dset_subs seems to be hitting the disk to get the data set info. I back tracked that function in thd_mastery.c and it looks like it checks to see if the data set is already in memory. Is this accurate ?

And is there a better path to get to where I am trying to go ? I was planning on giving what I did here back to the AFNI group to add into the code base if it worked well enough and robustly enough for us ...

Thanks all.

vinai

Subject Author Posted

adding capability to real time plug in

vinai roopchansingh October 14, 2008 03:44PM

Re: adding capability to real time plug in

Bob Cox October 14, 2008 04:03PM

Re: adding capability to real time plug in

vinai roopchansingh October 14, 2008 04:39PM

Re: adding capability to real time plug in

rick reynolds October 14, 2008 05:39PM

Re: adding capability to real time plug in

vinai roopchansingh October 15, 2008 10:56AM

Re: adding capability to real time plug in

rick reynolds October 14, 2008 04:30PM

Re: adding capability to real time plug in

vinai roopchansingh October 14, 2008 04:57PM

Re: adding capability to real time plug in - some progress ...

vinai roopchansingh October 15, 2008 01:35PM

Re: adding capability to real time plug in - some progress ...

rick reynolds October 15, 2008 02:11PM

Re: adding capability to real time plug in

vinai roopchansingh October 15, 2008 04:35PM

Re: adding capability to real time plug in

rick reynolds October 15, 2008 07:20PM

Re: adding capability to real time plug in

vinai roopchansingh October 15, 2008 10:23PM

RT write implemented ...

vinai roopchansingh October 17, 2008 02:39PM

Re: RT write implemented ...

rick reynolds October 17, 2008 04:37PM