Skip to content

Commit

Permalink
fix latest scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbore committed Jul 8, 2021
1 parent 960dcd8 commit d258559
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions scripts/scil_analyse_lesions_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def main():
args.out_streamlines_stats])

lesion_img = nib.load(args.in_lesion)
lesion_data = get_data_as_mask(lesion_img, dtype=np.bool)
lesion_data = get_data_as_mask(lesion_img, dtype=bool)

if args.bundle:
bundle_name, _ = split_name_with_nii(os.path.basename(args.bundle))
Expand Down Expand Up @@ -112,7 +112,6 @@ def main():
voxel_sizes=voxel_sizes, min_lesion_vol=args.min_lesion_vol)

if args.out_lesion_atlas:
# lesion_atlas *= map_data.astype(np.bool)
nib.save(nib.Nifti1Image(lesion_atlas, lesion_img.affine),
args.out_lesion_atlas)

Expand Down
4 changes: 2 additions & 2 deletions scripts/scil_compute_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _processing_wrapper(args):
lesion_img.set_filename('tmp.nii.gz')
lesion_atlas = get_data_as_label(lesion_img)
tmp_dict = compute_lesion_stats(
density.astype(np.bool), lesion_atlas,
density.astype(bool), lesion_atlas,
voxel_sizes=voxel_sizes, single_label=True,
min_lesion_vol=min_lesion_vol,
precomputed_lesion_labels=computed_lesion_labels)
Expand Down Expand Up @@ -329,7 +329,7 @@ def main():
if args.lesion_load is not None:
in_name = args.lesion_load[0]
lesion_img = nib.load(in_name)
lesion_data = get_data_as_mask(lesion_img, dtype=np.bool)
lesion_data = get_data_as_mask(lesion_img, dtype=bool)
lesion_atlas, _ = ndi.label(lesion_data)
measures_to_compute.append(((in_name, np.unique(lesion_atlas)[1:]),
nib.Nifti1Image(lesion_atlas,
Expand Down

0 comments on commit d258559

Please sign in to comment.