Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Nomi, Jason

When I do the third step, I now get the error:


ERROR: roi column is empty




The first command:

wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume AMYGDALA_LEFT 
output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz

The second command:

wb_command -cifti-create-dense-from-template 30_min.dtseries.nii 
roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz

The third command:

wb_command -cifti-stats 30_min.dtseries.nii -reduce MEAN -roi 
roi_left_amygdala.dscalar.nii




Thanks for your patience on this Tim -




From: Timothy Coalson 
Sent: Tuesday, September 1, 2015 8:12 PM
To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

That is a bug in -cifti-create-dense-from-template we hadn't caught, sorry.  To 
work around it, you can remove the -crop option from the -cifti-separate 
command (warning, may use a lot of memory, you could take only the first frame 
with -cifti-merge before doing -cifti-separate, as for this method you don't 
need the data volume output), and then use the -volume-all option to 
-cifti-create-dense-from-template instead of the -volume option, like so:

#get the roi in the full volume space
wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN -volume 
AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz

#turn the ROI into cifti
wb_command -cifti-create-dense-from-template 
tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii -volume-all 
roi_left_amygdala.nii.gz

#stats prints a number per column to standard output
wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN -roi 
roi_left_amygdala.dscalar.nii

Tim


On Tue, Sep 1, 2015 at 9:57 AM, Nomi, Jason 
> wrote:

Hi Tim,


When doing the second step (turn the ROI into cifti), I get the following error:


ERROR: input volume doesn't match volume space and dimensions in CIFTI




The code I am using for the first step:

wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume AMYGDALA_LEFT 
output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz -crop

The code I am using for the second step:

wb_command -cifti-create-dense-from-template 30_min.dtseries.nii 
roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz 
-from-cropped


Any advice on what is happening?

Jason





From: Timothy Coalson >
Sent: Monday, August 31, 2015 9:12 PM

To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

That file contains all the voxels of the structure, plus zero voxels out to the 
bounding box of the structure, so you probably also need the ROI volume to get 
it to do the right thing.  I'm not all that familiar with fsl tools.

The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in the 
first step.  The roi_left_amygdala.dscalar.nii file is written out by the 
second step, for use in the third step.

Tim


On Mon, Aug 31, 2015 at 7:07 PM, Nomi, Jason 
> wrote:

Thank you for the quick reply Tim!


I was wondering if I could simplify things by applying the fsl command 
"fslmeants" to the output from the first step, on the 
"output_left_amygdala.nii.gz" file?  That should get me the mean of all the 
voxels included in that file right?  If that file contains only the voxels of 
the left amygdala, then I figure that would get me the averaged time series.


If that is not possible, I am unclear where the file in the second step, 
"tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii", comes from.


Thanks for the help -


Jason



From: Timothy Coalson >
Sent: Monday, August 31, 2015 6:45 PM
To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

-cifti-separate can't do any averaging, that isn't its purpose.  Instead, you 
can use -cifti-stats and the roi of the amygdala to do such an average:

#what you already did, for the purpose of getting the ROI
wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN -volume 
AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz -crop

#turn the ROI into cifti
wb_command -cifti-create-dense-from-template 
tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii -volume 
AMYGDALA_LEFT roi_left_amygdala.nii.gz -from-cropped

#stats prints a number per column to standard output
wb_command -cifti-stats 

Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Nomi, Jason
That was the problem - sorry about that. I have extracted the mean time series 
for the left amygdala now.


Thanks so much for the help!



I have one final question:


I assume that this ROI is from the freesurfer subcortical segmentation?







From: Timothy Coalson 
Sent: Tuesday, September 1, 2015 9:20 PM
To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

Your second command is different than the one I posted - specifically, the 
-volume option to -cifti-create-dense-from-template has a bug in v1.1 and 
v1.1.1, which causes it to do the wrong thing even when it doesn't error, use 
-volume-all instead (which does not take a structure name).

Tim


On Tue, Sep 1, 2015 at 7:08 PM, Nomi, Jason 
> wrote:


When I do the third step, I now get the error:


ERROR: roi column is empty




The first command:

wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume AMYGDALA_LEFT 
output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz

