FNNDSC / pl-fshack

A quick "hack" plugin for freesurfer
MIT License
2 stars 1 forks source link

Parallel processing of multiple subjects #11

Closed jennydaman closed 2 years ago

jennydaman commented 2 years ago

Use chris_plugin.PathMapper.dir_mapper_deep to change the operation of pl-fshack so that its functionality is applied to each subject data-containing subdirectory under options.inputdir. Subjects are processed in parallel.

To achieve the goal above, the job_run function was revamped to use asyncio and custom file-like objects for an efficient solution to running a subprocess, showing its output in real-time to both stdout and stderr, while also recording both streams to "log" files in options.outputdir.

The output printed to the process' stdout and stderr (typically the console/terminal output) are color-coded and prefixed by the name of the subject's data directory.

Code was changed where necessary to clean up code smells such as global mutable variables, but otherwise, functions such as inputFileSpec_parse and the logic which was moved to create_cmd were for the most part untouched. Usage of pl-fshack version 1.3.0 (this version) should be the same as version 1.2.0 (current version).

jennydaman commented 2 years ago

screenshot