Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 Analysis Software Support
 resting_pipeline-beta
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

petty
BIAC Staff

USA
453 Posts

Posted - Mar 30 2012 :  2:07:27 PM  Show Profile  Reply with Quote
Hey Guys, I added something to the final step of the resting_pipeline.

There's now a generation of a graphml format file, which contains the zr_values and r_values from all the connections, as well as the time course and spacial location of the ROIs' centroids.

To make that happen there are a couple of new flags.

You may need them if not using the default AAL label file.

--corrtext is a tab delimited text file with the ROI value ( 1,2...n ) and the Name of the region:
1 DLPFC_R
2 DLPFC_L
3 FFG_R
4 FFG_L

examples can be seen in the text files located here:
/usr/local/packages/biacpython/data/

--refacpoint is the anterior commissure point in the brain in X,Y,Z coordinates. This is for a conversion and storage of the ROI centroid

If you are using the default, then you don't have to worry about those.

This graphml creation happens in the final step of the pipeline ... so if you wanted to give it a try, then the easiest thing to do is re-run the final stage.

This file is the kind of thing used to create networkx gaph theory graphs and i'm also working on a viewer function so that you can easily view results as a connectome, while being able to actually see your region names and timecourses.

more info can be seen on the wiki:
http://wiki.biac.duke.edu/biac:analysis:resting_pipeline#step_7

for now to call the newer version its just:
/usr/local/packages/biacpython/bin/resting_pipeline-beta.py

There will be a follow-up post about the viewer

Edited by - petty on Mar 30 2012 5:16:54 PM

petty
BIAC Staff

USA
453 Posts

Posted - Mar 30 2012 :  2:39:56 PM  Show Profile  Reply with Quote
Update, if you want to try the viewer i made a copy here:
/usr/local/packages/biacpython/bin/beta_viewer.py

If you have any questions, suggestions or comments please let me know.

Go to Top of Page

morey
BIAC Faculty

USA
25 Posts

Posted - May 22 2012 :  4:06:33 PM  Show Profile  Reply with Quote
I wonder if you would consider adding the scrubbing technique that is advocated by Power et al 2012; NeuroImage (Wash U group). We have implmented the scripts in my lab and can provide them for inclusion in the pipeline. I personally think the jury is still out on the precise effects of scrubbing and how exactly this ought to be accomplished. More broadly it's unclear how motion effects the results. However, when comparing groups of subjects, journal reviewers are insisting on this step. Thus for no other reason we should consider making it a step (or option) in the pipeline.

Rajendra Morey MD
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - May 22 2012 :  4:13:20 PM  Show Profile  Reply with Quote
I have implemented scrubbing of a sort as an option in a testing version of the resting pipeline, but using a slightly more sophisticated metric. It would be pretty easy to add Power-scrubbing as another option. It would be helpful to see what your labs' scripts are doing in case there are differences...
Go to Top of Page

morey
BIAC Faculty

USA
25 Posts

Posted - May 22 2012 :  4:16:09 PM  Show Profile  Reply with Quote
We'll send the "Power-scrubbing" scripts to you Syam

Rajendra Morey MD
Go to Top of Page

petty
BIAC Staff

USA
453 Posts

Posted - May 22 2012 :  4:19:19 PM  Show Profile  Reply with Quote
As of today the beta version with the graphml output is the released version:

to now to call the older version its just, but hopefully that won't be needed:
/usr/local/packages/biacpython/bin/resting_pipeline-prev.py
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Jul 05 2012 :  5:01:15 PM  Show Profile  Reply with Quote
The "scrubbing" methods described above have been implemented. Two thresholds are available:
  • motion: using the 3 rotation and 3 translation parameters from mcflirt, this calculates, per pair of adjoining volumes, the maximum displacement due to rotation and translation of all voxels on the 50mm sphere around the center of rotation, The threshold (in mm) for this is set with --motionthreshold=THRESH.
  • DVARS: using the method described in the Power et al. paper, you can specify a DVARS threshold using --dvarsthreshold=THRESH. You can specify it in BOLD units or as a percentage (with '%') of mean global brain signal.

In both cases, you can throw out neighboring points using --dvarsnumneighbors=NUM or --motionnumneighbors=NUM. You can use none, either or both scrubbing methods. If specified, the scrubbing only occurs as the last step before correlation, so the full data is used for any other step that would typically need it, like white matter/CSF/motion regression. The scrubbed data is written out to a scrubbed_*.nii.gz file, and the list of scrubbed volumes (and DVARS values, if requested) are written to text files.

See the --help message for more details. Feel free to post with any questions.

Edited by - syam.gadde on Jul 06 2012 09:06:47 AM
Go to Top of Page

petty
BIAC Staff

USA
453 Posts

Posted - Jul 09 2012 :  3:40:31 PM  Show Profile  Reply with Quote
the pipeline now take a T1 anatomical.

If a T1 is provided, then its reoriented and skull stripped. During normalization the functional is registered to the T1, which is in-turn normalized to the standard template. This transformation is applied to the functional. This follows the pattern that would be used in a normal feat analysis.

If no T1 is provided, then the functional is normalized directly to the standard template as before.
Go to Top of Page

petty
BIAC Staff

USA
453 Posts

