Skip to content

adapt mia_processes to new version of populse_mia (populse_db V3) #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions mia_processes/bricks/preprocess/spm/spatial_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -1883,28 +1892,28 @@ 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)
# Add the Affine regularization type for
# 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"] = (
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions mia_processes/bricks/stat/spm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down