Skip to content

Commit

Permalink
preprocessing fully working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ATAY Melvin Selim committed Dec 13, 2024
1 parent 86f8157 commit c92608b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions narps_open/pipelines/team_L3V8.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def get_preprocessing(self):

# connection node for motion correction
preprocessing.connect(gunzip_func, 'out_file', motion_correction, 'in_files')
preprocessing.connect( motion_correction, 'realigned_files', data_sink, 'preprocessing.@realigned_files' )
preprocessing.connect( motion_correction, 'realignment_parameters', data_sink, 'preprocessing.@realignment_parameters' )
preprocessing.connect( motion_correction, 'mean_image', data_sink, 'preprocessing.@mean_image' )
preprocessing.connect( motion_correction, 'realigned_files', data_sink, 'preprocessing.@realigned_files')
preprocessing.connect( motion_correction, 'realignment_parameters', data_sink, 'preprocessing.@realignment_parameters')
preprocessing.connect( motion_correction, 'mean_image', data_sink, 'preprocessing.@mean_image')

# coregistration node

Expand All @@ -129,8 +129,9 @@ def get_preprocessing(self):
coregisteration.inputs.tolerance = [0.02, 0.02, 0.02, 0.001, 0.001, 0.001, 0.01, 0.01, 0.01, 0.001, 0.001, 0.001]

# connect coreg
preprocessing.connect( motion_correction, 'mean_image', coregisteration, 'target' ) # target=mean
preprocessing.connect( gunzip_anat, 'out_file', coregisteration, 'source' ) # T1w=source anat
preprocessing.connect( motion_correction, 'mean_image', coregisteration, 'target') # target=mean
preprocessing.connect( gunzip_anat, 'out_file', coregisteration, 'source') # T1w=source anat
preprocessing.connect( coregisteration, 'coregistered_source', data_sink, 'preprocessing.@coregistered_source') # T1w=source anat

# Get SPM Tissue Probability Maps file
spm_tissues_file = join(SPMInfo.getinfo()['path'], 'tpm', 'TPM.nii')
Expand All @@ -151,7 +152,7 @@ def get_preprocessing(self):
[(spm_tissues_file, 6), 2, (False,False), (False, False)]
]
# segmentation connection
preprocessing.connect(coregisteration, 'coregistered_files', segmentation, 'channel_files' )
preprocessing.connect(coregisteration, 'coregistered_source', segmentation, 'channel_files')
preprocessing.connect(segmentation, 'bias_corrected_images', data_sink, 'preprocessing.@bias_corrected_images')
preprocessing.connect(segmentation, 'native_class_images', data_sink, 'preprocessing.@native_class_images')
preprocessing.connect(segmentation, 'forward_deformation_field', data_sink, 'preprocessing.@forward_deformation_field')
Expand All @@ -164,9 +165,11 @@ def get_preprocessing(self):
normalization.inputs.write_voxel_sizes = [3, 3, 3]
normalization.inputs.write_interp = 4
normalization.inputs.warping_regularization = [0, 0.001, 0.5, 0.05, 0.2]

# normalization connection
preprocessing.connect(segmentation, 'forward_deformation_field', normalization, 'deformation_file')
preprocessing.connect(segmentation, 'forward_deformation_field', normalization, 'deformation_file')
preprocessing.connect(motion_correction, 'realigned_files', normalization, 'apply_to_files')

preprocessing.connect(normalization, 'normalized_files', data_sink, 'preprocessing.@normalized_files')


Expand All @@ -186,7 +189,7 @@ def get_preprocessing(self):


def get_run_level_analysis(self):

return
def get_subject_level_analysis(self):
return
Expand Down

0 comments on commit c92608b

Please sign in to comment.