Some Questions: 1) Segmentation permission error, 2) Visualization of SPM8 results data
Hi,
I've been searching some papers on Gallant's Lab and found this toolbox. I think this toolbox is really awesome, but I am having some problems and have some questions.
Q1. I am using both MacOSX(El caption) and Ubuntu 14 system on each hardware. I am trying to get familiar with this toolbox (and also with FreeSurfer). According to your recent paper (Gao et al. 2015), it says as follows -> $ from cortex import segment $ segment.init_subject( "233" , "T1_anatomical.nii.gz " ) So I typed in terminal as follows for my own data -> $ ipython $ from cortex import segment $ segment.init_subject( "233" , "T1_New.nii.gz " ) (233 is the subject number, and T1_New.nii.gz is T1 data)
However, I received an error message about making directory because of permission issues. So, I typed '$ sudo -i' so that I can run the terminal with privileged permission, and now it seems to work normally. Is there any mistake that I got an error message before? Since the directory that Freesurfer is trying to overwrite is a user root folder, I am wondering whether I made mistake on installation of Pycortex/FreeSurfer. (As I am a novice on linux system, your help would be really appreciated)
Q2. Actually, I thought it would be really great if I could use this toolbox when visualizing fMRI RFX results data obtained from SPM8 toolbox. For example, I've done all preprocessing, modeling, statistical process etc., and obtained one RFX results image. (e.g., HITvsCR.img). As usual, I just plot this image by overlaying on MRIcro or MRIcroGL software easily. So my question is, Can I simply use Pycortex toolbox for visualizing my SPM results file? If Yes, what kind of processes would be needed? (such as converting and matching dimension/file format?)
Thank you four your kind reply in advance!
Have a good one.
Best,
Yoonjin
Hi Yoojin,
I'm glad you like the software. Regarding your first question, it sounds like the shared folder for pycortex or the Freesurfer subjects directory may have ended up in a folder that you didn't have permissions to read/write files (yes, possibly because it was in a root folder). Both Freesurfer and pycortex support placing the subjects directory wherever you want it; for Freesurfer, you can look up how in their documentation; for pycortex, you can modify the pycortex config file; check out this issue for how to do that. But neither of those seems necessary, since you seem to have found a work-around.
Regarding your second question, the only thing you will need to do is to align the statistical volume you have with the surface. After that its just a matter of loading your data as an array in python and one or two more lines of code (read through the paper again, I think there are examples there). Look at the help for cx.align.automatic and cx.align.manual to see how to compute a transform. You won't want to align the statistical volume to the surface directly, you will want to align a functional volume that is the same size and in the same space as the statistical volume. It's usually best to use a temporal mean image of the data on which the statistical volume is based. If any of that sounds confusing, please do some googling - a full tutorial of fMRI analysis & pycortex visualization is a little beyond the scope of what I can get into here.
We are (slowly) developing better documentation (with examples) for pycortex, so check back in with us from time to time to see if it's up yet. Good luck!
Hi Dr. Mark Lescroart,
Thank you very much for your prompt reply. I've read through your answer and tried to follow your instruction last whole day, but no success..
Mind If I ask you more specifically about visualizing process? Hope I'm not bothering you too much. Basically, I am trying to visualize group-level results image (SPM8 obtained, normalized to MNI coordinates) on a standard/normalized surface volume through Pycortex.
1. Input file : As my one single SPM8 result file (RFX image, obtained through group level analysis, and this file is normalized into MNI coordinates) is Analyze format, so I converted it to .nii file and then again gzip. So, the RFX file that I want to visualize is now 'HITvsCR.nii.gz'. I am doing correctly?
2. Align : As the RFX file is statistical volume (since it's normalized), you mean that I can't just align it to the surface volume? : Should I install FSL toolbox separately to run an align module?
3. Overlay : Again, I'm using a normalized statistical volume (RFX), Can't I just overlay on normalized surface volume? (Since I'm trying to visualize group-level results, not 1st-level) What I think is that If there is a standard surface volume, I can just simply align my RFX file into surface volume
4. cx.align.automatic : Sorry, but how can I look at the help for this command?
I know I'm asking you too much, but could you kindly please write some example codes so that I can follow them step by step? (like.. getting a *.hdf file for visualization using HITvsCR.nii.gz file)
Once again, thank you for your reply in advance and hope I can learn more about Pycortex so that our lab members can utilize this awesome software for future publications.
Best,
Yoonjin
Hi Yoonjin,
We appreciate your interest and enthusiasm, but I'm afraid your questions are beyond the scope of what we have time to get into in this forum. Please check in from time to time to look for more general tutorial material (we hope to make more teaching-oriented tutorials this summer).
Good luck!