Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSL melodic: make task relocatable. #23

Open
glatard opened this issue Jan 29, 2016 · 1 comment
Open

FSL melodic: make task relocatable. #23

glatard opened this issue Jan 29, 2016 · 1 comment
Assignees
Milestone

Comments

@glatard
Copy link
Member

glatard commented Jan 29, 2016

As noticed by @prioux:

I had a quick look at the work directory of that task, and in the .qsub file
all the data files are always substitued with complete full path to the task's work
directory. Is that really necessary? The entire point of writing a task is to encapsulate
the processing locally in the work directory, to make things relocatable even accross
clusters. Full paths defeat this completely. Couldn't all operations be performed
with relative paths instead? e.g. instead of

# Extracts dimensions of file /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz
${FSLINFO} /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz | awk '$1=="dim1" || $1=="dim2" || $1=="dim3" || $1=="dim4" {print}'> /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz.fslinfo
# Extracts TR of file /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz
${FSLHD} /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz | awk '$1=="pixdim4" {print $2}' > /gs/project/eim-670-aa/cbrain/data/gridshare/31/01/02/nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz.trvalue

why not :

# Extracts dimensions of file nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz
${FSLINFO} nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz | awk '$1=="dim1" || $1=="dim2" || $1=="dim3" || $1=="dim4" {print}' > nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz.fslinfo
# Extracts TR of file nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz
${FSLHD} nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz | awk '$1=="pixdim4" {print $2}' > nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz.trvalue

Also, the bash commands could be split on multiple lines to make things prettier. And no need to repeat the file name in the comment

# Extracts dimensions
${FSLINFO} \
    nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz | \
    awk '$1=="dim1" || $1=="dim2" || $1=="dim3" || $1=="dim4" {print}' \
    > nmahani-FslMelodic-T310102/Spin002^^^^_resting_post1_SENSE_FSL_14_1.nii.gz.fslinfo
@glatard glatard added this to the "Big datasets" FSL Melodic release milestone Jan 29, 2016
@glatard glatard self-assigned this Jan 29, 2016
@glatard glatard modified the milestones: Release 1.1, Release 0.1, Release 1.0 Feb 9, 2016
@glatard
Copy link
Member Author

glatard commented Feb 9, 2016

While here, review the generated bash scripts, fix (minor) identation issues and add missing comments, e.g. for XDIM, YDIM, ZDIM, TDIM checks.

@natacha-beck natacha-beck modified the milestones: v1.3.0, v1.4.0 Aug 18, 2016
@prioux prioux modified the milestones: v1.4.0, v1.5.0 Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants