Re: [HCP-Users] White matter mask availability in HCP

2014-12-09 Thread Glasser, Matthew



Great to hear!


Matt.




From: Eleftherios Garyfallidis 
Date: Tuesday, December 9, 2014 at 7:59 PM
To: Matt Glasser 
Cc: "hcp-users@humanconnectome.org" 
Subject: Re: [HCP-Users] White matter mask availability in HCP





Thank you Matthew. 


Your suggestions were very helpful. 

I had to do a few more corrections on selecting the labels for creating whole brain white matter mask from the ribbon.nii.gz and wmparc.nii.gz files.
Here what worked at the end:



    #_WHITE_MATTER_LEFT CEREBRAL_WHITE_MATTER_RIGHT
    ribbon_structures = [2, 41]


    # CEREBELLAR_WHITE_MATTER_LEFT CEREBELLUM_LEFT THALAMUS_LEFT CAUDATE_LEFT PUTAMEN_LEFT PALLIDUM_LEFT BRAIN_STEM HIPPOCAMPUS_LEFT AMYGDALA_LEFT ACCUMBENS_LEFT DIENCEPHALON_VENTRAL_LEFT CEREBELLAR_WHITE_MATTER_RIGHT CEREBELLUM_RIGHT THALAMUS_RIGHT CAUDATE_RIGHT
 PUTAMEN_RIGHT PALLIDUM_RIGHT HIPPOCAMPUS_RIGHT AMYGDALA_RIGHT ACCUMBENS_RIGHT DIENCEPHALON_VENTRAL_RIGHT
    # wmparc_structures = [7, 8, 10, 11, 12, 13, 16, 17, 18, 26, 28, 46, 47, 49, 50, 51, 52, 53, 54, 58, 60]


    # CEREBELLAR_WHITE_MATTER_LEFT CEREBELLAR_WHITE_MATTER_RIGHT BRAIN_STEM
    wmparc_structures = [7, 46, 16]


    #Fornix, CC_Posterior, CC_Mid_Posterior, CC_Central, CC_MidAnterior, CC_Anterior
    wmparc_cc_structures = [250, 251, 252, 253, 254, 255]


    #LeftLateralVentricle, LeftInfLatVent, 3rdVentricle, 4thVentricle, CSF, LeftChoroidPlexus, RightLateralVentricle, RightInfLatVent, RightChoroidPlexus
    wmparc_del_structures = [4, 5, 14, 15, 24, 31, 43, 44, 63]


    #LeftCaudate RightCaudate  
    wmparc_del_structures2 = [11, 50]




Thx again! 
Best regards,
Eleftherios





On Fri, Dec 5, 2014 at 2:54 AM, Glasser, Matthew 
 wrote:


For whitematter/greymatter interface, it sounds like you need a surface (the white matter surface).   This will be much more exact than a volume mask (e.g. if you are doing tractography, you can get quite misleading results if you use masks vs surfaces
 for cortex).  


As for a white matter mask, you can use the ribbon.nii.gz and wmparc.nii.gz files to construct this (indices for ribbon.nii.gz or wmparc.nii.gz are listed below with the appropriate names):




#CORTEX_LEFT CEREBRAL_WHITE_MATTER_LEFT CORTEX_RIGHT CEREBRAL_WHITE_MATTER_RIGHT
RibbonStructures="2 3 41 42"





#CEREBELLAR_WHITE_MATTER_LEFT CEREBELLUM_LEFT THALAMUS_LEFT CAUDATE_LEFT PUTAMEN_LEFT PALLIDUM_LEFT BRAIN_STEM HIPPOCAMPUS_LEFT AMYGDALA_LEFT ACCUMBENS_LEFT DIENCEPHALON_VENTRAL_LEFT CEREBELLAR_WHITE_MATTER_RIGHT CEREBELLUM_RIGHT THALAMUS_RIGHT CAUDATE_RIGHT
 PUTAMEN_RIGHT PALLIDUM_RIGHT HIPPOCAMPUS_RIGHT AMYGDALA_RIGHT ACCUMBENS_RIGHT DIENCEPHALON_VENTRAL_RIGHT
wmparcStructuresToKeepSTRING="7 8 10 11 12 13 16 17 18 26 28 46 47 49 50 51 52 53 54 58 60"




#Fornix, CC_Posterior, CC_Mid_Posterior, CC_Central, CC_MidAnterior, CC_Anterior
CorpusCallosumToAdd="250 251 252 253 254 255”





#LeftLateralVentricle, LeftInfLatVent, 3rdVentricle, 4thVentricle, CSF, LeftChoroidPlexus, RightLateralVentricle, RightInfLatVent, RightChoroidPlexus
wmparcStructuresToDeleteSTRING="4 5 14 15 24 31 43 44 63"




Peace,


Matt.




From: Eleftherios Garyfallidis 
Date: Thursday, December 4, 2014 at 6:43 PM
To: "hcp-users@humanconnectome.org" 
Subject: [HCP-Users] White matter mask availability in HCP







Hello HCP crew,


For my current analysis I need to get a whole brain white matter mask and if possible the white-matter/gray-matter interface mask for each subject. I am aware that such a mask one can get by using FSL/FAST on the T1 but I was wondering if you already provide
 such masks in your processed data so that I don't need to recompute them. Do you?


I have seen for example that you provide the wmparc.nii.gz file but I am not sure if using that 
I can get a subject specific and whole brain white matter mask (with cerebral and cerebellum  bundles and for example the full CST included all in the same mask). If I use wmparc.nii.gz then it seems that I need to provide a great number of labels until
 I get the full coverage of the white matter mask. Is there a simpler way?  


What is crucial here is that the white matter mask should fit really well in the native space of the subject. Any ideas? 


Best regards,
Eleftherios









___
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.

Re: [HCP-Users] White matter mask availability in HCP

2014-12-09 Thread Eleftherios Garyfallidis
Thank you Matthew.

Your suggestions were very helpful.

I had to do a few more corrections on selecting the labels for creating
whole brain white matter mask from the ribbon.nii.gz and wmparc.nii.gz
files.
Here what worked at the end:

#_WHITE_MATTER_LEFT CEREBRAL_WHITE_MATTER_RIGHT
ribbon_structures = [2, 41]

