As a further comment, you mentioned way back in the thread that you wanted to get average time courses for parcels. Have you looked at wb_command -cifti-parcellate, as I suggested?
Tim On Wed, Aug 24, 2016 at 11:08 AM, Glasser, Matthew <glass...@wustl.edu> wrote: > If the goal is to analyze the CIFTI file in matlab, there is no need to > used CIFTI separate. > > Peace, > > Matt. > > From: <hcp-users-boun...@humanconnectome.org> on behalf of "Harms, > Michael" <mha...@wustl.edu> > Date: Wednesday, August 24, 2016 at 11:04 AM > To: Ferdaus Kawsar <ferdaus.kaw...@gmail.com>, Timothy Coalson < > tsc...@mst.edu> > > Cc: "hcp-users@humanconnectome.org" <HCP-Users@humanconnectome.org> > Subject: Re: [HCP-Users] Extract average time-course from cortical parcels > > > A .nii or .nii.gz is not a CIFTI file (it is a NIFTI file), and > consequently ciftiopen doesn’t work with it. > > If you want to load a NIFTI file in matlab, there are a number of tools > out there, including load_nifti.m that comes with FreeSurfer, and > read_avw.m that comes with FSL. I’m sure there are other dedicated NIFTI > matlab readers as well. > > cheers, > -MH > > -- > Michael Harms, Ph.D. > ----------------------------------------------------------- > Conte Center for the Neuroscience of Mental Disorders > Washington University School of Medicine > Department of Psychiatry, Box 8134 > 660 South Euclid Ave. Tel: 314-747-6173 > St. Louis, MO 63110 Email: mha...@wustl.edu > > From: <hcp-users-boun...@humanconnectome.org> on behalf of Ferdaus Kawsar > <ferdaus.kaw...@gmail.com> > Date: Wednesday, August 24, 2016 at 10:46 AM > To: Timothy Coalson <tsc...@mst.edu> > Cc: "hcp-users@humanconnectome.org" <HCP-Users@humanconnectome.org> > Subject: Re: [HCP-Users] Extract average time-course from cortical parcels > > Hi Tim, > I used -cifti-separate and created the files. However, even > though I can load the data in Matlab for left_data.func.gii and > right_data.func.gii, > I cannot load the volume files in Matlab. I could not load out_vol.nii.gz > and out_vol_structs.nii.gz , files in matlab.(I unzipped them first) I > tried both ft_read_cifti and ciftiopen and none of them works. > > They can both be viewed by workbench. > > Here is the error message I see when I use ciftiopen to load out_vol.nii > > out_vol_cft_open=ciftiopen('/home/fkawsar/HCP_Data/ > Experimental/MNI3.17/out_vol.nii','/home/fkawsar/Downloads/ > workbench/exe_linux64/wb_command'); > > While running: > /home/fkawsar/Downloads/workbench/exe_linux64/wb_command -cifti-convert > -to-gifti-ext /home/fkawsar/HCP_Data/Experimental/MNI3.17/out_vol.nii > /tmp/tp5ece90ba_3f9e_4d81_aec6_2b19c0f950c2.gii > > ERROR: no cifti extension found in file '/home/fkawsar/HCP_Data/ > Experimental/MNI3.17/out_vol.nii' > > /home/fkawsar/Downloads/workbench/exe_linux64/wb_command -cifti-convert > -to-gifti-ext /home/fkawsar/HCP_Data/Experimental/MNI3.17/out_vol.nii > /tmp/tp5ece90ba_3f9e_4d81_aec6_2b19c0f950c2.gii: Signal 127 > Error using read_gifti_file_standalone (line 20) > [GIFTI] Loading of XML file /tmp/tp5ece90ba_3f9e_4d81_aec6_2b19c0f950c2.gii > failed. > > Error in gifti (line 71) > this = read_gifti_file_standalone( > varargin{1},giftistruct); > > Error in ciftiopen (line 31) > cifti = gifti([tmpfile '.gii']); > > Hope you can help. > > Best, > -Ferdaus > > > On Thu, Aug 11, 2016 at 5:39 PM, Timothy Coalson <tsc...@mst.edu> wrote: > >> -cifti-separate creates nifti and gift files from parts of the cifti >> file. That output is a volume file, and should have been named ending in >> .nii.gz, such that it would be compressed on-disk. However, I would not >> recommend doing it this way for all subcortical structures, as that is a >> lot of volume files, all of which will have the full original FOV from the >> volume preprocessing output. >> >> If the only thing you want to do with them is average them into per-area >> timeseries, I suggest you try -cifti-parcellate before anything else. You >> may need to first make a dlabel file that combines your chosen surface and >> subcortical parcellations. >> >> If you want all the individual timeseries separately, then you might try >> the -volume-all option of -cifti-separate, and possibly the -crop options, >> as well as the -roi options to tell you which voxels have data in them. >> The -metric option will get you the surface data. Note that you can >> specify these options simultaneously to a single command: >> >> wb_command -cifti-separate <input> COLUMN -volume-all out_vol.nii.gz >> -crop -label out_vol_structs.nii.gz -metric CORTEX_LEFT left_data.func.gii >> -roi left_roi.func.gii -metric CORTEX_RIGHT right_data.func.gii -roi >> right_roi.func.gii >> >> Tim >> >> >> On Thu, Aug 11, 2016 at 3:35 PM, Ferdaus Kawsar <ferdaus.kaw...@gmail.com >> > wrote: >> >>> Hi Tim, >>> Thanks for your reply. I used cifti-separate as you suggested >>> to create volumes from *.dtseries.nii file I have. However, I am having >>> difficulty to read the resultant file. Is it a cifti file? I cannot read >>> this file using either ft_read_cifti() or ciftiopen(). Also the file is >>> huge (1.8 GB). How do I extract time-course from this file? >>> >>> I created the file using following command: >>> wb_command -cifti-separate '*.dtseries.nii' COLUMN -volume >>> PUTAMEN_RIGHT 'out_putament_right' >>> >>> >>> Best >>> -Ferdaus >>> >>> On Wed, Aug 10, 2016 at 5:42 PM, Timothy Coalson <tsc...@mst.edu> wrote: >>> >>>> You might want to use "wb_command -cifti-parcellate" to do this for >>>> you, it has some extra options to do things like weighted means according >>>> to vertex area. >>>> >>>> Manually matching things up in matlab from loaded cifti files may be >>>> difficult, as some .dlabel.nii files don't exclude the medial wall, and may >>>> not include the subcortical voxels that the .dtseries.nii files do. You >>>> can use -cifti-separate on cifti files to make simpler single-hemisphere >>>> full-surface gifti files, and a nifti volume file for the subcortical stuff >>>> (though doing this on the timeseries will result in a fairly large volume >>>> file when loaded in memory). >>>> >>>> Tim >>>> >>>> >>>> On Wed, Aug 10, 2016 at 2:48 PM, Ferdaus Kawsar < >>>> ferdaus.kaw...@gmail.com> wrote: >>>> >>>>> Hi HCP Team, >>>>> I was wondering if someone could help regarding a >>>>> task I am trying to do. I need to extract average time-course for both >>>>> cortical and sub-cortical parcels. >>>>> I was able to extract average time-courses for sub-cortical parcels. >>>>> >>>>> After I loaded my *dtseries.nii cifti files (using ft_read_cifti()) in >>>>> matlab, I could access all the time-courses for sub-cortical regions. >>>>> There >>>>> are 19 sub-cortical regions. After I got all the time -courses for a >>>>> sub-cortical region, a simple mean() method in matlab gave me the average >>>>> time-course. I am curious if this approach is right? >>>>> >>>>> Also, how do I get the time-courses for a cortical parcel? My eventual >>>>> goal is to extract average time course for each of 180 parcels in each >>>>> hemisphere. >>>>> >>>>> Best regards, >>>>> -Ferdaus >>>>> -- >>>>> Ferdaus A. Kawsar, PhD >>>>> Research Scientist II >>>>> Department of Neurology >>>>> Medical College of Wisconsin >>>>> Milwaukee, WI >>>>> >>>>> _______________________________________________ >>>>> HCP-Users mailing list >>>>> HCP-Users@humanconnectome.org >>>>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users >>>>> >>>> >>>> >>> >>> >>> -- >>> Ferdaus A. Kawsar, PhD >>> Research Scientist II >>> Department of Neurology >>> Medical College of Wisconsin >>> Milwaukee, WI >>> >> >> > > > -- > Ferdaus A. Kawsar, PhD > Research Scientist II > Department of Neurology > Medical College of Wisconsin > Milwaukee, WI > > _______________________________________________ > HCP-Users mailing list > HCP-Users@humanconnectome.org > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > > > ------------------------------ > > The materials in this message are private and may contain Protected > Healthcare Information or other information of a sensitive nature. If you > are not the intended recipient, be advised that any unauthorized use, > disclosure, copying or the taking of any action in reliance on the contents > of this information is strictly prohibited. If you have received this email > in error, please immediately notify the sender via telephone or return mail. > > _______________________________________________ > HCP-Users mailing list > HCP-Users@humanconnectome.org > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > > > ------------------------------ > > The materials in this message are private and may contain Protected > Healthcare Information or other information of a sensitive nature. If you > are not the intended recipient, be advised that any unauthorized use, > disclosure, copying or the taking of any action in reliance on the contents > of this information is strictly prohibited. If you have received this email > in error, please immediately notify the sender via telephone or return mail. > _______________________________________________ HCP-Users mailing list HCP-Users@humanconnectome.org http://lists.humanconnectome.org/mailman/listinfo/hcp-users