diff --git a/spot/spotter.py b/spot/spotter.py index 774c8dc..f9ea35d 100644 --- a/spot/spotter.py +++ b/spot/spotter.py @@ -168,10 +168,11 @@ def _check_propagation_options(self): # Sanity check: msg = '' for bfc_mod in self.propagation_options['N_rigid_mod_diff_bfc']: - if bfc_mod not in self.propagation_options['N_rigid_modalities']: - msg += '\n\n === The modality selected for the differential bias field is not present in ' \ - 'the stack. Turn N_rigid_mod_diff_bfc to empty list, or add its values to ' \ - 'N_rigid_modalities == \n' + if len(self.propagation_options['N_rigid_modalities']) > 0: + if bfc_mod not in self.propagation_options['N_rigid_modalities']: + msg += '\n\n === The modality selected for the differential bias field is not present in ' \ + 'the stack. Turn N_rigid_mod_diff_bfc to empty list, or add its values to ' \ + 'N_rigid_modalities == \n' if len(self.propagation_options['Affine_reg_masks']) > 0: if not len(self.propagation_options['Affine_reg_masks']) == len(self.propagation_options['Affine_modalities']): diff --git a/spot/tools/iterative_propagator.py b/spot/tools/iterative_propagator.py index 3cab87f..487d853 100644 --- a/spot/tools/iterative_propagator.py +++ b/spot/tools/iterative_propagator.py @@ -140,7 +140,7 @@ def non_rigid_propagator(sp): for _ in range(num_modalities)] stack_a_list_of_images_from_list_pfi(pfi_target_reg_mask_list, pfi_target_reg_mask) - else: + else: # TODO every input subject must have roi_mask and reg_mask per modality. assert len(sp.propagation_options['N_rigid_modalities']) == len(sp.propagation_options['N_rigid_reg_masks']) pfi_target_reg_mask_list = [ jph(pfo_target_masks, '{0}_{1}_{2}.nii.gz'.format(sp.target_name, m, target_suffix_mask))