help > RE: Extracting voxel-time-series for ROI-voxels
Nov 15, 2014  02:11 AM | Alfonso Nieto-Castanon - Boston University
RE: Extracting voxel-time-series for ROI-voxels
Dear Tobias,

I believe the difference you describe might be due to the presence/absence of the Denoising step in the different data that you are looking at. In particular, the files "niftiDATA_Subject#_Session#.nii" (in the conn*/data/ folder) will contain the data before Denoising, while the files "niftiDATA_Subject#_Condition#.nii" (in the conn*/results/preprocessing/ folder) will contain the data after Denoising. Similarly, the files "ROI_Subject#_Session#.nii" will contain the ROI timeseries before Denoising, while the files "ROI_Subject#_Condition#.nii" will contain the ROI timeseries after Denoising (the one entered in the m_analyses.X variable). Please let me know if this addresses your question and/or if I am misinterpreting. 

Originally posted by Tobias Meindl:
Dear conn users, Dear Alfonso,

I am new to conn using conn 14. My research group uses conn for connectivity analysis and preprocessing. I would like to use the preprocessed data for non-connectivity roi-analysis. My first goal here is to automatically extract ROI-data from the preprocessed volumes.

In the preprocessing steps 'white matter', grey matter', 'csf' and the areas from the aal-atlas (the aal.nii file in conn\utils\otherrois) had been defined as rois.

I tried to extract ROI-data from the "niftiDATA_Subject001_Session001.nii"-file which contains the preprocessed data:
To extract ROI-Data I used the coordinates of the voxels of a given ROI contained in the file "REX_Subject001_Session001_ROI4.mat" in the variable "params.ROIinfo.voxels".
As these coordinates are in mm I used the conn_convertcoordinates-function to transform the coordinates to indizes of of the niftiDATA_Subject001_Session001.nii-volume.
Thus I think I was able to extract the time-series from every voxel of a ROI.

Then I tried to verify my approach:
To do this I first computed the mean-time-series of a ROI (for each scan the mean of all voxels of the ROI)
I then compared "my" mean to the data in the first level-Analysis window in the figure beneath the "frequency bands input option":
As I used "derivatives order = 0", "dimensions = 1", "frequency bands = 1" I think this is also the mean of the ROIs voxels.
I extracted this data by introducing a breakpoint at line 2581 in the conn.m file and took it from the variable "CONN_h.menus.m_analyses.X". I hope this was correct so far.

Then however I encounterd a problem: the time series from "CONN_h.menus.m_analyses.X" does not completly match the mean I computed myself in the way described above. While the data match reasonably but not perfectly well for large rois like "Precentral_L" (the correlation coefficient of "my" mean and CONN_h.menus.m_analyses.X here is ~ 0.98) it does not match well for smaller rois like "Cerebelum 7b (L)" (the correlation coefficient is only ~ 0.6).

I encountered the problem of not exactly mathing mean-data by extracting means in the way described above as well as in another approach when I extracted the roi-coordinates from the aal.nii-file coregistered to the volumes in niftiDATA_Subject001_Session001.nii

My question is whether I indeed extracted the mean as computed by conn by introducing the breakpoint mentioned above. Or whether there is another safe way to extract single voxel-time-series for all voxels of a ROIs from the niftiDATA_Subject001_Session001.nii-file via command line.
Thank you very much for your help in advance.

Threaded View

Tobias Meindl Oct 25, 2014
Tobias Meindl Nov 18, 2014
Alfonso Nieto-Castanon Nov 18, 2014
Tobias Meindl Nov 25, 2014
Alfonso Nieto-Castanon Nov 26, 2014
RE: Extracting voxel-time-series for ROI-voxels
Alfonso Nieto-Castanon Nov 15, 2014