# CEREBELLAR_WHITE_MATTER_LEFT CEREBELLUM_LEFT THALAMUS_LEFT
CAUDATE_LEFT PUTAMEN_LEFT PALLIDUM_LEFT BRAIN_STEM HIPPOCAMPUS_LEFT
AMYGDALA_LEFT ACCUMBENS_LEFT DIENCEPHALON_VENTRAL_LEFT
CEREBELLAR_WHITE_MATTER_RIGHT CEREBELLUM_RIGHT THALAMUS_RIGHT CAUDATE_RIGHT
PUTAMEN_RIGHT PALLIDUM_RIGHT HIPPOCAMPUS_RIGHT AMYGDALA_RIGHT
ACCUMBENS_RIGHT DIENCEPHALON_VENTRAL_RIGHT
# wmparc_structures = [7, 8, 10, 11, 12, 13, 16, 17, 18, 26, 28, 46,
47, 49, 50, 51, 52, 53, 54, 58, 60]

# CEREBELLAR_WHITE_MATTER_LEFT CEREBELLAR_WHITE_MATTER_RIGHT BRAIN_STEM
wmparc_structures = [7, 46, 16]

#Fornix, CC_Posterior, CC_Mid_Posterior, CC_Central, CC_MidAnterior,
CC_Anterior
wmparc_cc_structures = [250, 251, 252, 253, 254, 255]

#LeftLateralVentricle, LeftInfLatVent, 3rdVentricle, 4thVentricle, CSF,
LeftChoroidPlexus, RightLateralVentricle, RightInfLatVent,
RightChoroidPlexus
wmparc_del_structures = [4, 5, 14, 15, 24, 31, 43, 44, 63]

#LeftCaudate RightCaudate
wmparc_del_structures2 = [11, 50]

Thx again!
Best regards,
Eleftherios


On Fri, Dec 5, 2014 at 2:54 AM, Glasser, Matthew 
wrote:

>  For whitematter/greymatter interface, it sounds like you need a surface
> (the white matter surface).   This will be much more exact than a volume
> mask (e.g. if you are doing tractography, you can get quite misleading
> results if you use masks vs surfaces for cortex).
>
>  As for a white matter mask, you can use the ribbon.nii.gz and
> wmparc.nii.gz files to construct this (indices for ribbon.nii.gz or
> wmparc.nii.gz are listed below with the appropriate names):
>
>   #CORTEX_LEFT CEREBRAL_WHITE_MATTER_LEFT CORTEX_RIGHT
> CEREBRAL_WHITE_MATTER_RIGHT
> RibbonStructures="2 3 41 42"
>
>  #CEREBELLAR_WHITE_MATTER_LEFT CEREBELLUM_LEFT THALAMUS_LEFT CAUDATE_LEFT
> PUTAMEN_LEFT PALLIDUM_LEFT BRAIN_STEM HIPPOCAMPUS_LEFT AMYGDALA_LEFT
> ACCUMBENS_LEFT DIENCEPHALON_VENTRAL_LEFT CEREBELLAR_WHITE_MATTER_RIGHT
> CEREBELLUM_RIGHT THALAMUS_RIGHT CAUDATE_RIGHT PUTAMEN_RIGHT PALLIDUM_RIGHT
> HIPPOCAMPUS_RIGHT AMYGDALA_RIGHT ACCUMBENS_RIGHT DIENCEPHALON_VENTRAL_RIGHT
> wmparcStructuresToKeepSTRING="7 8 10 11 12 13 16 17 18 26 28 46 47 49 50
> 51 52 53 54 58 60"
>
>  #Fornix, CC_Posterior, CC_Mid_Posterior, CC_Central, CC_MidAnterior,
> CC_Anterior
> CorpusCallosumToAdd="250 251 252 253 254 255”
>
>   #LeftLateralVentricle, LeftInfLatVent, 3rdVentricle, 4thVentricle, CSF,
> LeftChoroidPlexus, RightLateralVentricle, RightInfLatVent,
> RightChoroidPlexus
> wmparcStructuresToDeleteSTRING="4 5 14 15 24 31 43 44 63"
>
>  Peace,
>
>  Matt.
>
>   From: Eleftherios Garyfallidis 
> Date: Thursday, December 4, 2014 at 6:43 PM
> To: "hcp-users@humanconnectome.org" 
> Subject: [HCP-Users] White matter mask availability in HCP
>
>   Hello HCP crew,
>
>  For my current analysis I need to get a whole brain white matter mask
> and if possible the white-matter/gray-matter interface mask for each
> subject. I am aware that such a mask one can get by using FSL/FAST on the
> T1 but I was wondering if you already provide such masks in your processed
> data so that I don't need to recompute them. Do you?
>
>  I have seen for example that you provide the wmparc.nii.gz file but I am
> not sure if using that
> I can get a subject specific and whole brain white matter mask (with
> cerebral and cerebellum  bundles and for example the full CST included all
> in the same mask). If I use wmparc.nii.gz then it seems that I need to
> provide a great number of labels until I get the full coverage of the white
> matter mask. Is there a simpler way?
>
>  What is crucial here is that the white matter mask should fit really
> well in the native space of the subject. Any ideas?
>
>  Best regards,
> Eleftherios
>
>
>
>  ___
> 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


Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Xu, Junqian
After a second thought, maybe convert the list to array specifically for the 
comparison purpose so the rest of the pipeline script don’t need to be modified 
to use array indexing.

Tasklist="domino0 domino1 domino2 domino3"
PhaseEncodinglist="y y- y y-“

TaskArray=($Tasklist)
PhaseEncodingArray=($PhaseEcondinglist)

