Skip to content

Commit

Permalink
Remove large files
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Jan 29, 2024
1 parent 7dfa06f commit 1bc53fe
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions narps_open/pipelines/team_51PW.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ def get_preprocessing(self):
(smoothing, data_sink, [('smoothed_file', 'preprocessing.@output_image')])
])

# Remove large files, if requested
if Configuration()['pipelines']['remove_unused_data']:

# Remove Node - Remove smoothed files once they are no longer needed
remove_smooth = Node(
InterfaceFactory.create('remove_parent_directory'),
name = 'remove_smooth'
)

# Add connections
preprocessing.connect([
(data_sink, remove_smooth, [('out_file', '_')]),
(smoothing, remove_smooth, [('smoothed_file', 'file_name')])
])

return preprocessing

def get_preprocessing_outputs(self):
Expand Down Expand Up @@ -359,6 +374,30 @@ def get_run_level_analysis(self):
('design_image', 'run_level_analysis.@design_img')]),
])

# Remove large files, if requested
if Configuration()['pipelines']['remove_unused_data']:

# Remove Node - Remove smoothed files once they are no longer needed
remove_smooth = MapNode(
InterfaceFactory.create('remove_parent_directory'),
name = 'remove_smooth',
iterfield = ['file_name']
)

# Remove Node - Remove roi files once they are no longer needed
remove_roi = Node(
InterfaceFactory.create('remove_parent_directory'),
name = 'remove_roi'
)

# Add connections
subject_level_analysis.connect([
(exclude_time_points, remove_smooth, [('roi_file', '_')]),
(select_files, remove_smooth, [('func', 'file_name')]),
(model_estimate, remove_roi, [('results_dir', '_')]),
(exclude_time_points, remove_roi, [('roi_file', 'file_name')])
])

return run_level_analysis

def get_run_level_outputs(self):
Expand Down

0 comments on commit 1bc53fe

Please sign in to comment.