Add new scripts to analyze BIDS compliant datasets#40
Open
NathanMolinier wants to merge 20 commits intomainfrom
Open
Add new scripts to analyze BIDS compliant datasets#40NathanMolinier wants to merge 20 commits intomainfrom
NathanMolinier wants to merge 20 commits intomainfrom
Conversation
valosekj
reviewed
Nov 14, 2023
Comment on lines
+164
to
+176
| parser = argparse.ArgumentParser(description='Analyse config file') | ||
|
|
||
| ## Parameters | ||
| parser.add_argument('--paths-to-bids', default='', nargs='+', | ||
| help='Paths to BIDS compliant datasets (You can add multiple paths using spaces)') | ||
| parser.add_argument('--config', default='', | ||
| help='Path to JSON config file that contains all the training splits') | ||
| parser.add_argument('--paths-to-csv', default='', nargs='+', | ||
| help='Paths to csv files with already computed metrics (You can add multiple paths using spaces)') | ||
| parser.add_argument('--split', default='ALL', choices=('TRAINING', 'VALIDATION', 'TESTING', 'ALL'), | ||
| help='Split of the data that will be analysed (default="ALL")') | ||
| parser.add_argument('--create-csv', default=True, | ||
| help='Store computed metrics using a csv file in results/files (default=True)') |
Member
valosekj
reviewed
Nov 14, 2023
| help='Store computed metrics using a csv file in results/files (default=True)') | ||
|
|
||
| # Start analysis | ||
| run_analysis(parser.parse_args()) No newline at end of file |
Member
There was a problem hiding this comment.
I would add a main() function (example here) and call run_analysis from it.
valosekj
reviewed
Nov 14, 2023
|
|
||
| from utils import get_img_path_from_mask_path, get_mask_path_from_img_path, edit_metric_dict, save_graphs, change_mask_suffix, get_deriv_sub_from_img_path, str_to_float_list, str_to_str_list, mergedict | ||
|
|
||
| def run_analysis(args): |
Member
There was a problem hiding this comment.
This function is slightly "heavy".
Would it be possible to split it into several smaller functions (10-20 lines per function)? Each one with a self-explaning docstring.
Also, some nested for loops and if-else conditions are hard to follow. Adding comments would make them easier to follow.
Member
|
Thank you for the initiative, @NathanMolinier! I will try the scripts and take a closer look next week (after the workshop and course). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add new scripts to analyze BIDS compliant datasets