File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ def classification(features_df: pd.DataFrame):
116
116
117
117
# Check the classifications
118
118
is_motion = (features_df ['csf_fract' ] > THR_CSF ) | (features_df ['HFC' ] > THR_HFC ) | (proj > 0 )
119
- assert np .array_equal (is_motion , (clf_df ['classification' ] == 'rejected' ).values )
119
+ if not np .array_equal (is_motion , (clf_df ['classification' ] == 'rejected' ).values ):
120
+ raise ValueError ('Classification error: classifications do not match criteria.' )
120
121
121
122
# Remove trailing semicolons
122
123
clf_df ['rationale' ] = clf_df ['rationale' ].str .rstrip (';' )
Original file line number Diff line number Diff line change @@ -532,7 +532,11 @@ def _select_melodic_files(melodic_dir):
532
532
import os
533
533
534
534
mixing = os .path .join (melodic_dir , 'melodic_mix' )
535
- assert os .path .isfile (mixing ), f'Missing MELODIC mixing matrix: { mixing } '
535
+ if not os .path .isfile (mixing ):
536
+ raise FileNotFoundError (f'Missing MELODIC mixing matrix: { mixing } ' )
537
+
536
538
component_maps = os .path .join (melodic_dir , 'melodic_IC.nii.gz' )
537
- assert os .path .isfile (component_maps ), f'Missing MELODIC ICs: { component_maps } '
539
+ if not os .path .isfile (component_maps ):
540
+ raise FileNotFoundError (f'Missing MELODIC ICs: { component_maps } ' )
541
+
538
542
return mixing , component_maps
You can’t perform that action at this time.
0 commit comments