@@ -60,7 +60,8 @@ def define_analysis(gear_name, acquisition_label, create_inputs):
6060
6161
6262def reactivity_inputs (acquisition_label , acquisitions , session , ** kwargs ):
63- functional = fa .find (acquisitions , label = acquisition_label )
63+ functional = fa .find_required_input_source (acquisitions , label = acquisition_label )
64+ # using plain find() here b/c this T1w might be missing
6465 structural = fa .find (acquisitions , label = 'T1w 1mm' )
6566 if not structural :
6667 assert session ['_id' ] in second_to_first_visit_id ,\
@@ -70,6 +71,7 @@ def reactivity_inputs(acquisition_label, acquisitions, session, **kwargs):
7071 first_visit_acquisitions = client .request (
7172 'sessions/{}/acquisitions' .format (first_visit_session_id )).json ()
7273 structural = fa .find (first_visit_acquisitions , label = 'T1w 1mm' )
74+ assert structural , 'Session {} is missing a structural.' .format (session ['_id' ])
7375
7476 return dict (
7577 functional = functional .find_file ('*.nii.gz' ),
@@ -78,7 +80,7 @@ def reactivity_inputs(acquisition_label, acquisitions, session, **kwargs):
7880
7981
8082def connectivity_inputs (acquisition_label , analyses , ** kwargs ):
81- reactivity = fa .find (
83+ reactivity = fa .find_required_input_source (
8284 analyses , label = analysis_label ('reactivity-preprocessing' , acquisition_label ))
8385
8486 return dict (
@@ -89,11 +91,11 @@ def connectivity_inputs(acquisition_label, analyses, **kwargs):
8991
9092
9193def first_level_model_inputs (acquisition_label , analyses , acquisitions , ** kwargs ):
92- reactivity = fa .find (
94+ reactivity = fa .find_required_input_source (
9395 analyses , label = analysis_label ('reactivity-preprocessing' , acquisition_label ))
94- connectivity = fa .find (
96+ connectivity = fa .find_required_input_source (
9597 analyses , label = analysis_label ('connectivity-preprocessing' , acquisition_label ))
96- behavioral = fa .find (
98+ behavioral = fa .find_required_input_source (
9799 acquisitions , label = 'Behavioral and Physiological' )
98100
99101 return dict (
0 commit comments