The second command:

wb_command -cifti-create-dense-from-template 30_min.dtseries.nii 
roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz

The third command:

wb_command -cifti-stats 30_min.dtseries.nii -reduce MEAN -roi 
roi_left_amygdala.dscalar.nii




Thanks for your patience on this Tim -




From: Timothy Coalson >
Sent: Tuesday, September 1, 2015 8:12 PM

To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

That is a bug in -cifti-create-dense-from-template we hadn't caught, sorry.  To 
work around it, you can remove the -crop option from the -cifti-separate 
command (warning, may use a lot of memory, you could take only the first frame 
with -cifti-merge before doing -cifti-separate, as for this method you don't 
need the data volume output), and then use the -volume-all option to 
-cifti-create-dense-from-template instead of the -volume option, like so:

#get the roi in the full volume space
wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN -volume 
AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz

#turn the ROI into cifti
wb_command -cifti-create-dense-from-template 
tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii -volume-all 
roi_left_amygdala.nii.gz

#stats prints a number per column to standard output
wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN -roi 
roi_left_amygdala.dscalar.nii

Tim


On Tue, Sep 1, 2015 at 9:57 AM, Nomi, Jason 
> wrote:

Hi Tim,


When doing the second step (turn the ROI into cifti), I get the following error:


ERROR: input volume doesn't match volume space and dimensions in CIFTI




The code I am using for the first step:

wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume AMYGDALA_LEFT 
output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz -crop

The code I am using for the second step:

wb_command -cifti-create-dense-from-template 30_min.dtseries.nii 
roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz 
-from-cropped


Any advice on what is happening?

Jason





From: Timothy Coalson >
Sent: Monday, August 31, 2015 9:12 PM

To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

That file contains all the voxels of the structure, plus zero voxels out to the 
bounding box of the structure, so you probably also need the ROI volume to get 
it to do the right thing.  I'm not all that familiar with fsl tools.

The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in the 
first step.  The roi_left_amygdala.dscalar.nii file is written out by the 
second step, for use in the third step.

Tim


On Mon, Aug 31, 2015 at 7:07 PM, Nomi, Jason 
> wrote:

Thank you for the quick reply Tim!


I was wondering if I could simplify things by applying the fsl command 
"fslmeants" to the output from the first step, on the 
"output_left_amygdala.nii.gz" file?  That should get me the mean of all the 
voxels included in that file right?  If that file contains only the voxels of 
the left amygdala, then I figure that would get me the averaged time series.


If that is not possible, I am unclear where the file in the second step, 
"tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii", comes from.


Thanks for the help -


Jason



Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Timothy Coalson
I believe that was part of the process, however in order to get a standard
set of grayordinates across subjects, many subjects' segmentations were
combined to make an atlas parcellation.  The minimal preprocessing
pipelines paper has some related information, but I'm not sure it covers
how the atlas parcel definitions was generated:

http://www.ncbi.nlm.nih.gov/pubmed/23668970

Tim


On Tue, Sep 1, 2015 at 7:31 PM, Nomi, Jason  wrote:

