Skip to content

Commit ff44804

Browse files
authored
Merge pull request scilus#1297 from EmmaRenauld/small_changes_from_my_tests
Small changes from my tests
2 parents c6a8a5e + f950a6f commit ff44804

4 files changed

Lines changed: 16 additions & 7 deletions

‎src/scilpy/cli/scil_bundle_explore_bundleseg.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,16 @@ def main():
478478
offset = 0
479479
count = 0
480480
for bundle in mapping.keys():
481-
filename = glob.glob(f'{os.path.join(args.in_folder, bundle)}.t?k')[0]
482-
483-
if not os.path.exists(filename):
484-
logging.warning(f'File {filename} not found.')
481+
files = glob.glob(f'{os.path.join(args.in_folder, bundle)}.t?k')
482+
if len(files) == 0:
483+
logging.warning("Could not find any file fitting pattern {}"
484+
.format(os.path.join(args.in_folder, bundle)))
485485
continue
486+
elif len(files) > 1:
487+
logging.warning("Found two files for bundle {}. Selecting the "
488+
"first one. Verify your files!".format(bundle))
489+
490+
filename = files[0]
486491
count += 1
487492

488493
tmp_sft = load_tractogram(filename, ref_img)

‎src/scilpy/cli/scil_tractogram_compute_density_map.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ def main():
7777
transformation, dimensions, _, _ = sft.space_attributes
7878

7979
# Processing
80+
logging.info("Computing density map...")
8081
if args.endpoints_only:
8182
streamline_count = get_endpoints_density_map(sft)
8283
else:
8384
streamline_count = compute_tract_counts_map(sft.streamlines,
8485
dimensions)
8586

8687
# Saving
88+
logging.info("Saving density map {}".format(args.out_img))
8789
dtype_to_use = np.int32
8890
if args.binary is not None:
8991
if args.binary == 1:

‎src/scilpy/cli/scil_tractogram_segment_with_bundleseg.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
add_reference_arg, add_verbose_arg,
5656
assert_inputs_exist,
5757
assert_output_dirs_exist_and_empty,
58-
load_matrix_in_any_format, ranged_type)
58+
load_matrix_in_any_format, ranged_type,
59+
assert_inputs_dirs_exist)
5960
from scilpy.segment.voting_scheme import VotingScheme
6061
from scilpy.version import version_string
6162

@@ -136,6 +137,7 @@ def main():
136137
logging.getLogger().setLevel(logging.getLevelName('INFO'))
137138

138139
# Verifications
140+
assert_inputs_dirs_exist(parser, args.in_directory)
139141
in_models_directories = [
140142
os.path.join(args.in_directory, x)
141143
for x in os.listdir(args.in_directory)

‎src/scilpy/cli/scil_tractogram_segment_with_recobundles.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def main():
112112
if args.tractogram_clustering_thr and args.in_pickle:
113113
parser.error("Option --tractogram_clustering_thr should not be "
114114
"used with --in_pickle.")
115-
else:
116-
# Setting default value. (Will be ignored in args.in_pickle)
115+
elif args.tractogram_clustering_thr is not None:
116+
# Setting default value. (Will be ignored if args.in_pickle)
117117
args.tractogram_clustering_thr = 8.0
118118

119119
# Loading

0 commit comments

Comments
 (0)