Skip to content

Commit

Permalink
Merge pull request #2451 from satra/fix/tests
Browse files Browse the repository at this point in the history
Fix/tests
  • Loading branch information
satra committed Feb 19, 2018
2 parents a374998 + 6a026ac commit 1a1f9fd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/test_py2_pytest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" "${DOCKER_IMAGE}:py27" /usr/bin/run_pytests.sh
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 "${DOCKER_IMAGE}:py27" /usr/bin/run_pytests.sh
2 changes: 1 addition & 1 deletion .circleci/test_py3_pytest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" "${DOCKER_IMAGE}:py36" /usr/bin/run_pytests.sh
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 "${DOCKER_IMAGE}:py36" /usr/bin/run_pytests.sh
24 changes: 18 additions & 6 deletions nipype/workflows/dmri/fsl/tbss.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ def create_tbss_3_postreg(name='tbss_3_postreg', estimate_skeleton=True):
# $FSLDIR/bin/fslmaths $FSLDIR/data/standard/FMRIB58_FA_1mm -mas mean_FA_mask mean_FA
maskstd = pe.Node(
fsl.ImageMaths(op_string="-mas", suffix="_masked"), name="maskstd")
maskstd.inputs.in_file = fsl.Info.standard_image(
"FMRIB58_FA_1mm.nii.gz")
if fsl.no_fsl():
warn('NO FSL found')
else:
maskstd.inputs.in_file = fsl.Info.standard_image(
"FMRIB58_FA_1mm.nii.gz")

# $FSLDIR/bin/fslmaths mean_FA -bin mean_FA_mask
binmaskstd = pe.Node(
Expand All @@ -281,8 +284,11 @@ def create_tbss_3_postreg(name='tbss_3_postreg', estimate_skeleton=True):
(maskgroup, maskgroup2, [("out_file", "in_file")]),
(binmaskstd, maskgroup2, [("out_file", "in_file2")])])

outputnode.inputs.skeleton_file = fsl.Info.standard_image(
"FMRIB58_FA-skeleton_1mm.nii.gz")
if fsl.no_fsl():
warn('NO FSL found')
else:
outputnode.inputs.skeleton_file = fsl.Info.standard_image(
"FMRIB58_FA-skeleton_1mm.nii.gz")
tbss3.connect([(binmaskstd, outputnode, [('out_file', 'groupmask')]),
(maskstd, outputnode, [('out_file', 'meanfa_file')]),
(maskgroup2, outputnode, [('out_file',
Expand Down Expand Up @@ -387,8 +393,14 @@ def create_tbss_all(name='tbss_all', estimate_skeleton=True):
-------
>>> from nipype.workflows.dmri.fsl import tbss
>>> tbss = tbss.create_tbss_all('tbss')
>>> tbss.inputs.inputnode.skeleton_thresh = 0.2
>>> tbss_wf = tbss.create_tbss_all('tbss', estimate_skeleton=True)
>>> tbss_wf.inputs.inputnode.skeleton_thresh = 0.2
>>> tbss_wf.inputs.inputnode.fa_list = ['s1_wrapped_FA.nii', 's2_wrapped_FA.nii', 's3_wrapped_FA.nii']
>>> tbss_wf = tbss.create_tbss_all('tbss', estimate_skeleton=False)
>>> tbss_wf.inputs.inputnode.skeleton_thresh = 0.2
>>> tbss_wf.inputs.inputnode.fa_list = ['s1_wrapped_FA.nii', 's2_wrapped_FA.nii', 's3_wrapped_FA.nii']
Inputs::
Expand Down

0 comments on commit 1a1f9fd

Please sign in to comment.