nTaskArray=${#TaskArray[@]}
nPhaseEncodingArray=${#PhaseEncodingArray[@]}

if [ $nTaskArray -ne $nPhaseEncodingArray ]; then
 
fi

Gordon

> On Dec 9, 2014, at 4:05 PM, Glasser, Matthew  wrote:
> 
> Thanks Gordon, that would help too.
> 
> On 12/9/14, 3:03 PM, "Xu, Junqian"  wrote:
> 
>> Tim,
>> 
>> A patch here to use array instead of space delimited string might be
>> helpful for error detection:
>> 
>> e.g.
>> 
>> Tasklist=(domino0 domino1 domino2 domino3)
>> PhaseEncodinglist=(y y- y y-)
>> 
>> nTasklist=${#Tasklist[@]}
>> nPhaseEncodinglist=${#PhaseEncodinglist[@]}
>> 
>> if [ $nTasklist -ne $nPhaseEncodinglist ]; then
>>  
>> fi
>> 
>> 
>> Gordon
>> 
>>> On Dec 9, 2014, at 3:33 PM, Glasser, Matthew 
>>> wrote:
>>> 
>>> You need to expand the PhaseEncodinglist variable to have the same
>>> length as the Tasklist variable (i.e. same number of elements separated
>>> by spaces).  This probably should be made clearer in the comments for
>>> these variables.
>>> 
>>> Peace,
>>> 
>>> Matt.
>>> 
>>> From: , Gregory 
>>> Date: Tuesday, December 9, 2014 at 2:19 PM
>>> To: Matt Glasser ,
>>> "hcp-users@humanconnectome.org" 
>>> Subject: RE: [HCP-Users] error when processing more than 2 tasks with
>>> GenericfMRIVolume script
>>> 
>>> Thanks, the script is attached. Also the directory structure is after
>>> the script.
>>> 
>>> #!/bin/bash
>>> 
>>> get_batch_options() {
>>>local arguments=($@)
>>> 
>>>unset command_line_specified_study_folder
>>>unset command_line_specified_subj_list
>>>unset command_line_specified_run_local
>>> 
>>>local index=0
>>>local numArgs=${#arguments[@]}
>>>local argument
>>> 
>>>while [ ${index} -lt ${numArgs} ]; do
>>>argument=${arguments[index]}
>>> 
>>>case ${argument} in
>>>--StudyFolder=*)
>>>command_line_specified_study_folder=${argument/*=/""}
>>>index=$(( index + 1 ))
>>>;;
>>>--Subjlist=*)
>>>command_line_specified_subj_list=${argument/*=/""}
>>>index=$(( index + 1 ))
>>>;;
>>>--runlocal)
>>>command_line_specified_run_local="TRUE"
>>>index=$(( index + 1 ))
>>>;;
>>>esac
>>>done
>>> }
>>> 
>>> get_batch_options $@
>>> 
>>> 
>>> StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoS
>>> kyra"
>>> Subjlist="analysis"
>>> EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"
>>> 
>>> if [ -n "${command_line_specified_study_folder}" ]; then
>>>StudyFolder="${command_line_specified_study_folder}"
>>> fi
>>> 
>>> if [ -n "${command_line_specified_subj_list}" ]; then
>>>Subjlist="${command_line_specified_subj_list}"
>>> fi
>>> 
>>> # Requirements for this script
>>> #  installed versions of: FSL (version 5.0.6), FreeSurfer (version
>>> 5.3.0-HCP) , gradunwarp (HCP version 1.0.1)
>>> #  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR ,
>>> PATH (for gradient_unwarp.py)
>>> 
>>> #Set up pipeline environment variables and software
>>> . ${EnvironmentScript}
>>> 
>>> # Log the originating call
>>> echo "$@"
>>> 
>>> #if [ X$SGE_ROOT != X ] ; then
>>>QUEUE="-q long.q"
>>> #fi
>>> 
>>> PRINTCOM=""
>>> #PRINTCOM="echo"
>>> #QUEUE="-q veryshort.q"
>>> 
>>> ## INPUTS
>>> ##
>>> 
>>> #Scripts called by this script do NOT assume anything about the form of
>>> the input names or paths.
>>> #This batch script assumes the HCP raw data naming convention, e.g. for
>>> tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:
>>> 
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_t
>>> fMRI_EMOTION_LR.nii.gz
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_t
>>> fMRI_EMOTION_LR_SBRef.nii.gz
>>> 
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_t
>>> fMRI_EMOTION_RL.nii.gz
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_t
>>> fMRI_EMOTION_RL_SBRef.nii.gz
>>> 
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_S
>>> pinEchoFieldMap_LR.nii.gz
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_S
>>> pinEchoFieldMap_RL.nii.gz
>>> 
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_S
>>> pinEchoFieldMap_LR.nii.gz
>>> #
>>> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_S
>>> pinEchoFieldMap_RL.nii.gz
>>> 
>>> #Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and
>>> $PhaseEncodi

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Glasser, Matthew
Thanks Gordon, that would help too.

On 12/9/14, 3:03 PM, "Xu, Junqian"  wrote:

>Tim,
>
>A patch here to use array instead of space delimited string might be
>helpful for error detection:
>
>e.g.
>
>Tasklist=(domino0 domino1 domino2 domino3)
>PhaseEncodinglist=(y y- y y-)
>
>nTasklist=${#Tasklist[@]}
>nPhaseEncodinglist=${#PhaseEncodinglist[@]}
>
>if [ $nTasklist -ne $nPhaseEncodinglist ]; then
>   
>fi
>
>
>Gordon
>
>> On Dec 9, 2014, at 3:33 PM, Glasser, Matthew 
>>wrote:
>>
>> You need to expand the PhaseEncodinglist variable to have the same
>>length as the Tasklist variable (i.e. same number of elements separated
>>by spaces).  This probably should be made clearer in the comments for
>>these variables.
>>
>> Peace,
>>
>> Matt.
>>
>> From: , Gregory 
>> Date: Tuesday, December 9, 2014 at 2:19 PM
>> To: Matt Glasser ,
>>"hcp-users@humanconnectome.org" 
>> Subject: RE: [HCP-Users] error when processing more than 2 tasks with
>>GenericfMRIVolume script
>>
>> Thanks, the script is attached. Also the directory structure is after
>>the script.
>>
>> #!/bin/bash
>>
>> get_batch_options() {
>> local arguments=($@)
>>
>> unset command_line_specified_study_folder
>> unset command_line_specified_subj_list
>> unset command_line_specified_run_local
>>
>> local index=0
>> local numArgs=${#arguments[@]}
>> local argument
>>
>> while [ ${index} -lt ${numArgs} ]; do
>> argument=${arguments[index]}
>>
>> case ${argument} in
>> --StudyFolder=*)
>> command_line_specified_study_folder=${argument/*=/""}
>> index=$(( index + 1 ))
>> ;;
>> --Subjlist=*)
>> command_line_specified_subj_list=${argument/*=/""}
>> index=$(( index + 1 ))
>> ;;
>> --runlocal)
>> command_line_specified_run_local="TRUE"
>> index=$(( index + 1 ))
>> ;;
>> esac
>> done
>> }
>>
>> get_batch_options $@
>>
>>
>>StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoS
>>kyra"
>> Subjlist="analysis"
>> EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"
>>
>> if [ -n "${command_line_specified_study_folder}" ]; then
>> StudyFolder="${command_line_specified_study_folder}"
>> fi
>>
>> if [ -n "${command_line_specified_subj_list}" ]; then
>> Subjlist="${command_line_specified_subj_list}"
>> fi
>>
>> # Requirements for this script
>> #  installed versions of: FSL (version 5.0.6), FreeSurfer (version
>>5.3.0-HCP) , gradunwarp (HCP version 1.0.1)
>> #  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR ,
>>PATH (for gradient_unwarp.py)
>>
>> #Set up pipeline environment variables and software
>> . ${EnvironmentScript}
>>
>> # Log the originating call
>> echo "$@"
>>
>> #if [ X$SGE_ROOT != X ] ; then
>> QUEUE="-q long.q"
>> #fi
>>
>> PRINTCOM=""
>> #PRINTCOM="echo"
>> #QUEUE="-q veryshort.q"
>>
>> ## INPUTS
>>##
>>
>> #Scripts called by this script do NOT assume anything about the form of
>>the input names or paths.
>> #This batch script assumes the HCP raw data naming convention, e.g. for
>>tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:
>>
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_t
>>fMRI_EMOTION_LR.nii.gz
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_t
>>fMRI_EMOTION_LR_SBRef.nii.gz
>>
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_t
>>fMRI_EMOTION_RL.nii.gz
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_t
>>fMRI_EMOTION_RL_SBRef.nii.gz
>>
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_S
>>pinEchoFieldMap_LR.nii.gz
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_S
>>pinEchoFieldMap_RL.nii.gz
>>
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_S
>>pinEchoFieldMap_LR.nii.gz
>> #
>>${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_S
>>pinEchoFieldMap_RL.nii.gz
>>
>> #Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and
>>$PhaseEncodinglist to match your images
>> #These are set to match the HCP Protocol by default
>>
>> #If using gradient distortion correction, use the coefficents from your
>>scanner
>> #The HCP gradient distortion coefficents are only available through
>>Siemens
>> #Gradient distortion in standard scanners like the Trio is much less
>>than for the HCP Skyra.
>>
>> #To get accurate EPI distortion correction with TOPUP, the flags in
>>PhaseEncodinglist must match the phase encoding
>> #direction of the EPI scan, and you must have used the correct images
>>in SpinEchoPhaseEncodeNegative and Positive
>> #variables.  If the distortion is twice as bad as in the original
>>images, flip either the order of the spin echo
>> #images or

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Xu, Junqian
Tim,

A patch here to use array instead of space delimited string might be helpful 
for error detection:

e.g.

Tasklist=(domino0 domino1 domino2 domino3)
PhaseEncodinglist=(y y- y y-)

nTasklist=${#Tasklist[@]}
nPhaseEncodinglist=${#PhaseEncodinglist[@]}

if [ $nTasklist -ne $nPhaseEncodinglist ]; then
   
fi


Gordon

> On Dec 9, 2014, at 3:33 PM, Glasser, Matthew  wrote:
> 
> You need to expand the PhaseEncodinglist variable to have the same length as 
> the Tasklist variable (i.e. same number of elements separated by spaces).  
> This probably should be made clearer in the comments for these variables.  
> 
> Peace,
> 
> Matt.
> 
> From: , Gregory 
> Date: Tuesday, December 9, 2014 at 2:19 PM
> To: Matt Glasser , "hcp-users@humanconnectome.org" 
> 
> Subject: RE: [HCP-Users] error when processing more than 2 tasks with 
> GenericfMRIVolume script
> 
> Thanks, the script is attached. Also the directory structure is after the 
> script.
>  
> #!/bin/bash 
>  
> get_batch_options() {
> local arguments=($@)
>  
> unset command_line_specified_study_folder
> unset command_line_specified_subj_list
> unset command_line_specified_run_local
>  
> local index=0
> local numArgs=${#arguments[@]}
> local argument
>  
> while [ ${index} -lt ${numArgs} ]; do
> argument=${arguments[index]}
>  
> case ${argument} in
> --StudyFolder=*)
> command_line_specified_study_folder=${argument/*=/""}
> index=$(( index + 1 ))
> ;;
> --Subjlist=*)
> command_line_specified_subj_list=${argument/*=/""}
> index=$(( index + 1 ))
> ;;
> --runlocal)
> command_line_specified_run_local="TRUE"
> index=$(( index + 1 ))
> ;;
> esac
> done
> }
>  
> get_batch_options $@
>  
> StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoSkyra"
> Subjlist="analysis"
> EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"
>  
> if [ -n "${command_line_specified_study_folder}" ]; then
> StudyFolder="${command_line_specified_study_folder}"
> fi
>  
> if [ -n "${command_line_specified_subj_list}" ]; then
> Subjlist="${command_line_specified_subj_list}"
> fi
>  
> # Requirements for this script
> #  installed versions of: FSL (version 5.0.6), FreeSurfer (version 5.3.0-HCP) 
> , gradunwarp (HCP version 1.0.1)
> #  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR , PATH (for 
> gradient_unwarp.py)
>  
> #Set up pipeline environment variables and software
> . ${EnvironmentScript}
>  
> # Log the originating call
> echo "$@"
>  
> #if [ X$SGE_ROOT != X ] ; then
> QUEUE="-q long.q"
> #fi
>  
> PRINTCOM=""
> #PRINTCOM="echo"
> #QUEUE="-q veryshort.q"
>  
> ## INPUTS 
> ##
>  
> #Scripts called by this script do NOT assume anything about the form of the 
> input names or paths.
> #This batch script assumes the HCP raw data naming convention, e.g. for 
> tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:
>  
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR.nii.gz
> #
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR_SBRef.nii.gz
>  
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL.nii.gz
> #
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL_SBRef.nii.gz
>  
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz
>  
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
> # 
> ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz
>  
> #Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and 
> $PhaseEncodinglist to match your images
> #These are set to match the HCP Protocol by default
>  
> #If using gradient distortion correction, use the coefficents from your 
> scanner
> #The HCP gradient distortion coefficents are only available through Siemens
> #Gradient distortion in standard scanners like the Trio is much less than for 
> the HCP Skyra.
>  
> #To get accurate EPI distortion correction with TOPUP, the flags in 
> PhaseEncodinglist must match the phase encoding
> #direction of the EPI scan, and you must have used the correct images in 
> SpinEchoPhaseEncodeNegative and Positive
> #variables.  If the distortion is twice as bad as in the original images, 
> flip either the order of the spin echo
> #images or reverse the phase encoding list flag.  The pipeline expects 

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Glasser, Matthew



Yes it is the EPI phase encoding direction.  The positive and negative phase encoding directions are conventional (see the notes next to the variables for the convention).  Basically, you want them in the order that produces a field map whose signs look
 like a regular field map (as opposed to looking the opposite of it).  Then all that remains is to specify the EPI phase encoding direction.  If you were to reverse the spin echo image order, you would also have to reverse the EPI phase encoding direction (then
 the correction would still work fine, but the topup field map would not have the same +/- convention as a regular field map.


Peace,


Matt.




From: , Gregory 
Date: Tuesday, December 9, 2014 at 2:49 PM
To: Matt Glasser , "hcp-users@humanconnectome.org" 
Cc: "Brown, Tim" 
Subject: RE: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script








So the phase encoding list corresponds to the EPI encoding direction, not the spin echo direction. How does TopUp know the encoding directions of the spin echos? Does it assume the positive image is the same
 encoding direction as the EPI and the negative image is the opposite direction?
 


From: Glasser, Matthew [mailto:glass...@wusm.wustl.edu]

Sent: Tuesday, December 09, 2014 3:33 PM
To: Book, Gregory; hcp-users@humanconnectome.org
Cc: Brown, Tim
Subject: Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script


 

You need to expand the PhaseEncodinglist variable to have the same length as the Tasklist variable
 (i.e. same number of elements separated by spaces).  This probably should be made clearer in the comments for these variables.  


 


Peace,


 


Matt.


 


From: , Gregory 
Date: Tuesday, December 9, 2014 at 2:19 PM
To: Matt Glasser , "hcp-users@humanconnectome.org" 
Subject: RE: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script


 



Thanks, the script is attached. Also the directory structure is after the script.
 
#!/bin/bash 
 
get_batch_options() {
    local arguments=($@)
 
    unset command_line_specified_study_folder
    unset command_line_specified_subj_list
    unset command_line_specified_run_local
 
    local index=0
    local numArgs=${#arguments[@]}
    local argument
 
    while [ ${index} -lt ${numArgs} ]; do
    argument=${arguments[index]}
 
    case ${argument} in
    --StudyFolder=*)
    command_line_specified_study_folder=${argument/*=/""}
    index=$(( index + 1 ))
    ;;
    --Subjlist=*)
    command_line_specified_subj_list=${argument/*=/""}
    index=$(( index + 1 ))
    ;;
    --runlocal)
    command_line_specified_run_local="TRUE"
    index=$(( index + 1 ))
    ;;
    esac
    done
}
 
get_batch_options $@
 
StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoSkyra"
Subjlist="analysis"
EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"
 
if [ -n "${command_line_specified_study_folder}" ]; then
    StudyFolder="${command_line_specified_study_folder}"
fi
 
if [ -n "${command_line_specified_subj_list}" ]; then
    Subjlist="${command_line_specified_subj_list}"
fi
 
# Requirements for this script
#  installed versions of: FSL (version 5.0.6), FreeSurfer (version 5.3.0-HCP) , gradunwarp (HCP version 1.0.1)
#  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR , PATH (for gradient_unwarp.py)
 
#Set up pipeline environment variables and software
. ${EnvironmentScript}
 
# Log the originating call
echo "$@"
 
#if [ X$SGE_ROOT != X ] ; then
    QUEUE="-q long.q"
#fi
 
PRINTCOM=""
#PRINTCOM="echo"
#QUEUE="-q veryshort.q"
 
## INPUTS ##

 
#Scripts called by this script do NOT assume anything about the form of the input names or paths.
#This batch script assumes the HCP raw data naming convention, e.g. for tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR.nii.gz
#    ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR_SBRef.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL.nii.gz
#    ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL_SBRef.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Book, Gregory
So the phase encoding list corresponds to the EPI encoding direction, not the 
spin echo direction. How does TopUp know the encoding directions of the spin 
echos? Does it assume the positive image is the same encoding direction as the 
EPI and the negative image is the opposite direction?

From: Glasser, Matthew [mailto:glass...@wusm.wustl.edu]
Sent: Tuesday, December 09, 2014 3:33 PM
To: Book, Gregory; hcp-users@humanconnectome.org
Cc: Brown, Tim
Subject: Re: [HCP-Users] error when processing more than 2 tasks with 
GenericfMRIVolume script

You need to expand the PhaseEncodinglist variable to have the same length as 
the Tasklist variable (i.e. same number of elements separated by spaces).  This 
probably should be made clearer in the comments for these variables.

Peace,

Matt.

From: , Gregory 
mailto:gregory.b...@hhchealth.org>>
Date: Tuesday, December 9, 2014 at 2:19 PM
To: Matt Glasser mailto:glass...@wusm.wustl.edu>>, 
"hcp-users@humanconnectome.org" 
mailto:hcp-users@humanconnectome.org>>
Subject: RE: [HCP-Users] error when processing more than 2 tasks with 
GenericfMRIVolume script

Thanks, the script is attached. Also the directory structure is after the 
script.

#!/bin/bash

get_batch_options() {
local arguments=($@)

unset command_line_specified_study_folder
unset command_line_specified_subj_list
unset command_line_specified_run_local

local index=0
local numArgs=${#arguments[@]}
local argument

while [ ${index} -lt ${numArgs} ]; do
argument=${arguments[index]}

case ${argument} in
--StudyFolder=*)
command_line_specified_study_folder=${argument/*=/""}
index=$(( index + 1 ))
;;
--Subjlist=*)
command_line_specified_subj_list=${argument/*=/""}
index=$(( index + 1 ))
;;
--runlocal)
command_line_specified_run_local="TRUE"
index=$(( index + 1 ))
;;
esac
done
}

get_batch_options $@

StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoSkyra"
Subjlist="analysis"
EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"

if [ -n "${command_line_specified_study_folder}" ]; then
StudyFolder="${command_line_specified_study_folder}"
fi

if [ -n "${command_line_specified_subj_list}" ]; then
Subjlist="${command_line_specified_subj_list}"
fi

# Requirements for this script
#  installed versions of: FSL (version 5.0.6), FreeSurfer (version 5.3.0-HCP) , 
gradunwarp (HCP version 1.0.1)
#  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR , PATH (for 
gradient_unwarp.py)

#Set up pipeline environment variables and software
. ${EnvironmentScript}

# Log the originating call
echo "$@"

#if [ X$SGE_ROOT != X ] ; then
QUEUE="-q long.q"
#fi

PRINTCOM=""
#PRINTCOM="echo"
#QUEUE="-q veryshort.q"

## INPUTS 
##

#Scripts called by this script do NOT assume anything about the form of the 
input names or paths.
#This batch script assumes the HCP raw data naming convention, e.g. for 
tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR.nii.gz
#
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR_SBRef.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL.nii.gz
#
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL_SBRef.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz

#Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and 
$PhaseEncodinglist to match your images
#These are set to match the HCP Protocol by default

#If using gradient distortion correction, use the coefficents from your scanner
#The HCP gradient distortion coefficents are only available through Siemens
#Gradient distortion in standard scanners like the Trio is much less than for 
the HCP Skyra.

#To get accurate EPI distortion correction with TOPUP, the flags in 
PhaseEncodinglist must match the phase encoding
#direction of the EPI scan, and you must have used the correct images in 
SpinEchoPhaseEncodeNegative and Positive
#variables.  If the distortion is twice as bad as in the original images, flip 
either the order of the spin echo
#images or reverse the phase encoding list f

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Glasser, Matthew



You need to expand the PhaseEncodinglist variable to have the same length as the Tasklist variable (i.e. same number of elements
 separated by spaces).  This probably should be made clearer in the comments for these variables.  


Peace,


Matt.




From: , Gregory 
Date: Tuesday, December 9, 2014 at 2:19 PM
To: Matt Glasser , "hcp-users@humanconnectome.org" 
Subject: RE: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script








Thanks, the script is attached. Also the directory structure is after the script.
 
#!/bin/bash 
 
get_batch_options() {
    local arguments=($@)
 
    unset command_line_specified_study_folder
    unset command_line_specified_subj_list
    unset command_line_specified_run_local
 
    local index=0
    local numArgs=${#arguments[@]}
    local argument
 
    while [ ${index} -lt ${numArgs} ]; do
    argument=${arguments[index]}
 
    case ${argument} in
    --StudyFolder=*)
    command_line_specified_study_folder=${argument/*=/""}
    index=$(( index + 1 ))
    ;;
    --Subjlist=*)
    command_line_specified_subj_list=${argument/*=/""}
    index=$(( index + 1 ))
    ;;
    --runlocal)
    command_line_specified_run_local="TRUE"
    index=$(( index + 1 ))
    ;;
    esac
    done
}
 
get_batch_options $@
 
StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoSkyra"
Subjlist="analysis"
EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"
 
if [ -n "${command_line_specified_study_folder}" ]; then
    StudyFolder="${command_line_specified_study_folder}"
fi
 
if [ -n "${command_line_specified_subj_list}" ]; then
    Subjlist="${command_line_specified_subj_list}"
fi
 
# Requirements for this script
#  installed versions of: FSL (version 5.0.6), FreeSurfer (version 5.3.0-HCP) , gradunwarp (HCP version 1.0.1)
#  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR , PATH (for gradient_unwarp.py)
 
#Set up pipeline environment variables and software
. ${EnvironmentScript}
 
# Log the originating call
echo "$@"
 
#if [ X$SGE_ROOT != X ] ; then
    QUEUE="-q long.q"
#fi
 
PRINTCOM=""
#PRINTCOM="echo"
#QUEUE="-q veryshort.q"
 
## INPUTS ##

 
#Scripts called by this script do NOT assume anything about the form of the input names or paths.
#This batch script assumes the HCP raw data naming convention, e.g. for tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR.nii.gz
#    ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR_SBRef.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL.nii.gz
#    ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL_SBRef.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz
 
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# ${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz
 
#Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and $PhaseEncodinglist to match your images
#These are set to match the HCP Protocol by default
 
#If using gradient distortion correction, use the coefficents from your scanner
#The HCP gradient distortion coefficents are only available through Siemens
#Gradient distortion in standard scanners like the Trio is much less than for the HCP Skyra.
 
#To get accurate EPI distortion correction with TOPUP, the flags in PhaseEncodinglist must match the phase encoding
#direction of the EPI scan, and you must have used the correct images in SpinEchoPhaseEncodeNegative and Positive
#variables.  If the distortion is twice as bad as in the original images, flip either the order of the spin echo
#images or reverse the phase encoding list flag.  The pipeline expects you to have used the same phase encoding
#axis in the fMRI data as in the spin echo field map data (x/-x or y/-y). 

 
# DO WORK ##
 
Tasklist=" domino0 domino1 domino2 domino3"
PhaseEncodinglist="y y-"
 
for Subject in $Subjlist ; do
  echo $Subject
 
  i=1
  for fMRIName in $Tasklist ; do
    echo "  ${fMRIName}"
    UnwarpDir=`echo $PhaseEncodinglist | cut -d " " -f $i`
    fMRITimeSeries="${StudyFolder}/${Subject}/unprocessed/3T/${fMRIName}/${Subject}_3T_${fMRIName}.nii.gz"

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Book, Gregory
Thanks, the script is attached. Also the directory structure is after the 
script.

#!/bin/bash

get_batch_options() {
local arguments=($@)

unset command_line_specified_study_folder
unset command_line_specified_subj_list
unset command_line_specified_run_local

local index=0
local numArgs=${#arguments[@]}
local argument

while [ ${index} -lt ${numArgs} ]; do
argument=${arguments[index]}

case ${argument} in
--StudyFolder=*)
command_line_specified_study_folder=${argument/*=/""}
index=$(( index + 1 ))
;;
--Subjlist=*)
command_line_specified_subj_list=${argument/*=/""}
index=$(( index + 1 ))
;;
--runlocal)
command_line_specified_run_local="TRUE"
index=$(( index + 1 ))
;;
esac
done
}

get_batch_options $@

StudyFolder="/home/pipeline/onrc/data/pipeline/S3777AUX/4/HCPfMRI-dominoSkyra"
Subjlist="analysis"
EnvironmentScript="/opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh"

if [ -n "${command_line_specified_study_folder}" ]; then
StudyFolder="${command_line_specified_study_folder}"
fi

if [ -n "${command_line_specified_subj_list}" ]; then
Subjlist="${command_line_specified_subj_list}"
fi

# Requirements for this script
#  installed versions of: FSL (version 5.0.6), FreeSurfer (version 5.3.0-HCP) , 
gradunwarp (HCP version 1.0.1)
#  environment: FSLDIR , FREESURFER_HOME , HCPPIPEDIR , CARET7DIR , PATH (for 
gradient_unwarp.py)

#Set up pipeline environment variables and software
. ${EnvironmentScript}

# Log the originating call
echo "$@"

#if [ X$SGE_ROOT != X ] ; then
QUEUE="-q long.q"
#fi

PRINTCOM=""
#PRINTCOM="echo"
#QUEUE="-q veryshort.q"

## INPUTS 
##

#Scripts called by this script do NOT assume anything about the form of the 
input names or paths.
#This batch script assumes the HCP raw data naming convention, e.g. for 
tfMRI_EMOTION_LR and tfMRI_EMOTION_RL:

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR.nii.gz
#
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_tfMRI_EMOTION_LR_SBRef.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL.nii.gz
#
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_tfMRI_EMOTION_RL_SBRef.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_LR/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz

# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_LR.nii.gz
# 
${StudyFolder}/${Subject}/unprocessed/3T/tfMRI_EMOTION_RL/${Subject}_3T_SpinEchoFieldMap_RL.nii.gz

#Change Scan Settings: Dwelltime, FieldMap Delta TE (if using), and 
$PhaseEncodinglist to match your images
#These are set to match the HCP Protocol by default

#If using gradient distortion correction, use the coefficents from your scanner
#The HCP gradient distortion coefficents are only available through Siemens
#Gradient distortion in standard scanners like the Trio is much less than for 
the HCP Skyra.

#To get accurate EPI distortion correction with TOPUP, the flags in 
PhaseEncodinglist must match the phase encoding
#direction of the EPI scan, and you must have used the correct images in 
SpinEchoPhaseEncodeNegative and Positive
#variables.  If the distortion is twice as bad as in the original images, flip 
either the order of the spin echo
#images or reverse the phase encoding list flag.  The pipeline expects you to 
have used the same phase encoding
#axis in the fMRI data as in the spin echo field map data (x/-x or y/-y).

# DO WORK 
##

Tasklist=" domino0 domino1 domino2 domino3"
PhaseEncodinglist="y y-"

for Subject in $Subjlist ; do
  echo $Subject

  i=1
  for fMRIName in $Tasklist ; do
echo "  ${fMRIName}"
UnwarpDir=`echo $PhaseEncodinglist | cut -d " " -f $i`

fMRITimeSeries="${StudyFolder}/${Subject}/unprocessed/3T/${fMRIName}/${Subject}_3T_${fMRIName}.nii.gz"
fMRISBRef="${StudyFolder}/${Subject}/unprocessed/3T/${fMRIName}/${Subject}_3T_${fMRIName}_SBRef.nii.gz"
 #A single band reference image (SBRef) is recommended if using multiband, set 
to NONE if you want to use the first volume of the timeseries for motion 
correction
DwellTime="0.00055" #Echo Spacing or Dwelltime of fMRI image, set to NONE 
if not used. Dwelltime = 1/(BandwidthPerPixelPhaseEncode * # of phase encoding 
samples): DICOM field (0019,1028) = BandwidthPerPixelPhaseEncode, DICOM field 
(0051,100b) AcquisitionMatrixText first value (# of pha

Re: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Glasser, Matthew



Can you post the text of your launcher script?  Only one task is run at a time inside the pipeline, so the issue will be there.


Peace,


Matt.




From: , Gregory 
Date: Tuesday, December 9, 2014 at 12:29 PM
To: "hcp-users@humanconnectome.org" 
Subject: [HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script








We’ve run into a weird problem when using the GenericfMRIVolume batch script to process more than 2 tasks at a time. When we setup any more than 2 tasks (we’ve tried 3 and 4 tasks), the first 2 run correctly and without error, but any after
 that crash in the TopUp section with the following error (the failed tasks all get to the same point):
 
# RUN TOPUP
# Needs FSL (version 5.0.6)
${FSLDIR}/bin/topup --imain=${WD}/BothPhases --datain=$txtfname --config=${TopupConfig} --out=${WD}/Coefficents --iout=${WD}/Magnitudes --fout=${WD}/TopupField --dfout=${WD}/WarpField --rbmout=${WD}/MotionMatrix --jacout=${WD}/Jacobian
 -v 
Could not open matrix file /home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/shop1/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased/FieldMap/acqparams.txt
 
Part of FSL (build 506)
topup
 
Usage: 
topup --imain= --datain= --config= --coutname=my_field
 
 
Compulsory arguments (You MUST set one or more of):
    --imain  name of 4D file with images
    --datain    name of text file with PE directions/times
 
Optional arguments (You may optionally specify one or more of):
    --out  base-name of output files (spline coefficients (Hz) and movement parameters)
    --fout    name of image file with field (Hz)
    --iout name of 4D image file with unwarped images
    --logout    Name of log-file
    --warpres    (approximate) resolution (in mm) of warp basis for the different sub-sampling levels, default 10
    --subsamp  sub-sampling scheme, default 1
    --fwhm FWHM (in mm) of gaussian smoothing kernel, default 8
    --config    Name of config file specifying command line arguments
    --miter  Max # of non-linear iterations, default 5
    --lambda  Weight of regularisation, default depending on --ssqlambda and --regmod switches. See user documetation.
    --ssqlambda   If set (=1), lambda is weighted by current ssq, default 1
    --regmod Model for regularisation of warp-field [membrane_energy bending_energy], default bending_energy
    --estmov Estimate movements if set, default 1 (true)
    --minmet Minimisation method 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient, default 0 (LM)
    --splineorder Order of spline, 2->Qadratic spline, 3->Cubic spline. Default=3
    --numprec  Precision for representing Hessian, double or float. Default double
    --interp    Image interpolation model, linear or spline. Default spline
    --scale   If set (=1), the images are individually scaled to a common mean, default 0 (false)
    --regrid If set (=1), the calculations are done in a different grid, default 1 (true)
    -h,--help  display help info
    -v,--verbose   Print diagonostic information while running
    -h,--help  display help info
 
 
 
TopupFileIO:: msg=TopupDatafileReader:: error reading file /home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/shop1/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased/FieldMap/acqparams.txt
set -- --path=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST   --subject=analysis   --fmriname=shop1   --fmritcs=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_shop1.nii.gz  
 --fmriscout=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_shop1_SBRef.nii.gz   --SEPhaseNeg=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_SpinEchoFieldMap_LR.nii.gz  
 --SEPhasePos=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_SpinEchoFieldMap_RL.nii.gz   --fmapmag=NONE   --fmapphase=NONE   --echospacing=0.00055   --echodiff=NONE   --unwarpdir=  
 --fmrires=2   --dcmethod=TOPUP   --gdcoeffs=/opt/HCP/coeff_AS098.grad   --topupconfig=/opt/HCP/HCP/global/config/b02b0.cnf   --printcom=
. /opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh
 

Re: [HCP-Users] Course on the HCP pipelines?

2014-12-09 Thread Jennifer Elam
Hi Oscar,

Your question is quite timely as we are currently formulating plans for an
HCP course that we hope will occur just before OHBM 2015 in Honolulu. Part
of what will be covered will be practicals on using the HCP pipelines. Stay
tuned for more information on the course to be available at the start of the
year.

 

If you or others have suggestions on more topics you'd like to be part of an
HCP course, please let us know as this will help us prioritize based on user
feedback.

 

Best,

Jenn

 

Jennifer Elam, Ph.D.
Outreach Coordinator, Human Connectome Project
Washington University School of Medicine
Department of Anatomy and Neurobiology, Box 8108
660 South Euclid Avenue
St. Louis, MO 63110
314-362-9387
el...@pcg.wustl.edu
www.humanconnectome.org

 

From: hcp-users-boun...@humanconnectome.org
[mailto:hcp-users-boun...@humanconnectome.org] On Behalf Of Oscar Miranda
Dominguez
Sent: Tuesday, December 09, 2014 12:22 PM
To: hcp-users@humanconnectome.org
Subject: [HCP-Users] Course on the HCP pipelines?

 

Hi 

 

Is in your plans to offer a course/training on the HCP pipelines (OHBM15,
SfN15, may be?)

Thanks!

 

Oscar Miranda-Dominguez

Postdoctoral Researcher

Fair Neuroimaging Lab

Phone: 503.418.1894  Fax: 503.494.9988

 

Oregon Health and Science University

Department of Behavioral Neuroscience

3181 SW Sam Jackson Park Road, L470

Portland, OR  97239

http://www.ohsu.edu/fair-lab

 

___
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


[HCP-Users] error when processing more than 2 tasks with GenericfMRIVolume script

2014-12-09 Thread Book, Gregory
We've run into a weird problem when using the GenericfMRIVolume batch script to 
process more than 2 tasks at a time. When we setup any more than 2 tasks (we've 
tried 3 and 4 tasks), the first 2 run correctly and without error, but any 
after that crash in the TopUp section with the following error (the failed 
tasks all get to the same point):

# RUN TOPUP
# Needs FSL (version 5.0.6)
${FSLDIR}/bin/topup --imain=${WD}/BothPhases --datain=$txtfname 
--config=${TopupConfig} --out=${WD}/Coefficents --iout=${WD}/Magnitudes 
--fout=${WD}/TopupField --dfout=${WD}/WarpField --rbmout=${WD}/MotionMatrix 
--jacout=${WD}/Jacobian -v
Could not open matrix file 
/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/shop1/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased/FieldMap/acqparams.txt

Part of FSL (build 506)
topup

Usage:
topup --imain= --datain= --config= --coutname=my_field


Compulsory arguments (You MUST set one or more of):
--imain  name of 4D file with images
--datainname of text file with PE 
directions/times

Optional arguments (You may optionally specify one or more of):
--out  base-name of output files (spline 
coefficients (Hz) and movement parameters)
--foutname of image file with field (Hz)
--iout name of 4D image file with unwarped 
images
--logoutName of log-file
--warpres(approximate) resolution (in mm) of warp 
basis for the different sub-sampling levels, default 10
--subsamp  sub-sampling scheme, default 1
--fwhm FWHM (in mm) of gaussian smoothing 
kernel, default 8
--configName of config file specifying command 
line arguments
--miter  Max # of non-linear iterations, 
default 5
--lambda  Weight of regularisation, default 
depending on --ssqlambda and --regmod switches. See user documetation.
--ssqlambda   If set (=1), lambda is weighted by current 
ssq, default 1
--regmod Model for regularisation of warp-field 
[membrane_energy bending_energy], default bending_energy
--estmov Estimate movements if set, default 1 (true)
--minmet Minimisation method 0=Levenberg-Marquardt, 
1=Scaled Conjugate Gradient, default 0 (LM)
--splineorder Order of spline, 2->Qadratic spline, 3->Cubic 
spline. Default=3
--numprec  Precision for representing Hessian, double 
or float. Default double
--interpImage interpolation model, linear or 
spline. Default spline
--scale   If set (=1), the images are 
individually scaled to a common mean, default 0 (false)
--regrid If set (=1), the calculations are done 
in a different grid, default 1 (true)
-h,--help  display help info
-v,--verbose   Print diagonostic information while running
-h,--help  display help info



TopupFileIO:: msg=TopupDatafileReader:: error reading file 
/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/shop1/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased/FieldMap/acqparams.txt
set -- --path=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST
   --subject=analysis   --fmriname=shop1   
--fmritcs=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_shop1.nii.gz
   
--fmriscout=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_shop1_SBRef.nii.gz
   
--SEPhaseNeg=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_SpinEchoFieldMap_LR.nii.gz
   
--SEPhasePos=/home/pipeline/onrc/data/pipeline/S8931EBN/2/HCPfMRI-SMARTTEST/analysis/unprocessed/3T/shop1/analysis_3T_SpinEchoFieldMap_RL.nii.gz
   --fmapmag=NONE   --fmapphase=NONE   --echospacing=0.00055   
--echodiff=NONE   --unwarpdir=   --fmrires=2   --dcmethod=TOPUP 
  --gdcoeffs=/opt/HCP/coeff_AS098.grad   
--topupconfig=/opt/HCP/HCP/global/config/b02b0.cnf   --printcom=
. /opt/HCP/HCP/Examples/Scripts/SetUpHCPPipeline.sh

_
Gregory Book
Senior Technology Manager
Olin Neuropsychiatry Research Center, Institute of Living, Hartford Hospital
200 Retreat Avenue
Hartford, CT 06106
Tel: 860-545-7267 Fax: 860-545-7797
gregory.b...@hhchealth.org
http://nidb.sourceforge.net


This e-mail message, including any attachments, is for the sole use of t

[HCP-Users] Course on the HCP pipelines?

2014-12-09 Thread Oscar Miranda Dominguez
Hi

Is in your plans to offer a course/training on the HCP pipelines (OHBM15, 
SfN15, may be?)
Thanks!

Oscar Miranda-Dominguez
Postdoctoral Researcher
Fair Neuroimaging Lab
Phone: 503.418.1894  Fax: 503.494.9988

Oregon Health and Science University
Department of Behavioral Neuroscience
3181 SW Sam Jackson Park Road, L470
Portland, OR  97239
http://www.ohsu.edu/fair-lab


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