diff --git a/mia_processes/bricks/preprocess/spm/spatial_preprocessing.py b/mia_processes/bricks/preprocess/spm/spatial_preprocessing.py index 8a3d68a5..4333a62c 100755 --- a/mia_processes/bricks/preprocess/spm/spatial_preprocessing.py +++ b/mia_processes/bricks/preprocess/spm/spatial_preprocessing.py @@ -47,7 +47,14 @@ from nipype.interfaces.spm.base import ImageFileSPM # populse_mia imports -from populse_mia.data_manager.project import COLLECTION_CURRENT +# from populse_mia.data_manager.project import COLLECTION_CURRENT +from populse_mia.data_manager import ( + COLLECTION_CURRENT, + FIELD_TYPE_LIST_FLOAT, + FIELD_TYPE_STRING, + TAG_ORIGIN_USER, + TAG_UNIT_MM, +) from populse_mia.software_properties import Config from populse_mia.user_interface.pipeline_manager.process_mia import ProcessMIA @@ -682,8 +689,10 @@ def _namesFilter(self): files = [] if self.runFlag is False: + for file_name in self.apply_to_files: - if type(file_name) in [list, TraitListObject]: + + if isinstance(file_name, (list, TraitListObject)): file_name = file_name[0] if self.in_filter == "GM" and os.path.basename( @@ -1883,15 +1892,15 @@ def list_outputs(self, is_plugged=None, iteration=False): # in database tag_to_add = dict() tag_to_add["name"] = "Voxel sizes" - tag_to_add["field_type"] = "list_float" + tag_to_add["field_type"] = FIELD_TYPE_LIST_FLOAT tag_to_add["description"] = ( "The voxel sizes (x, y & " "z, in mm) of the written " "normalised images" ) tag_to_add["visibility"] = True - tag_to_add["origin"] = "user" - tag_to_add["unit"] = "mm" + tag_to_add["origin"] = TAG_ORIGIN_USER + tag_to_add["unit"] = TAG_UNIT_MM tag_to_add["default_value"] = None tag_to_add["value"] = self.write_voxel_sizes all_tags_to_add.append(tag_to_add) @@ -1899,12 +1908,12 @@ def list_outputs(self, is_plugged=None, iteration=False): # normalization, in database tag_to_add = dict() tag_to_add["name"] = "Affine regularization type" - tag_to_add["field_type"] = "string" + tag_to_add["field_type"] = FIELD_TYPE_STRING tag_to_add["description"] = ( - "Standard space for affine " "registration" + "Standard space for affine registration" ) tag_to_add["visibility"] = True - tag_to_add["origin"] = "user" + tag_to_add["origin"] = TAG_ORIGIN_USER tag_to_add["unit"] = None tag_to_add["default_value"] = None tag_to_add["value"] = ( @@ -3205,14 +3214,14 @@ def list_outputs(self, is_plugged=None, iteration=False): # Add the fwhm parameter for smooth, in database tag_to_add = dict() tag_to_add["name"] = "FWHM (X, Y, Z) for Smooth" - tag_to_add["field_type"] = "list_float" + tag_to_add["field_type"] = FIELD_TYPE_LIST_FLOAT tag_to_add["description"] = ( "Full width at half maximum (FWHM) of the " "Gaussian smoothing kernel in mm" ) tag_to_add["visibility"] = True - tag_to_add["origin"] = "user" - tag_to_add["unit"] = "mm" + tag_to_add["origin"] = TAG_ORIGIN_USER + tag_to_add["unit"] = TAG_UNIT_MM tag_to_add["default_value"] = None tag_to_add["value"] = self.fwhm all_tags_to_add.append(tag_to_add) diff --git a/mia_processes/bricks/stat/spm/model.py b/mia_processes/bricks/stat/spm/model.py index 7cd61e1b..189e1d02 100644 --- a/mia_processes/bricks/stat/spm/model.py +++ b/mia_processes/bricks/stat/spm/model.py @@ -41,8 +41,7 @@ traits, ) from nipype.interfaces.spm.base import ImageFileSPM -from populse_db.database import FIELD_TYPE_INTEGER -from populse_mia.data_manager.database_mia import TAG_ORIGIN_USER +from populse_mia.data_manager import FIELD_TYPE_INTEGER, TAG_ORIGIN_USER # populse_db and populse_mia import from populse_mia.data_manager.project import COLLECTION_CURRENT