-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add new scripts to analyze BIDS compliant datasets #40
base: main
Are you sure you want to change the base?
Conversation
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)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help='Store computed metrics using a csv file in results/files (default=True)') | ||
|
||
# Start analysis | ||
run_analysis(parser.parse_args()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a main()
function (example here) and call run_analysis
from it.
|
||
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Thank you for the initiative, @NathanMolinier! I will try the scripts and take a closer look next week (after the workshop and course). |
Description
Add new scripts to analyze BIDS compliant datasets