> That was the problem - sorry about that. I have extracted the mean time
> series for the left amygdala now.
>
>
> Thanks so much for the help!
>
>
>
> I have one final question:
>
>
> I assume that this ROI is from the freesurfer subcortical segmentation?
>
>
>
>
>
>
>
> --
> *From:* Timothy Coalson 
> *Sent:* Tuesday, September 1, 2015 9:20 PM
>
> *To:* Nomi, Jason
> *Cc:* hcp-users@humanconnectome.org
> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
> series for subcortical structures from cifti file
>
> Your second command is different than the one I posted - specifically, the
> -volume option to -cifti-create-dense-from-template has a bug in v1.1 and
> v1.1.1, which causes it to do the wrong thing even when it doesn't error,
> use -volume-all instead (which does not take a structure name).
>
> Tim
>
>
> On Tue, Sep 1, 2015 at 7:08 PM, Nomi, Jason  wrote:
>
>>
>> When I do the third step, I now get the error:
>>
>>
>> ERROR: roi column is empty
>>
>>
>>
>>
>> The first command:
>>
>> wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume
>> AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz
>>
>> The second command:
>>
>> wb_command -cifti-create-dense-from-template 30_min.dtseries.nii
>> roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz
>>
>> The third command:
>>
>> wb_command -cifti-stats 30_min.dtseries.nii -reduce MEAN -roi
>> roi_left_amygdala.dscalar.nii
>>
>>
>>
>>
>> Thanks for your patience on this Tim -
>>
>>
>>
>> --
>> *From:* Timothy Coalson 
>> *Sent:* Tuesday, September 1, 2015 8:12 PM
>>
>> *To:* Nomi, Jason
>> *Cc:* hcp-users@humanconnectome.org
>> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
>> series for subcortical structures from cifti file
>>
>> That is a bug in -cifti-create-dense-from-template we hadn't caught,
>> sorry.  To work around it, you can remove the -crop option from the
>> -cifti-separate command (warning, may use a lot of memory, you could take
>> only the first frame with -cifti-merge before doing -cifti-separate, as for
>> this method you don't need the data volume output), and then use the
>> -volume-all option to -cifti-create-dense-from-template instead of the
>> -volume option, like so:
>>
>> #get the roi in the full volume space
>> wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN
>> -volume AMYGDALA_LEFT output_left_amygdala.nii.gz -roi
>> roi_left_amygdala.nii.gz
>>
>> #turn the ROI into cifti
>> wb_command
>> -cifti-create-dense-from-template tfMRI_EMOTION_LR_Atlas.dtseries.nii
>> roi_left_amygdala.dscalar.nii -volume-all roi_left_amygdala.nii.gz
>>
>> #stats prints a number per column to standard output
>> wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN
>> -roi roi_left_amygdala.dscalar.nii
>>
>> Tim
>>
>>
>> On Tue, Sep 1, 2015 at 9:57 AM, Nomi, Jason  wrote:
>>
>>> Hi Tim,
>>>
>>>
>>> When doing the second step (turn the ROI into cifti), I get the
>>> following error:
>>>
>>>
>>> ERROR: input volume doesn't match volume space and dimensions in CIFTI
>>>
>>>
>>>
>>>
>>> The code I am using for the first step:
>>>
>>> wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume
>>> AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz
>>> -crop
>>>
>>> The code I am using for the second step:
>>>
>>> wb_command -cifti-create-dense-from-template 30_min.dtseries.nii
>>> roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT
>>> roi_left_amygdala.nii.gz -from-cropped
>>>
>>>
>>>
>>> Any advice on what is happening?
>>>
>>> Jason
>>>
>>>
>>>
>>>
>>> --
>>> *From:* Timothy Coalson 
>>> *Sent:* Monday, August 31, 2015 9:12 PM
>>>
>>> *To:* Nomi, Jason
>>> *Cc:* hcp-users@humanconnectome.org
>>> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
>>> series for subcortical structures from cifti file
>>>
>>> That file contains all the voxels of the structure, plus zero voxels out
>>> to the bounding box of the structure, so you probably also need the ROI
>>> volume to get it to do the right thing.  I'm not all that familiar with fsl
>>> tools.
>>>
>>> The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in
>>> the first step.  The roi_left_amygdala.dscalar.nii file is written out by
>>> the second step, for use in the third step.
>>>
>>> Tim
>>>
>>>

Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Timothy Coalson
Your second command is different than the one I posted - specifically, the
-volume option to -cifti-create-dense-from-template has a bug in v1.1 and
v1.1.1, which causes it to do the wrong thing even when it doesn't error,
use -volume-all instead (which does not take a structure name).

Tim


On Tue, Sep 1, 2015 at 7:08 PM, Nomi, Jason  wrote:

>
> When I do the third step, I now get the error:
>
>
> ERROR: roi column is empty
>
>
>
>
> The first command:
>
> wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume
> AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz
>
> The second command:
>
> wb_command -cifti-create-dense-from-template 30_min.dtseries.nii
> roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz
>
> The third command:
>
> wb_command -cifti-stats 30_min.dtseries.nii -reduce MEAN -roi
> roi_left_amygdala.dscalar.nii
>
>
>
>
> Thanks for your patience on this Tim -
>
>
>
> --
> *From:* Timothy Coalson 
> *Sent:* Tuesday, September 1, 2015 8:12 PM
>
> *To:* Nomi, Jason
> *Cc:* hcp-users@humanconnectome.org
> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
> series for subcortical structures from cifti file
>
> That is a bug in -cifti-create-dense-from-template we hadn't caught,
> sorry.  To work around it, you can remove the -crop option from the
> -cifti-separate command (warning, may use a lot of memory, you could take
> only the first frame with -cifti-merge before doing -cifti-separate, as for
> this method you don't need the data volume output), and then use the
> -volume-all option to -cifti-create-dense-from-template instead of the
> -volume option, like so:
>
> #get the roi in the full volume space
> wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN
> -volume AMYGDALA_LEFT output_left_amygdala.nii.gz -roi
> roi_left_amygdala.nii.gz
>
> #turn the ROI into cifti
> wb_command
> -cifti-create-dense-from-template tfMRI_EMOTION_LR_Atlas.dtseries.nii
> roi_left_amygdala.dscalar.nii -volume-all roi_left_amygdala.nii.gz
>
> #stats prints a number per column to standard output
> wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN
> -roi roi_left_amygdala.dscalar.nii
>
> Tim
>
>
> On Tue, Sep 1, 2015 at 9:57 AM, Nomi, Jason  wrote:
>
>> Hi Tim,
>>
>>
>> When doing the second step (turn the ROI into cifti), I get the following
>> error:
>>
>>
>> ERROR: input volume doesn't match volume space and dimensions in CIFTI
>>
>>
>>
>>
>> The code I am using for the first step:
>>
>> wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume
>> AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz
>> -crop
>>
>> The code I am using for the second step:
>>
>> wb_command -cifti-create-dense-from-template 30_min.dtseries.nii
>> roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT
>> roi_left_amygdala.nii.gz -from-cropped
>>
>>
>>
>> Any advice on what is happening?
>>
>> Jason
>>
>>
>>
>>
>> --
>> *From:* Timothy Coalson 
>> *Sent:* Monday, August 31, 2015 9:12 PM
>>
>> *To:* Nomi, Jason
>> *Cc:* hcp-users@humanconnectome.org
>> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
>> series for subcortical structures from cifti file
>>
>> That file contains all the voxels of the structure, plus zero voxels out
>> to the bounding box of the structure, so you probably also need the ROI
>> volume to get it to do the right thing.  I'm not all that familiar with fsl
>> tools.
>>
>> The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in
>> the first step.  The roi_left_amygdala.dscalar.nii file is written out by
>> the second step, for use in the third step.
>>
>> Tim
>>
>>
>> On Mon, Aug 31, 2015 at 7:07 PM, Nomi, Jason  wrote:
>>
>>> Thank you for the quick reply Tim!
>>>
>>>
>>> I was wondering if I could simplify things by applying the fsl
>>> command "fslmeants" to the output from the first step, on the
>>> "output_left_amygdala.nii.gz" file?  That should get me the mean of all the
>>> voxels included in that file right?  If that file contains only the voxels
>>> of the left amygdala, then I figure that would get me the averaged time
>>> series.
>>>
>>>
>>> If that is not possible, I am unclear where the file in the second step,
>>> "tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii",
>>> comes from.
>>>
>>>
>>> Thanks for the help -
>>>
>>>
>>> Jason
>>>
>>>
>>> --
>>> *From:* Timothy Coalson 
>>> *Sent:* Monday, August 31, 2015 6:45 PM
>>> *To:* Nomi, Jason
>>> *Cc:* hcp-users@humanconnectome.org
>>> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
>>> series for subcortical structures from cifti file
>>>
>>> -cifti-separate can't do any averaging, that isn't its purpose.
>>> Instead, you can use -cifti-stats and the roi 

Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Timothy Coalson
That is a bug in -cifti-create-dense-from-template we hadn't caught,
sorry.  To work around it, you can remove the -crop option from the
-cifti-separate command (warning, may use a lot of memory, you could take
only the first frame with -cifti-merge before doing -cifti-separate, as for
this method you don't need the data volume output), and then use the
-volume-all option to -cifti-create-dense-from-template instead of the
-volume option, like so:

#get the roi in the full volume space
wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN
-volume AMYGDALA_LEFT output_left_amygdala.nii.gz -roi
roi_left_amygdala.nii.gz

#turn the ROI into cifti
wb_command
-cifti-create-dense-from-template tfMRI_EMOTION_LR_Atlas.dtseries.nii
roi_left_amygdala.dscalar.nii -volume-all roi_left_amygdala.nii.gz

#stats prints a number per column to standard output
wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN
-roi roi_left_amygdala.dscalar.nii

Tim


On Tue, Sep 1, 2015 at 9:57 AM, Nomi, Jason  wrote:

> Hi Tim,
>
>
> When doing the second step (turn the ROI into cifti), I get the following
> error:
>
>
> ERROR: input volume doesn't match volume space and dimensions in CIFTI
>
>
>
>
> The code I am using for the first step:
>
> wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume
> AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz
> -crop
>
> The code I am using for the second step:
>
> wb_command -cifti-create-dense-from-template 30_min.dtseries.nii
> roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT
> roi_left_amygdala.nii.gz -from-cropped
>
>
>
> Any advice on what is happening?
>
> Jason
>
>
>
>
> --
> *From:* Timothy Coalson 
> *Sent:* Monday, August 31, 2015 9:12 PM
>
> *To:* Nomi, Jason
> *Cc:* hcp-users@humanconnectome.org
> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
> series for subcortical structures from cifti file
>
> That file contains all the voxels of the structure, plus zero voxels out
> to the bounding box of the structure, so you probably also need the ROI
> volume to get it to do the right thing.  I'm not all that familiar with fsl
> tools.
>
> The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in
> the first step.  The roi_left_amygdala.dscalar.nii file is written out by
> the second step, for use in the third step.
>
> Tim
>
>
> On Mon, Aug 31, 2015 at 7:07 PM, Nomi, Jason  wrote:
>
>> Thank you for the quick reply Tim!
>>
>>
>> I was wondering if I could simplify things by applying the fsl
>> command "fslmeants" to the output from the first step, on the
>> "output_left_amygdala.nii.gz" file?  That should get me the mean of all the
>> voxels included in that file right?  If that file contains only the voxels
>> of the left amygdala, then I figure that would get me the averaged time
>> series.
>>
>>
>> If that is not possible, I am unclear where the file in the second step, 
>> "tfMRI_EMOTION_LR_Atlas.dtseries.nii
>> roi_left_amygdala.dscalar.nii", comes from.
>>
>>
>> Thanks for the help -
>>
>>
>> Jason
>>
>>
>> --
>> *From:* Timothy Coalson 
>> *Sent:* Monday, August 31, 2015 6:45 PM
>> *To:* Nomi, Jason
>> *Cc:* hcp-users@humanconnectome.org
>> *Subject:* Re: [HCP-Users] Acquire text file with averaged volume time
>> series for subcortical structures from cifti file
>>
>> -cifti-separate can't do any averaging, that isn't its purpose.  Instead,
>> you can use -cifti-stats and the roi of the amygdala to do such an average:
>>
>> #what you already did, for the purpose of getting the ROI
>> wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN
>> -volume AMYGDALA_LEFT output_left_amygdala.nii.gz -roi
>> roi_left_amygdala.nii.gz -crop
>>
>> #turn the ROI into cifti
>> wb_command
>> -cifti-create-dense-from-template tfMRI_EMOTION_LR_Atlas.dtseries.nii
>> roi_left_amygdala.dscalar.nii
>> -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz -from-cropped
>>
>> #stats prints a number per column to standard output
>> wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN
>> -roi roi_left_amygdala.dscalar.nii
>>
>> If you were using a surface structure, you should use
>> -cifti-weighted-stats instead as the last step with -spatial-weights to
>> account for differences in vertex area.
>>
>> Tim
>>
>>
>> On Mon, Aug 31, 2015 at 1:33 PM, Nomi, Jason  wrote:
>>
>>> Dear Experts,
>>>
>>>
>>> I am trying to acquire the averaged volume time series for subcortical
>>> structures in text file form.
>>>
>>>
>>> From this post
>>> http://www.mail-archive.com/hcp-users@humanconnectome.org/msg01184.html
>>> 

Re: [HCP-Users] Acquire text file with averaged volume time series for subcortical structures from cifti file

2015-09-01 Thread Nomi, Jason
Hi Tim,


When doing the second step (turn the ROI into cifti), I get the following error:


ERROR: input volume doesn't match volume space and dimensions in CIFTI




The code I am using for the first step:

wb_command -cifti-separate 30_min.dtseries.nii COLUMN -volume AMYGDALA_LEFT 
output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz -crop

The code I am using for the second step:

wb_command -cifti-create-dense-from-template 30_min.dtseries.nii 
roi_left_amygdala.dscalar.nii -volume AMYGDALA_LEFT roi_left_amygdala.nii.gz 
-from-cropped


Any advice on what is happening?

Jason





From: Timothy Coalson 
Sent: Monday, August 31, 2015 9:12 PM
To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

That file contains all the voxels of the structure, plus zero voxels out to the 
bounding box of the structure, so you probably also need the ROI volume to get 
it to do the right thing.  I'm not all that familiar with fsl tools.

The tfMRI_EMOTION_LR_Atlas.dtseries.nii file is the same as the input in the 
first step.  The roi_left_amygdala.dscalar.nii file is written out by the 
second step, for use in the third step.

Tim


On Mon, Aug 31, 2015 at 7:07 PM, Nomi, Jason 
> wrote:

Thank you for the quick reply Tim!


I was wondering if I could simplify things by applying the fsl command 
"fslmeants" to the output from the first step, on the 
"output_left_amygdala.nii.gz" file?  That should get me the mean of all the 
voxels included in that file right?  If that file contains only the voxels of 
the left amygdala, then I figure that would get me the averaged time series.


If that is not possible, I am unclear where the file in the second step, 
"tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii", comes from.


Thanks for the help -


Jason



From: Timothy Coalson >
Sent: Monday, August 31, 2015 6:45 PM
To: Nomi, Jason
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] Acquire text file with averaged volume time series for 
subcortical structures from cifti file

-cifti-separate can't do any averaging, that isn't its purpose.  Instead, you 
can use -cifti-stats and the roi of the amygdala to do such an average:

#what you already did, for the purpose of getting the ROI
wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN -volume 
AMYGDALA_LEFT output_left_amygdala.nii.gz -roi roi_left_amygdala.nii.gz -crop

#turn the ROI into cifti
wb_command -cifti-create-dense-from-template 
tfMRI_EMOTION_LR_Atlas.dtseries.nii roi_left_amygdala.dscalar.nii -volume 
AMYGDALA_LEFT roi_left_amygdala.nii.gz -from-cropped

#stats prints a number per column to standard output
wb_command -cifti-stats tfMRI_EMOTION_LR_Atlas.dtseries.nii -reduce MEAN -roi 
roi_left_amygdala.dscalar.nii

If you were using a surface structure, you should use -cifti-weighted-stats 
instead as the last step with -spatial-weights to account for differences in 
vertex area.

Tim


On Mon, Aug 31, 2015 at 1:33 PM, Nomi, Jason 
> wrote:

Dear Experts,


I am trying to acquire the averaged volume time series for subcortical 
structures in text file form.


>From this post 
>http://www.mail-archive.com/hcp-users@humanconnectome.org/msg01184.html
> , I assume that doing these commands :


wb_command -cifti-separate tfMRI_EMOTION_LR_Atlas.dtseries.nii COLUMN
-volume AMYGDALA_LEFT output_left_amygdala.nii.gz -roi
roi_left_amygdala.nii.gz -crop


gives me a nifti file with *all* the voxels from the left amygdala 
(output_left_amygdala.nii.gz).


Is there a way to get the *averaged* time series for all left amygdala voxels 
into a nifti file using the -cifti-separate command?


If so, I suppose that I could then use the -nifti-information command to 
extract the time series from that averaged nifti file into a text file.


Or, is there another way that I should do this?


Thanks in advance!


Jason





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



___
HCP-Users 

Re: [HCP-Users] TOPUP options with HCP scripts - Phase Encoding and Voxel Size incompatibilty with EPI

2015-09-01 Thread Harms, Michael








Hi Michael,

Thinking about this a little more, the differing phase encoding direction between your SE and BOLD fMRI is going to definitely be a problem, since the pipeline only has a parameter for a single "unwarp" direction.  But, it would need separate UnwarpDir variables
 for your situation, since you would need to specify one direction for your SE acquisitions, and another for the fMRI scans.  What I'm not entirely sure about is where exactly the direction comes into play for the fMRI scans, since UnwarpDir is not an input
 parameter per se to OneStepResampling.sh.   My guess is that the WarpField representation that comes out of 'topup' is only appropriate for correcting the fMRI scans if the fMRI scans have an UnwarpDir that is consistent with the SE scans.



In your case, I think the pipeline would have to be modified to make use of the option in 'topup' (--fout) to output the field (in Hz or rad/s) representation instead -- note
 that there are already input arguments in TopupPreprocessingAll.sh (--ofmap*) for outputting the field in rad/sec and a magnitude and brain-extracted magnitude image.  With those outputs from 'topup' in hand, you could
 then apply those to the fMRI scan in the same manner as what gets done with a traditional gradient echo field map.
 You could use the code related to the traditional gradient echo processing in DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh as a template
 for what would need to be done once you have the field-based representation from 'topup'.    You would need to supply a separate UnwarpDir for each of these different stages. 


So, in principle, the pipeline could be modified to handle your situation, but you would have to delve into some relatively low-level code to make it happen.




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: , Michael 
Date: Monday, August 31, 2015 3:16 PM
To: "Harms, Michael" , Stephen Smith 
Cc: "hcp-users@humanconnectome.org" 
Subject: RE: [HCP-Users] TOPUP options with HCP scripts - Phase Encoding and Voxel Size incompatibilty with EPI








Thanks Michael,
 
I will look into all of these over the next few days... Neither the first or second thing you suggested to check in the HCP scripts would’ve occurred to me.  So those suggestions are greatly appreciated.  The
 possibility that the HCP scripts somehow in their function assumes the phase encoding is the same sounds really possible.  I didn’t try to see if the listserv could post *.jpgs of the results I’m getting.  But honestly, the funky result really looks like a
 fundamental mismatch of phase encoding setting.  However, I know I’ve got things set correctly for the EPI data phase encoding direction.  If the scripts are somehow doing the topup and applytop steps assuming both have the same phase encoding, that’d easily
 account for the wonky results.  So I’ll go digging for that first.
 
I’ll paste the code splice in for the spatial resolution problem and let you know if I have any problems.
 
Thanks again!

Best,
Mike
 


From: Harms, Michael [mailto:mha...@wustl.edu]

Sent: Monday, August 31, 2015 3:40 PM
To: Stephen Smith; Stevens, Michael
Cc: hcp-users@humanconnectome.org
Subject: Re: [HCP-Users] TOPUP options with HCP scripts - Phase Encoding and Voxel Size incompatibilty with EPI


 


 


Hi Michael,


I know of at least one adaptation that you'll need, but your particular situation may unfortunately need more.   Tthe issues at play involve a fairly complicated, dense section of code.  Hopefully
 Matt can chime in if he is available.


 


Your question involves the guts of the DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
 and TopupPreprocessingAll.sh scripts.  (The latter is called as part of the former).  The relevant variables to try to keep
 track of initially are: DwellTime (--echospacing
 argument) and UnwarpDir.


 


First, your changing resolution probably resulted in a least a somewhat different bandwidth, and thus echo spacing between your SpinEcho EPIs and your Gradient Echo BOLD fMRI scans.  Based on a
 quick look, I can't tell if the echo spacing of the BOLD fMRI scan ever comes into the picture as part of the topup distortion correction.  If not, just set the ES according to your SE scans.


 


Second, you had a different phase encoding direction between the SE scans and the BOLD fMRI.  That I think is a problem, because I think that TopupPreprocessingAll.sh
assumes that the supplied 
UnwarpDir is the same for both the SE scans and the BOLD fMRI -- in terms of the registration between scout and SE scans, and also