You may be running into an unfortunate design problem in CIFTI-1, if
NiBabel expects them to be standard NIfTI-2 - the dimensions are backwards
in the header, so non-square matrices will have their elements rearranged.
You may be able to get matlab to fix them via a reshape with the dimensions
swapped.  Alternatively, you can use wb_command -cifti-convert
-to-gifti-ext to get them into a file that should read correctly per the
GIFTI standard (and the matlab gifti toolbox).

CIFTI-2 will fix this problem, but hasn't been finalized yet (it is
currently open for comments, see
http://www.nitrc.org/forum/message.php?msg_id=9303).

Tim



On Mon, Jan 20, 2014 at 11:13 AM, Jason Bohland <jbohl...@bu.edu> wrote:

> Hi.  I've been working on putting together some ROI-level correlation
> matrices from individual HCP data.  I'm trying to use the wb_command
> -cifti-parcellate to give me region level time series.  I have been a bit
> surprised by the results of this operation, and I wanted to verify that
> what I'm seeing is correct, and ask a few questions.  I appreciate any
> guidance.  I'll use subject 100307 as an example.
>
> 1) To get out cortical surface ROI time series, I started with the
> following:
>
> wb_command -cifti-parcellate
> rfMRI_REST1_LR_Atlas_hp2000_clean.dtseries.nii
> ../../fsaverage_LR32k/100307.aparc.a2009s.32k_fs_LR.dlabel.nii COLUMN
> 100307.cortical.ptseries.nii
>
> 2) To get out subcortical ROI time series, I used:
>
> wb_command -cifti-create-label subcortical_label.nii -volume
> ../../ROIs/Atlas_ROIs.2.nii.gz ../../ROIs/Atlas_ROIs.2.nii.gz
>
> wb_command -cifti-parcellate
> rfMRI_REST1_LR_Atlas_hp2000_clean.dtseries.nii subcortical_label.nii COLUMN
> 100307.subcortical.ptseries.nii
>
> 3) Then I use Python with NiBabel ('1.4.0dev') to read and examine the
> resulting matrices:
>
> ipython --pylab
>
> import nibabel as nb
>
> subcortical =
> squeeze(nb.load('100307.subcortical.ptseries.nii').get_data())
>
> subcortical.shape
> Out[7]: (19, 1200)
>
> cortical = squeeze(nb.load('100307.cortical.ptseries.nii').get_data())
>
> cortical.shape
> Out[11]: (75, 1200)
>
> plot(subcortical.T)
> hold(True)
> plot(cortical.T)
> xlabel('Scans')
>
> *** The resulting plot is attached ***
>
> Note the step-wise form of the curves, which does not appear correct (and
> does not correspond well to the global mean in the dtseries file),
> especially since the subcortical and cortical ROI curves are quite
> different.  In fact, it appears that the "number of steps" may equal the
> number of ROIs (19 vs. 75) in each family of curves?  This makes me think
> that either nibabel is improperly loading the ptseries data, or
> cifti-parcellate is not functioning correctly, but I haven't been able to
> determine which is true.
>
> Is it possible to examine the data from the ptseries files any other way?
> I tried -nifti-information -display-matrix but I get a message saying this
> is not supported.  I don't know of any other way to read in the ptseries
> data.
>
> >>wb_command -nifti-information 100307.subcortical.ptseries.nii
> -print-matrix
> Printing Matrix/Volume information is only supported for Cifti.
>
>
> As an additional question, assuming I'm going about this in a reasonable
> way, and that I can find a way to read or export the resulting data, can I
> assume that the ordering of the ROIs in the NIFTI/CIFTI matrix rows follows
> the numerical ordering of the ids from FreeSurfer?
>
> Many thanks for your help,
> -Jay
>
>
>
>
> _______________________________________________
> HCP-Users mailing list
> HCP-Users@humanconnectome.org
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>

_______________________________________________
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

Reply via email to