Generated by All in One SEO v4.9.7.2, this is an llms.txt file, used by LLMs to index the site. # Crash Log The CogNeuroStats Blog ## Sitemaps - [XML Sitemap](https://blog.cogneurostats.com/sitemap.xml): Contains all public & indexable URLs for this website. ## Posts - [Stop macOS Catalina 10.15 from hounding you about bash](https://blog.cogneurostats.com/2019/10/10/stop-macos-catalina-10-15-from-hounding-you-about-bash/) - Stop macOS Catalina 10.15 from hounding you about bash - [PsychoPy: Changing background colors selectively](https://blog.cogneurostats.com/2019/07/10/psychopy-changing-background-colors-selectively/) - How to change the background color of individual slides/routines in PsychoPy - [Rotating bvecs for DTI fitting](https://blog.cogneurostats.com/2013/09/06/rotating-bvecs-for-dti-fitting/) - Update: While these methods continue to be useful, I now recommend using TORTOISE for preprocessing DTI. The TORTOISE pipeline includes methods for (among other things) reducing distortions from EPI artifacts, eddy current correction, correcting for motion, rotating b-vecs, and co-registration to an anatomical image. There are instructions for using the newest version here. Most - [Analyzing DTI Data in AFNI (Part 2)](https://blog.cogneurostats.com/2013/08/26/analyzing-dti-data-in-afni-part-2/) - While the information in this post is useful, I recommend users use TORTOISE for processing diffusion data. You can read a tutorial of TORTOISE3 here. I previously described how to do some DTI analyses in AFNI. To review, we could use a linear alignment to the b0 image in order to correct for some eddy - [Analyzing ERP Data with PCA-ANOVA in R](https://blog.cogneurostats.com/2013/08/05/using-r-to-do-pca-anova-pt1/) - Running a PCA-ANOVA in R is fairly straightforward. In this post we'll focus on doing a temporal PCA on clusters of ERP channels. First you will want to arrange the data in one file. If you are coming from Net Station, you can export your ERP averaged files to text and then use MCAT to create - [Aligning Partial Volume fMRI in AFNI](https://blog.cogneurostats.com/2019/04/22/aligning-partial-volume-fmri-in-afni/) - How to align partial volume Echo-planar images (EPI) from high-resolution fMRI - [Rendering AFNI/SUMA Over the Network](https://blog.cogneurostats.com/2018/09/05/rendering-afni-suma-over-the-network/) - This is mostly a quick note to remind myself how to do this, since I spent about 30 minutes today "remembering" (synonymous with googling) how I got this to work last time! That said: Once upon a time, many of us would connect to a remote (usually linux) server and run graphical programs over the - [The better skullstrip in AFNI](https://blog.cogneurostats.com/2018/05/10/the-better-skullstrip-in-afni/) - For most users of imaging software, we use the skull stripping program included in our distribution. If you're an AFNI user, you probably use 3dSkullStrip, if you use FSL then it's BET, and of course Freesurfer has their own in recon-step 1. A few years ago, I advocated for using Optibet and even wrote an entirely - [Installing AFNI on Mac OS X 10.11 "El Capitain"](https://blog.cogneurostats.com/2016/01/13/installing-afni-on-mac-os-x-10-11-el-capitain/) - We've all been there, Apple releases a new Operating System and when you install it, you find out that your favorite programs don't work on launch day or require some special install instructions. Well if you've installed AFNI onto a Mac running 10.11, you may notice that some of the Python programs don't fully work. - [DTI Statistics with TRACULA data (Part 1)](https://blog.cogneurostats.com/2017/05/22/statistics-with-tracula-data-part-1/) - If you're reading this post either you're a loyal fan (yay!) or you've run Freesurfer (possibly in parallel) and processed your diffusion data in (hopefully TORTOISE) and then Tracula (also possibly in parallel) and you're wondering where do you go from here. I'm glad you're here, that's probably me talking to myself because I read my own blog - [Preprocessing Diffusion Weighted Images with TORTOISE 3 (Part 1)](https://blog.cogneurostats.com/2017/04/10/preprocessing-diffusion-weighted-images-with-tortoise-3-part-1/) - A while back, I posted about how to use TORTOISE 2.0/2.5 for preprocessing Diffusion Weighted Images (DWIs), create tensors, and then do blip-up blip-down correction. All of those steps relied on using a graphical user interface (GUI) through a program called IDL to tell TORTOISE what you wanted it to do. This was often a - [TORTOISE Processing of DWI/DTI (Part 1)](https://blog.cogneurostats.com/2014/01/03/tortoise-processing-of-dwidti-part-1/) - These instructions are for an older version of TORTOISE, if you would like to read new instructions checkout the updated tutorial HERE! There are many options when deciding how to process Diffusion Weighted Images (DWI) and turn them into Diffusion Tensor Images (DTI). I've written before about preprocessing in FSL (Part 1, Part 2) and AFNI (Part - [How to install AFNI on macOS X Sierra](https://blog.cogneurostats.com/2016/11/01/how-to-install-afni-on-macos-x-sierra/) - Follow these instructions for Mac OS X 10.11 El Capitain. That's it! It's great when stuff continues to just work! Well... mostly. Depending on how you upgraded, you might have to run this command in the terminal to allow you to run applications from unsigned developers: sudo spctl --master-disable But that should really be it. - [Performing brain-behavior correlations with 3dttest++](https://blog.cogneurostats.com/2016/10/26/performing-brain-behavior-correlations-with-3dttest/) - A while ago, I wrote a post for doing brain-behavior correlations with different AFNI programs. And at the time I mentioned that you can do correlations with 3dtest++, but you'd first need to standardize (read: z-score) both the brain and behavior values. The general logic there is that if you're doing a simple regression (what - [HowTo: 3D printing your brain](https://blog.cogneurostats.com/2016/06/17/howto-3d-printing-your-brain/) - It's been about five months since I last updated, and for that I'm somewhat apologetic. Things have been busy and I've been trying to figure out a series of topics to post on for the next series. So rest assured, there will be more analysis guides in the future. BUT today is all about how - [Installing PyMVPA on Mac OS X](https://blog.cogneurostats.com/2015/12/14/installing-pymvpa-on-mac-os-x/) - These instructions work on 10.10 (Yosemite) and 10.11 (El Capitain). If things change in the future, I'll try to update these instructions! Multi-voxel Pattern Analysis (MVPA) is hot right now. Its users are the cool kids at conferences. And if you want to join that crowd of researchers, you have a growing possibility of solutions - [Analyzing DTI Data in AFNI (Part 1)](https://blog.cogneurostats.com/2013/07/18/analyzing-dti-data-in-afni-part-1/) - Previously, I talked about how to process DWI/DTI data in FSL and then visualize the results. AFNI has recently added quite a few tools for analyzing diffusion data. I'll cover these in the next post, but first I'll review correction of eddy currents, coregistering the DWI data to the anatomical and fitting tensors. The following - [Converting DICOM files to NIFTI](https://blog.cogneurostats.com/2013/03/18/converting-dicom-files-to-nifti/) - Most people who are processing MRI/fMRI data will need to convert data from the scanner format DICOM to a more usable NIFTI format that is used by a variety of neuroimaging software packages (e.g. AFNI, FSL, SPM). As with most things in neuroimaging, there are a variety of options and here are a few (though - [Helpful fMRI QA Tools in AFNI](https://blog.cogneurostats.com/2015/11/23/helpful-fmri-qa-tools-in-afni/) - Apologies for the lack of updates lately! It's been... busy. I've written in the past about automatically making "snapshots" in AFNI (here) and even doing that without having AFNI taking over you entire screen using Xvfb (here). These are one way of performing Quality Assurance (QA) on your data, by actually LOOKING at the activation - [Parallelizing Tracula](https://blog.cogneurostats.com/2015/08/11/parallelizing-tracula/) - By popular request, or rather the sheer number of hits the Parallelizing Freesurfer post, today we turn our attention to Tracula, the Freesurfer integrated solution for doing diffusion tensor imaging (DTI) tractography! Tracula has a lot of nice features, one of my favorites is the ability to estimate 18 or so tracts in the brain by constraining - [UCLA NeuroImaging Training Program](https://blog.cogneurostats.com/2015/08/05/ucla-neuroimaging-training-program/) - Just a quick reminder that the annual UCLA NeuroImaging Training Program is currently running. You can download all of the materials (slides, video, etc) from previous years (like 2014) on their website. This years materials will be available after the workshop. I also highly recommend, if you have some free time, checking out the live - [How to Analyze Diffusion Tensor Imaging Data (Review)](https://blog.cogneurostats.com/2015/06/29/how-to-analyze-diffusion-tensor-imaging-data-review/) - After my first year of blogging, I ran a "One Year Review" piece that covered all of the articles that I wrote in that first year. And that article tends to get hit by search engines fairly often since it was published on December 3, 2013. Sure, I meant to go back and do a - [Getting started with Machine Learning](https://blog.cogneurostats.com/2015/05/19/getting-started-with-machine-learning/) - So we have to face it, Machine Learning is the buzzword of the year (multiple years?). But where does one start learning? Well assuming you've taking some stats classes in the past and words like regression don't scare you off, you may be able to jump right in to some of the applicable textbooks out - [Example use of DTIprep for DWI Quality Checking](https://blog.cogneurostats.com/2015/04/16/example-use-of-dtiprep-for-dwi-quality-checking/) - In a previous post, we covered using DTIprep for preprocessing of diffusion weighted imaging (DWI) data. I've written a quick script (below) to automate DTIprep for the purposes of running the default QC check. My workflow has DICOM data automatically downloaded from our PACS server, then automatically converted to NIFTI format, and then organized in the - [DTIprep for Preprocessing of DWI Data](https://blog.cogneurostats.com/2015/03/24/dtiprep-for-preprocessing-of-dwi-data/) - As I've mentioned before, it's a good idea to do some preprocessing on your diffusion imaging data! Previous tutorials have covered using AFNI's built-in tools (Part 1, Part 2, Part 3) as well as the very formidable TORTOISE (Part 1, Part 2, Part 3). As with most things in NeuroImaging, you have many options when - [Analyzing DTI Data in AFNI (Part 3)](https://blog.cogneurostats.com/2015/02/06/analyzing-dti-data-in-afni-part-3/) - So far in the DTI series we've covered how to process data entirely in AFNI (Part 1, Part 2). We've also covered how to preprocess and fit tensors in the nicely packaged form of TORTOISE (Part 1, Part 2, Part 3). Regardless of how you got to the point of having tensors fit, you can continue to - [Some exposure to MRI Transforms in AFNI](https://blog.cogneurostats.com/2015/01/23/some-exposure-to-mri-transforms-in-afni/) - Transform matrices are confusing! There, I said it. If you've never taken the time to play around with transform matrices in MRI, I completely understand. That said, it's not a bad idea to get some exposure to the world of warping and the matrices that they often depend on. First of all, there are different - [Intersection Maps in AFNI](https://blog.cogneurostats.com/2014/12/01/intersection-maps-in-afni/) - I've recently been working with a dataset that included the same subjects across two studies (here: study1 and study2) that should give us complimentary information. One of the ways that you can look at data across these two studies is to create "intersection" maps, that show where the brain regions were activated in both studies. Obviously - [Tidbits on AFNI's TENT function](https://blog.cogneurostats.com/2014/10/08/tidbits-on-afnis-tent-function/) - I think we've all had that moment where we wonder what exactly our HRF function is doing to give us the results that we see in our data. Using a fixed function regressor can be great for a number of reasons: 1) they don't require many degrees of freedom, 2) someone else did the hard - [R for MRI Lovers (Part 2)](https://blog.cogneurostats.com/2014/09/03/r-for-mri-lovers-part-2/) - Writing this post after the first in the series may seem somewhat backwards! Last time we covered reading in data from individual subjects and plotting them as box plots with error bars in R. This time we'll do something even more straightforward - plotting ROI group effects. If you haven't already read it, there are - [TORTOISE Processing of DWI/DTI (Part 3)](https://blog.cogneurostats.com/2014/08/05/tortoise-processing-of-dwidti-part-3/) - In Part 1, we covered how to preprocess your Diffusion Weighted Images (DWI) for "correction" of movement, eddy currents, and other artifacts in your data. In Part 2, we covered fitting the tensors and exporting the resulting data to AFNI or other packages. Today we continue by talking about an additional feature of TORTOISE, which - [Quickly Creating Masks in AFNI](https://blog.cogneurostats.com/2013/11/05/quickly-creating-masks-in-afni/) - Often when creating a mask to use with 3dROIstats, 3dmaskave, or 3dmaskdump, we will create a mask at a higher resolution than our functional runs, detailed here. One of the reasons the mask is created at a higher resolution is that we base the anatomical masks on either 1) the high-resolution anatomical or 2) the - [Freesurfer Cortical Thickness Analysis with AFNI/SUMA tools](https://blog.cogneurostats.com/2014/07/14/analyzing-freesurfer-surfaces-with-afnisuma-tools/) - First let me say that I am a huge huge fan of Freesurfer. It makes my life easier in so many ways by 1) creating surfaces that we can display fMRI results on; 2) giving beautiful cortical and subcortical segmentations for use in the upcoming (soon, really) pediatric Atlas that I've been working on; 3) - [NEW CogNeuroStats Wiki](https://blog.cogneurostats.com/2014/07/11/new-cogneurostats-wiki/) - Like many of our fellow bloggers, we hear pleas from readers about needing a "start page" to organize everything together. After considerable amounts of thought, we finally had the idea of creating a wiki that would house much of the content that exists on the blog. The one major shift is that we're going to spend - [Creating ROIs in AFNI with Coordinates](https://blog.cogneurostats.com/2014/02/05/advanced-creation-of-rois-in-afni/) - In the past, I've posted on creating ROIs in AFNI and ways to manipulate those ROIs once created. But something that comes up fairly often on the AFNI message boards is how to use 3dcalc to create different ROI shapes. The most common that I've found are creating spheres and cubes, I've made some crazy - [Simultaneous t-tests in AFNI's 3dttest++](https://blog.cogneurostats.com/2014/06/09/simultaneous-t-tests-in-afnis-3dttest/) - In the past I've shown how to use 3dttest++ to do one-sample, paired, and two-sample t-tests for whole-brain maps in AFNI. Occasionally there is an instance where you want to quickly generate a series of t-tests for all participants at once. Most people (including me until recently) would simply loop over their gen_group_command.py script several - [AFNI Bootcamp Training Next Week](https://blog.cogneurostats.com/2014/05/19/afni-bootcamp-training-next-week/) - There is an AFNI training workshop (aka "Bootcamp") NEXT WEEK at Yale. If you're interested in signing up, the information is here. - [Brief: Process Resting-State Data Faster with 3dTproject!](https://blog.cogneurostats.com/2014/05/15/brief-process-resting-state-data-faster-with-3dtproject/) - I don't usually post brief updates like this, but a recent update to afni_proc.py has me really excited. As of the May 13th 2014 binaries of AFNI, you can now expect your resting state data to process considerably faster thanks to a new-ish program called 3dTproject. 3dTproject is meant to replace 3dDeconvolve for resting state - [Basics of AFNI Group Analyses (Part 3)](https://blog.cogneurostats.com/2014/05/05/basics-of-afni-group-analyses-part-3/) - It's been a while since I've touched on this topic (Part 1, Part 2). Recently the topic of doing t-tests has come up a lot in the area around where my desk is situated. In vastly over simplified thinking, I think the three most common approaches to using t-tests in MRI data are as follows: - [Correlating Brain and Behavior in AFNI](https://blog.cogneurostats.com/2013/03/08/correlating-brain-and-behavior-in-afni/) - If previous posts hadn't given it away, AFNI is my tool of choice for processing neuroimaging data. A lot of people get confused on the sheer number of options there are and that most things can be accomplished in a variety of ways. Today I'm going to outline three ways of doing Correlations between fMRI - [Single Subject Analysis on the Surface (SUMA)](https://blog.cogneurostats.com/2014/04/30/single-subject-analysis-on-the-surface-suma/) - I had previous posted about displaying the fMRI results onto the cortical surface. It's been brought to my attention that this post wasn't as clear as it could be! I know, it happens from time to time! So let's try this again! Let's start with a straightforward topic - processing data at the single-subejct level on - [Adventures in AFNI ROI combinations](https://blog.cogneurostats.com/2014/04/25/adventures-in-afni-roi-combinations/) - I've written about ROI creation in AFNI a few times before (one, two, three). When we draw ROIs or use 3dUndump, we usually end up with multiple ROIs in one file, each with a different label. In contrast, when we use whereami to create atlas regions, we usually end up with one ROI per file. - [Basics of AFNI Group Analyses (Part 2)](https://blog.cogneurostats.com/2013/07/16/basics-of-afni-group-analyses-part-2/) - So after last time, you successfully ran a group-level analysis that you feel fits your scientific question and now you want to know what will survive statistical scrutiny. Well the good news is that you have a few options! First, in order to get any of these options working, you should start by running your - [R for MRI Lovers (Part 1)](https://blog.cogneurostats.com/2014/03/25/r-for-mri-lovers-part-1/) - Like many scientists, I learned SPSS a long long time ago. It was free and installed on any computer at my undergraduate institution. And like many people, I found the pull-down menus useful and sometimes endearing. But when I went to grad school I was thrust into a world of using SAS. Many a groans - [Dealing with transforms in AFNI (Part 1)](https://blog.cogneurostats.com/2014/02/27/concatenating-transforms-in-afni/) - AFNI's main tool for dealing with transforms is cat_matvec, but in many cases you may not need to use it! Everyone knows that transform matrices are confusing -- I'll do a post later on just covering them -- but for now, I think we can all agree that it's a relief anytime you don't have to - [TORTOISE Processing of DWI/DTI (Part 2)](https://blog.cogneurostats.com/2014/01/23/tortoise-processing-of-dwidti-part-2/) - Last time, we covered how to use TORTOISE's DIFF_PREP tool to preprocess Diffusion Weighted Images (DWI) to correct for eddy currents, motion, rotate the b-vectors (alongside the motion correction), and optionally correct b-splines if we used a T2-weighted structural image. The next step is to use DIFF_CALC to fit tensors, inspect the results, measure ROIs, - [Year 1 Reflection](https://blog.cogneurostats.com/2013/12/03/year-1-reflection/) - I really started investing in this blog in November 2012. In the first month it received 12 hits. In the second month, it also received 12 hits. But as we've added more content over the past year, the number of hits has continued to go up. And I'm very happy that today, we celebrate more - [Statistics on the Brain with AFNI](https://blog.cogneurostats.com/2013/11/25/statistics-on-the-brain-with-afni/) - In previous posts I've covered how to use AFNI to run GLMs on your data to find task-related activations. But there are a host of other statistics that you can run on the brain outside of the GLM! And this is where AFNI really shines in terms of having a diverse set of tools, yet - [The mysterious flipped brain](https://blog.cogneurostats.com/2013/11/14/the-mysterious-flipped-brain/) - I previously reviewed a series of DICOM to NIFTI converters. The entire purpose of this post is to state how important it is to check the orientation of the images coming out of any DICOM to NIFTI converter. The example today illustrates an incorrect flip in dcm2nii, but I want to stress that this happens - [Using afni_proc.py for fMRI analysis](https://blog.cogneurostats.com/2013/10/22/using-afni_proc-py-for-fmri-analysis/) - I receive a lot of questions about how to setup the basic analyses in AFNI. Previously I detailed using uber_subject.py, the AFNI graphical user interface to afni_proc.py which really does all of the hard work under the hood. Today I'm going to briefly review the common options in afni_proc.py and why I use them. You - [Quality Checking fMRI](https://blog.cogneurostats.com/2013/05/23/quality-checking-fmri/) - You can never be too careful in terms of data quality. AFNI offers a number of checks on the data via the automated @ss_review_basic and @ss_review_driver generated by afni_proc.py. But occasionally you need more information! And also if you're comparing data across multiple scanners, it's not a bad idea to have some of these numbers - [Simulating fMRI Designs](https://blog.cogneurostats.com/2013/10/10/simulating-fmri-designs/) - I could say a lot about proper simulation of fMRI experiments. Basically it's important to measure the efficiency of your design before an experiment (see here). If you wanted to perform the calculations yourself, MATLAB/Python/Octave are all options and the process is "fairly simple". Xmat = [design_matrix' * design_matrix]; main_effects(ct) = [ contrast' * (Xmat^-1) - [Adjusting MRI Smoothness for Multi-Scanner Comparisons](https://blog.cogneurostats.com/2013/10/07/smoothing-mri-images-in-afni/) - Typically when we smooth (aka spatial filter) our fMRI data using a fixed kernel size. And as we know, the size of a smoothing kernel makes some difference in the final results (see below). This shows a group analysis map, the results are more shocking on single subject maps. The common misconception is that you - [Displaying fMRI results on Surfaces with SUMA](https://blog.cogneurostats.com/2013/09/26/displaying-fmri-results-on-surfaces-with-suma/) - AFNI (Analysis of Functional NeuroImages) includes SUMA (Surface Mapping with AFNI) for displaying brains in 3D. AFNI already includes a 3D Render plugin (shown below), capable for displaying fMRI results in 3D. But SUMA offers a few additional benefits, not the least of which is the ability to click and rotate the image by hand - [Connectivity Analysis in AFNI (Part 1)](https://blog.cogneurostats.com/2013/09/17/connectivity-analysis-in-afni-part-1/) - I've written before about how AFNI offers users the ability to perform the same or very similar analyses using a variety of tools. Performing connectivity analysis is no different. First of all, most people who are talking about connectivity are really referring to "seed connectivity" (sometimes called functional connectivity or fcMRI), whereby one region of - [Creating AFNI images via command line and Xvfb](https://blog.cogneurostats.com/2013/09/03/generating-activation-maps-in-afni-without-opening-x11/) - Quite a while ago, I wrote a post about making automated snapshots of MRI activation with AFNI. One of the things I always appreciated about FSL was that they provided a series of ready-made images to show off where activation was in the brain for a given analysis (at least using FEAT). So when I - [Finding ERP Noise Outliers](https://blog.cogneurostats.com/2013/09/09/finding-erp-noise-outliers/) - There are plenty of points in ERP data analysis that can be subjective. But that doesn't mean that they have to be! One subjective point is determining the noise level of your subjects. If you're using Net Station (EGI), you can check an option in the "Averaging" Waveform tool to calculate noise estimates. This will - [Writing your own fMRI programs using the AFNI API (Part 1)](https://blog.cogneurostats.com/2013/08/21/writing-your-own-fmri-programs-using-the-afni-api-part-1/) - I find that it's fairly rare that I wish there was an AFNI program that did something that cannot be accomplished with existing tools and a bit of creativity. But, if you do find something that requires writing a custom program, the AFNI distribution is both easily accessible and fairly straightforward to code for. Over - [Fun with AFNI Masks](https://blog.cogneurostats.com/2013/08/16/fun-with-afni-masks/) - I watched an episode of The Big Bang Theory last night where Dr. Sheldon Cooper was airing an episode of "Fun with Flags," which gave me the idea for today's blog post title. A while ago, I detailed how to create ROIs in AFNI using a variety of different methods. And I even included a - [Creating Volume ROIs in AFNI](https://blog.cogneurostats.com/2013/07/24/creating-volume-rois-in-afni/) - For those keeping track at home, an ROI involves selecting a section of the brain (or subset of voxels) that you have some interest in. The ROI can be a geometric shape or drawn by hand. It can be defined by anatomical markers or by functional activation or really by anything you want. AFNI has - [Multiple Basis Functions with afni_proc.py](https://blog.cogneurostats.com/2013/08/14/multiple-basis-functions-with-afni_proc-py/) - Admittedly the title is a little bit opaque, you can already use afni_proc.py to have some of your regressors use the GAM basis function and others to use another basis function (e.g. SPM). But one thing that I find helpful is to compare a standard basis function (e.g. GAM, SPM, SPMG2, etc) with an FIR - [Tips for Remote Processing](https://blog.cogneurostats.com/2013/07/29/tips-for-remote-processing-of-mri-data/) - Quite a few tools for processing MRI data take considerable amounts of time to run, even with computer hardware getting faster and cheaper daily. I have previously discussed how to queue up multiple Freesurfer jobs with GNU Parallel in order to automatically queue and dispatch a number of Freesurfer processes simultaneously. But what do you - [Basics of AFNI Group Analyses (Part 1)](https://blog.cogneurostats.com/2013/07/12/basics-of-afni-group-analyses-part-1/) - I've been working on quite a few things recently, and will get back to regular posts soon. In the meantime, here's a brief introduction to Group Analysis tests in AFNI. I see the information related to Group Analyses falling into two categories: 1) Which program to run and when; 2) all the other stuff related - [To Eric Langlois](https://blog.cogneurostats.com/2013/06/25/to-eric-langlois/) - On a personal note, I would like to say a few things about my friend Eric Langlois. Eric recently passed away. Several others (here, here, here) have posted about his unfortunate death, and the story can be found here. Eric was a Connecticut-based photographer and founder, owner, and principal photographer for Raw Photo Design. He - [Installing the ERP PCA Toolkit](https://blog.cogneurostats.com/2013/06/24/installing-the-erp-pca-toolkit/) - Today I'm raising awareness of a phenomenally helpful tool in ERP Research called the ERP PCA Toolkit. In short, the PCA toolkit allows you perform temporal, spatial, and complex (e.g. temporo-spatial) analyses on ERP data. Shown in the figure below is a quick temporal-spatial PCA on some ERP data for a go/no-go task. The PCA - [Creating automated snapshots of fMRI activation](https://blog.cogneurostats.com/2012/07/30/creating-automated-snapshots-of-fmri-activation/) - There are plenty of times when you want to create snapshot images at a particular threshold so that you can quickly view the activation profiles of all participants within a given study. AFNI offers this functionality through a plugout_drive application where you can tell AFNI to change overlay, underlay, threshold, etc and even save the screenshots - [Basics of DTI Analysis (FSL)](https://blog.cogneurostats.com/2013/05/28/basics-of-dti-analysis-fsl/) - FSL has a complete pipeline for converting Diffusion Weighted Images (DWI) to Diffusion Tensor Images (DTI) using one of two pipelines: 1) "Tract-Based Spatial Statistics" or 2) Probabilistic Tractography (via Bedpostx and probtrackx). The graphic below shows a rough overview of each. The analysis with FSL is fairly straight forward. If you wish, you can - [Visualizing Single Subject DTI Data (FSL)](https://blog.cogneurostats.com/2013/06/06/visualizing-single-subject-dti-data-fsl/) - A few posts ago, I described how to do some basic analyses of Diffusion data. I realize now that I left off the visually cool factor of displaying individual subject data. Once you complete the eddy_correct and dtifit steps in the previous post, several files will be generated for FA (fractional anisotropy), MD (mean diffusivity), - [Parallelizing Freesurfer](https://blog.cogneurostats.com/2013/06/10/parallelizing-freesurfer/) - Today I started running VBM and Freesurfer comparisons on a "new" dataset that everyone in our lab is particularly interested in moving forward. The VBM was all carried out in SPM8 with the VBM8 toolbox. I particularly like the VBM8 toolbox because it makes use of the SPM8 DARTEL transformations, and it's relatively easy to queue up - [Single Subject Analysis in AFNI](https://blog.cogneurostats.com/2013/05/29/single-subject-analysis-in-afni/) - AFNI has three major avenues to running a single subject analysis. 1) You can use uber_subject.py to configure the analysis in a Graphical User Interface (GUI); 2) You can use afni_proc.py to specify the analysis using the command line; 3) You can write your own command line commands in your own script, which calls each - [Source Code Available](https://blog.cogneurostats.com/2013/05/21/source-code-available/) - Some time ago, I made available a series of custom-built software packages for helping perform EEG/ERP Analysis. I have now finished uploading the source code to my github repository. All of the programs were written in Objective-C, many of them fairly early in my programming career (forgive the comments or lack of comments!). If you - [A better way to run AFNI's uber_subject](https://blog.cogneurostats.com/2013/04/08/a-better-way-to-run-afnis-uber_subject-p/) - I used to use fink, and then I switched to MacPorts; truthfully, neither of them really made me happy. Now I mostly use homebrew, and one real advantage (besides being faster and lighter weight) is that it's very easy to get AFNI's GUI programs up and running on a Mac. Install AFNI (you've probably already - [Using R with AFNI](https://blog.cogneurostats.com/2013/04/09/using-r-with-afni/) - AFNI already has a host of programs that use R to analyze MRI data - 3dLME, 3dMVM, 3dMEMA, etc. Suppose you wanted to create your own functions that use R to manipulate data - well here's a quick introduction. In this quick example, here is how to "Auto Mask" your dataset in R. source('path/to/AFNI/AFNIio.R') thedata - [Dropping file extensions](https://blog.cogneurostats.com/2013/03/19/dropping-file-extensions/) - Randomly, for those people who do a lot of manipulation of file names, it can be painful to constantly use sed or awk or basename to change the filename without the extension. Here are three options to copy a file via 3dcopy (part of AFNI, works just like cp, but for image files, will also - [Agreement between software packages](https://blog.cogneurostats.com/2013/01/03/agreement-between-software-packages/) - Always nice when there is agreement between different neuroimaging packages. A quick block design analyzed in both AFNI and FSL - giving pretty similar results for the same participant. Both packages have distinct advantages. For AFNI: 1) it's faster ; 2) it has more customizable options; 3) the viewer allows you to adjust - [Using the GNU Scientific Library with Xcode](https://blog.cogneurostats.com/2012/12/30/using-the-gnu-scientific-library-with-xcode/) - The GNU Scientific Library (GSL) includes convenient use to matrices among other things. One convenient way to install GSL is using homebrew. Once installed a quick "brew install gsl" will do the work for you. To then use GSL with Xcode, do the following: Create a new Xcode Project Edit Build Settings Under "Other Linker - [Tracking missing data in longitudinal samples](https://blog.cogneurostats.com/2012/11/13/tracking-missing-data-in-longitudinal-samples/) - I've been working on this massive longitudinal dataset recently. And while I have the R tables function and a variety of other tools at my disposal - I find that I constantly go back to SAS for identifying which time points are missing data for each subject. Since this is massively longitudinal data, I tend - [The power of doing things in Parallel](https://blog.cogneurostats.com/2012/09/12/the-power-of-doing-things-in-parallel/) - There just isn't enough time in the day to get everything done. And the more time that I spend on getting little things done, the less time I have for the "big picture". Big picture will include writing papers, chapters, and grants. The ability to do repetitive tasks quickly and automatically is probably the most important - [Preprocessing EEG/ERP data](https://blog.cogneurostats.com/2012/08/09/49/) - Years ago, I wrote a manual for preprocessing data using EGI's Net Station software. As I was cleaning out old files and burning things I never use to CD, I came across my collection of analysis PDFs. I'll start by uploading the first manual, which covers preprocessing ERP data by filtering, segmenting, artifact detection, bad - [EEG Processing Tools](https://blog.cogneurostats.com/2012/07/24/eeg-processing-tools/) - I used to have a MobileMe account where I made available several custom developed software programs for doing processing of EEG/ERP data. I've listed them below as well as their download links and also will make them available on the main site (www.cogneurostats.com). All programs run on Mac OS X and are written in Objective-C/Cocoa. - [Checking fMRI normalization](https://blog.cogneurostats.com/2012/07/17/checking-fmri-normalization/) - One of my first tasks when we switched our fMRI data analyses from our in-house code to using AFNI was to come up with a way of checking the alignment two MRI images. This could be either 1) EPI images to the anatomy or 2) individual subject anatomy to that of the standard space (MNI) - [Here we go!](https://blog.cogneurostats.com/2012/06/20/here-we-go/) - Today we begin blogging at cogneurostats.com. This blog is intended to summarize interesting information, methods, and theory in the field of Cognitive Neuroscience. Since I work with both EEG/ERP and fMRI, you should expect a decent amount of content pertaining to those topics. Particularly as I discover interesting tools, I'll likely post about them here. ## Pages - [Blogs I Read](https://blog.cogneurostats.com/blogs-i-read/) - In no particular order: General: The Setup Neuroscience: Andy's Brain Blog Mumford Brain Statistics MVPA Meanderings Diffusion-Imaging NeuroSkeptic NeuroChambers Psychology: Socially Mindful Statistics: R-Bloggers Statistics Blogs Darren's Research Blog - [About Me](https://blog.cogneurostats.com/sample-page/) - My name is Peter Molfese. I completed a PhD in Developmental Cognitive Neuroscience in 2009 and have been working as a post-doc, now research scientist for a number of labs and Universities across the USA. I specialize in research investigating the development of language and learning in children. And for the most part my research - [NEW Wiki Available](https://blog.cogneurostats.com/new-wiki-available/) - The blog is great for us posting updates as we develop new methods and routines. But it's not always the best place to learn how to do things because there's not always a set order to the posts. It's also not always easy to search! So we've finally caved and started a Wiki! If you're ## Categories - [Uncategorized](https://blog.cogneurostats.com/category/uncategorized/) - [Neuroimaging](https://blog.cogneurostats.com/category/neuroimage/) - Neuroimaging - [EEG/ERP](https://blog.cogneurostats.com/category/neuroimage/eeg/) - EEG or ERP - [MRI](https://blog.cogneurostats.com/category/neuroimage/mri/) - fMRI or aMRI - [Statistics](https://blog.cogneurostats.com/category/statistics/) - [Programming](https://blog.cogneurostats.com/category/programming/) - [DTI](https://blog.cogneurostats.com/category/neuroimage/dti/) - Diffusion Tensor Imaging - [Personal](https://blog.cogneurostats.com/category/personal/) - [Information Technology](https://blog.cogneurostats.com/category/information-technology/) ## Tags - [AFNI](https://blog.cogneurostats.com/tag/afni/) - [Tractography](https://blog.cogneurostats.com/tag/tractography/) - [MRI](https://blog.cogneurostats.com/tag/mri/) - [analyze](https://blog.cogneurostats.com/tag/analyze/) - [tortoise](https://blog.cogneurostats.com/tag/tortoise/) - [DTIprep](https://blog.cogneurostats.com/tag/dtiprep/) - [FSL](https://blog.cogneurostats.com/tag/fsl/) - [Freesurfer](https://blog.cogneurostats.com/tag/freesurfer/) - [DTI](https://blog.cogneurostats.com/tag/dti/) - Diffusion Tensor Imaging