@@ -15,6 +15,7 @@ def display(
15
15
):
16
16
"""Plot the flickering panels to show a registration process."""
17
17
from IPython .display import SVG , display as _disp
18
+
18
19
if isinstance (fixed_image , (str , Path )):
19
20
fixed_image = nb .load (str (fixed_image ))
20
21
if isinstance (moving_image , (str , Path )):
@@ -28,24 +29,34 @@ def display(
28
29
cuts = cuts_from_bbox (contour , cuts = n_cuts )
29
30
else :
30
31
hdr = fixed_image .header .copy ()
31
- hdr .set_data_dtype (' uint8' )
32
+ hdr .set_data_dtype (" uint8" )
32
33
mask_nii = nb .Nifti1Image (
33
- np .ones (fixed_image .shape , dtype = ' uint8' ),
34
- fixed_image . affine , hdr )
34
+ np .ones (fixed_image .shape , dtype = " uint8" ), fixed_image . affine , hdr
35
+ )
35
36
cuts = cuts_from_bbox (mask_nii , cuts = n_cuts )
36
37
37
38
# Call composer
38
- _disp (SVG (compose_view (
39
- plot_registration (fixed_image , 'fixed-image' ,
40
- estimate_brightness = True ,
41
- cuts = cuts ,
42
- label = fixed_label ,
43
- contour = contour ,
44
- compress = False ),
45
- plot_registration (moving_image , 'moving-image' ,
46
- estimate_brightness = True ,
47
- cuts = cuts ,
48
- label = moving_label ,
49
- contour = contour ,
50
- compress = False ),
51
- )))
39
+ _disp (
40
+ SVG (
41
+ compose_view (
42
+ plot_registration (
43
+ fixed_image ,
44
+ "fixed-image" ,
45
+ estimate_brightness = True ,
46
+ cuts = cuts ,
47
+ label = fixed_label ,
48
+ contour = contour ,
49
+ compress = False ,
50
+ ),
51
+ plot_registration (
52
+ moving_image ,
53
+ "moving-image" ,
54
+ estimate_brightness = True ,
55
+ cuts = cuts ,
56
+ label = moving_label ,
57
+ contour = contour ,
58
+ compress = False ,
59
+ ),
60
+ )
61
+ )
62
+ )
0 commit comments