Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions bash_utilities/scil_score_ismrm_Renauld2023.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ then
echo "-----"
echo "Usage: "
echo ">> scil_score_ismrm_Renauld2023.sh tractogram out_dir scoring_data"
echo "If you are using an old version of scilpy (<2.2.0), the '.py' extensions"
echo "were required when calling python scripts"
echo "Then, usage becomes:"
echo ">> scil_score_ismrm_Renauld2023.sh tractogram out_dir scoring_data .py "
echo "-----"
exit
fi

tractogram=$1
out_dir=$2
scoring_data=$3
ext=$4

config_file_segmentation=$scoring_data/config_file_segmentation.json
config_file_tractometry=$scoring_data/config_file_tractometry.json
Expand All @@ -31,30 +36,30 @@ fi


echo '------------- SEGMENTATION ------------'
scil_tractogram_segment_with_ROI_and_score $tractogram $config_file_segmentation $out_dir --no_empty \
scil_tractogram_segment_with_ROI_and_score$ext $tractogram $config_file_segmentation $out_dir --no_empty \
--gt_dir $scoring_data --reference $ref --json_prefix tmp_ --no_bbox_check;

echo '------------- Merging CC sub-bundles ------------'
CC_files=$(ls $out_dir/segmented_VB/CC* 2> /dev/null)
if [ "$CC_files" != '' ]
then
scil_tractogram_math lazy_concatenate $CC_files $out_dir/segmented_VB/CC_VS.trk;
scil_tractogram_math$ext lazy_concatenate $CC_files $out_dir/segmented_VB/CC_VS.trk;
fi
echo '------------- Merging ICP left sub-bundles ------------'
ICP_left_files=$(ls $out_dir/segmented_VB/ICP_left* 2> /dev/null)
if [ "$ICP_left_files" != '' ]
then
scil_tractogram_math lazy_concatenate $ICP_left_files $out_dir/segmented_VB/ICP_left_VS.trk;
scil_tractogram_math$ext lazy_concatenate $ICP_left_files $out_dir/segmented_VB/ICP_left_VS.trk;
fi
echo '------------- Merging ICP right sub-bundles ------------'
ICP_right_files=$(ls $out_dir/segmented_VB/ICP_right* 2> /dev/null)
if [ "$ICP_right_files" != '' ]
then
scil_tractogram_math lazy_concatenate $ICP_right_files $out_dir/segmented_VB/ICP_right_VS.trk;
scil_tractogram_math$ext lazy_concatenate $ICP_right_files $out_dir/segmented_VB/ICP_right_VS.trk;
fi

echo '------------- FINAL SCORING ------------'
scil_bundle_score_many_bundles_one_tractogram $config_file_tractometry $out_dir \
scil_bundle_score_many_bundles_one_tractogram$ext $config_file_tractometry $out_dir \
--gt_dir $scoring_data --reference $ref --no_bbox_check -v

cat $out_dir/results.json
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ ae_train_model = "dwi_ml.cli.ae_train_model:main"
dwiml_compute_connectivity_matrix_from_blocs = "dwi_ml.cli.dwiml_compute_connectivity_matrix_from_blocs:main"
dwiml_compute_connectivity_matrix_from_labels = "dwi_ml.cli.dwiml_compute_connectivity_matrix_from_labels:main"
dwiml_compute_connectivity_score = "dwi_ml.cli.dwiml_compute_connectivity_score:main"
dwiml_compute_loss_copy_previous = "dwi_ml.cli.dwiml_compute_loss_copy_previous:main"
dwiml_create_hdf5_dataset = "dwi_ml.cli.dwiml_create_hdf5_dataset:main"
dwiml_divide_volume_into_blocs = "dwi_ml.cli.dwiml_divide_volume_into_blocs:main"
dwiml_hdf5_extract_data = "dwi_ml.cli.dwiml_hdf5_extract_data:main"
Expand All @@ -76,5 +75,6 @@ l2t_visualize_weights_evolution = "dwi_ml.cli.l2t_visualize_weights_evolution:ma
tt_resume_training_from_checkpoint = "dwi_ml.cli.tt_resume_training_from_checkpoint:main"
tt_track_from_model = "dwi_ml.cli.tt_track_from_model:main"
tt_train_model = "dwi_ml.cli.tt_train_model:main"
tt_update_deprecated_exp = "dwi_ml.cli.tt_update_deprecated_exp:main"
tt_visualize_loss = "dwi_ml.cli.tt_visualize_loss:main"
tt_visualize_weights = "dwi_ml.cli.tt_visualize_weights:main"
77 changes: 0 additions & 77 deletions src/dwi_ml/cli/dwiml_compute_loss_copy_previous.py

This file was deleted.

13 changes: 7 additions & 6 deletions src/dwi_ml/cli/dwiml_send_value_to_comet_from_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ def _build_arg_parser():
help="Comet.ml's metric name(s). Must contain the same "
"number of inputs as --logs.\n"
"If not set, we will suggest you the probable name(s) "
"but we will not run the script.")
p.add_argument('--use_suggested_name', action='store_true',
help="If set and --metric_name is not set, will run with "
"the suggested name(s).")
"but we will not run the script, unless you add "
"--use_suggested_names")
p.add_argument('--use_suggested_names', action='store_true',
help="If set and --metric_names is not set, guess the "
"metric names.")
p.add_argument('--use_best', action='store_true',
help="If set, uses only the best value in segment [0, t] "
"as value at time t. (Best = lowest).")
Expand Down Expand Up @@ -67,7 +68,7 @@ def main():
if args.use_best:
print("Not sure what to suggest you for --metric_name with "
"option --use_best. Probably 'best_loss'!?")
args.use_suggested_name = False
args.use_suggested_names = False
else:
for log in log_paths:
# Based on current implementation of things:
Expand All @@ -91,7 +92,7 @@ def main():
args.metric_names.append(metric_name)

# Possibly stop now
if not args.use_suggested_name:
if not args.use_suggested_names:
return

# Verify
Expand Down
Loading
Loading