Skip to content

Commit

Permalink
moving the node declaration inside the if block
Browse files Browse the repository at this point in the history
  • Loading branch information
birajstha authored and shnizzedy committed Dec 11, 2024
1 parent ab2344a commit 9777e9f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions CPAC/pipeline/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,19 +1233,6 @@ def gather_pipes(self, wf, cfg, all=False, add_incl=None, add_excl=None):

wf.connect(id_string, 'out_filename', write_json, 'filename')

# Node to validate TR (and other scan parameters)
validate_bold_header = pe.Node(
Function(
input_names=["input_bold", "RawSource_bold"],
output_names=["output_bold"],
function=validate_outputs,
imports=[
"from CPAC.pipeline.utils import find_pixdim4, update_pixdim4"
],
),
name=f"validate_bold_header_{resource_idx}_{pipe_x}",
)

ds = pe.Node(DataSink(), name=f'sinker_{resource_idx}_'
f'{pipe_x}')
ds.inputs.parameterization = False
Expand All @@ -1263,6 +1250,18 @@ def gather_pipes(self, wf, cfg, all=False, add_incl=None, add_excl=None):
template_desc=id_string.inputs.template_desc,
atlas_id=atlas_id, subdir=out_dct['subdir']))
if resource.endswith("_bold"):
# Node to validate TR (and other scan parameters)
validate_bold_header = pe.Node(
Function(
input_names=["input_bold", "RawSource_bold"],
output_names=["output_bold"],
function=validate_outputs,
imports=[
"from CPAC.pipeline.utils import find_pixdim4, update_pixdim4"
],
),
name=f"validate_bold_header_{resource_idx}_{pipe_x}",
)
raw_source, raw_out = self.get_data("bold")
wf.connect([
(nii_name, validate_bold_header, [
Expand Down

0 comments on commit 9777e9f

Please sign in to comment.