Skip to content

Commit

Permalink
Run the volume workflow in a subdirectory.
Browse files Browse the repository at this point in the history
  • Loading branch information
FredLoney committed Jun 19, 2017
1 parent 8343bfc commit ebfdba5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions qipipe/pipeline/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,12 @@ def stage_volume(collection, subject, session, scan, volume, in_files,
dest, opts):
"""
Stages the given volume. The processed DICOM ``.dcm.gz`` files
and merged 3D NIfTI volume ``.nii.gz`` file are placed in the
*dest*/*volume* subdirectory.
are placed in the *dest*/*volume* subdirectory. The child
:class:`VolumeStagingWorkflow` runs in the
_parent_/volume\ _volume_ directory, where:
* _parent_ is the parent base directory specified in the
options (default current directory)
* _volume_ is the volume argument
:param collection: the collection name
:param subject: the subject name
Expand All @@ -519,8 +523,8 @@ def stage_volume(collection, subject, session, scan, volume, in_files,
:param volume: the volume number
:param in_files: the input DICOM files
:param dest: the parent destination directory
:param opts: the non-base_dir :class:`VolumeStagingWorkflow`
initializer options
:param opts: the :class:`VolumeStagingWorkflow` initializer
options
:return: the 3D NIfTI volume file
"""
import os
Expand All @@ -533,7 +537,8 @@ def stage_volume(collection, subject, session, scan, volume, in_files,
os.mkdir(out_dir)

# The volume workflow runs in a subdirectory.
base_dir = "volume%03d" % volume
parent_dir = opts.pop('base_dir', os.getcwd())
base_dir = "%s/volume%03d" % (parent_dir, volume)

# Make the workflow.
stg_wf = VolumeStagingWorkflow(base_dir=base_dir, **opts)
Expand Down

0 comments on commit ebfdba5

Please sign in to comment.