Posted - Jan 08 2013 :  10:51:17 AM  Show Profile  Reply with Quote
We ran into an issue with the pipeline and float32 data .. there was significant error with the mean and sum calculations due to the decimal precision and the fact that the functional data has a huge number of data-points

The pipeline has been updated to cast any incoming data as float64 to remove this error.

To clearly demonstrate what i mean:

#read in float32
 data = nb.load('cn001_1_concat.nii.gz')
 data.get_data_dtype()
dtype('float32')
 d = data.get_data()
 d.mean()
1075.9124773522676

#cast as float64
 d = data.get_data().astype(np.float64)
 d.mean()
3672.51162572165

#cast as int16
 d = data.get_data().astype(np.int16)
 d.mean()
3672.3072782209892
 






Edited by - petty on Jan 08 2013 11:05:35 AM
Go to Top of Page

petty
BIAC Staff

USA
453 Posts

Posted - Jan 08 2013 :  11:18:56 AM  Show Profile  Reply with Quote
to add to that update and only be more specific, the only place where it really would've caused an effect is here:

DVARS calculation ... if you were calculating by a percentage ( ie: --dvarsthreshold=0.5% ), then the mean calculation could've been off, likely causing a higher number volumes to be rejected

Edited by - petty on Jan 08 2013 11:35:05 AM
Go to Top of Page

ch186
New Member

20 Posts

Posted - Jan 22 2013 :  4:27:06 PM  Show Profile  Reply with Quote
I am getting a memory error on the DVARS step of the pipeline. Any idea what is causing this?

01/22/2013 04:05:59 PM calculating DVARS for: /mnt/BIAC/munin.dhe.duke.edu/Morey/Lab/TBIPTSD/scrubbing/12947/output_test/filt_12947_rest_st_mcfr_brain_norm_wmcsf.nii.gz
Traceback (most recent call last):
File "/usr/local/bin/resting_pipeline.py", line 1292, in <module>
pipeline = RestPipe()
File "/usr/local/bin/resting_pipeline.py", line 111, in __init__
self.step7()
File "/usr/local/bin/resting_pipeline.py", line 941, in step7
self.step7b()
File "/usr/local/bin/resting_pipeline.py", line 974, in step7b
timeseries = self.scrub_motion_volumes(timeseries)
File "/usr/local/bin/resting_pipeline.py", line 1112, in scrub_motion_volumes
work = work ** 2
File "/usr/lib/python2.6/site-packages/numpy-1.6.1-py2.6-linux-x86_64.egg/numpy/ma/core.py", line 3670, in __pow__
return power(self, other)
File "/usr/lib/python2.6/site-packages/numpy-1.6.1-py2.6-linux-x86_64.egg/numpy/ma/core.py", line 6012, in power
result = np.where(m, fa, umath.power(fa, fb)).view(basetype)
MemoryError
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Jan 22 2013 :  4:33:09 PM  Show Profile  Reply with Quote
The most likely explanation is running out of memory, assuming you haven't already requested more memory as described here:

http://wiki.biac.duke.edu/biac:cluster:submit#job_restrictions

If that assumption is wrong, let us know.
Go to Top of Page

ch186
New Member

20 Posts

Posted - Jan 22 2013 :  5:56:34 PM  Show Profile  Reply with Quote
I requested 6GB and still got the error. Using "qaact -j" the max was 3.55GB.
Go to Top of Page

petty
BIAC Staff

USA
453 Posts

Posted - Jan 22 2013 :  6:54:13 PM  Show Profile  Reply with Quote
I ran this dataset interactively ( as you ), with 10G of ram. Not sure what your threshold was .. so you'll probably want to run it over. But it does just sound like more memory needed. Somethings don't report their usage correctly, so you can't always go by what was reported with qacct.

"01/22/2013 06:49:44 PM will "scrub" these volumes due to DVARS > 53.4295: [0, 1, 2, 3, 4, 155, 156, 157, 158, 159, 160, 161, 162] "
Go to Top of Page

morey
BIAC Faculty

USA
25 Posts

Posted - Mar 03 2014 :  4:12:46 PM  Show Profile  Reply with Quote
My question relates to the correlation coefficients of functional connectivity in the resting state pipeline. For example each of the correlation coefficients in the 116 x 116 matrix represents the connectivity strength between nodes. Each subjects cross correlation matrix can be used to contrast between subject groups using randomise. The correlation coefficient can be positive or negative, but a negative correlation value also suggests a strong functional connection if it is close to -1.

When randomise permutes group assignment and computes the group means to generate a distribution of means, these means may not accurately reflect connectivity strengths because the negative and positive correlations would cancel out. One solution might be to take the absolute values of the correlation coefficients prior to permutation.

I noted that there is a normalized matrix but this also has negative values. I am concerned that permuting is not appropriate when numbers of opposite sign but the same magnitude signify comparable connectivity strengths. Is this a legitimate concern?

Rajendra Morey MD
Go to Top of Page

simon
Starting Member

USA
0 Posts

Posted - Oct 16 2014 :  2:26:35 PM  Show Profile  Reply with Quote
How do a use a different atlas than the default in step 7? i see 3 flags for the labels (corrlabel, corrtext, corrts), but not for the actual atlas itself.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.58 seconds. Snitz Forums 2000