Closed kevinyamauchi closed 7 months ago
I need to cut a new release of napari-animation napari-threedee for this PR to work. I will do so this week.
sorry, do you mean a new release of napari-threedee? 🙂
Sorry - yes!
Test fails are due to hard-coded PyQt5 import, I have made a PR upstream to fix: https://github.com/napari-threedee/napari-threedee/pull/147
Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
521d0b3
) 86.23% compared to head (3d27ee4
) 86.36%.
Files | Patch % | Lines |
---|---|---|
napari_animation/_qt/camera_spline_widget.py | 93.33% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Maybe I'm not using it properly, but I used the camera spline path to make a spline path and that works (modulo the broken set from current view
button). I then tried to add keyframes and I get a Traceback:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Looks like what I implemented in:
https://github.com/napari/napari-animation/pull/181
doesn't cover path_id
and spline_color
properly.
Edit:
Aha, they're features in the points layer:
viewer.layers['n3d paths'].as_layer_data_tuple()
(array([[ 63. , 77.71789097, 64.83292989],
[ 63. , 109.17496836, 37.81894252],
[ 63. , 19.60227341, 98.4226905 ],
[ 76. , 83.93821701, 102.86578053],
[ 76. , 108.99724476, 71.76415033],
[ 76. , 62.25593767, 21.46837122]]),
{'name': 'n3d paths',
'metadata': {'n3d_metadata': {'annotation_type': 'path'}},
'scale': [1.0, 1.0, 1.0],
'translate': [0.0, 0.0, 0.0],
'rotate': [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
'shear': [0.0, 0.0, 0.0],
'affine': array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]),
'opacity': 1.0,
'blending': 'translucent',
'visible': True,
'experimental_clipping_planes': [],
'symbol': array([<Symbol.DISC: 'disc'>, <Symbol.DISC: 'disc'>,
<Symbol.DISC: 'disc'>, <Symbol.DISC: 'disc'>,
<Symbol.DISC: 'disc'>, <Symbol.DISC: 'disc'>], dtype=object),
'edge_width': array([0.05, 0.05, 0.05, 0.05, 0.05, 0.05]),
'edge_width_is_relative': True,
'face_color': array([[0.12156863, 0.46666667, 0.7058824 , 1. ],
[0.12156863, 0.46666667, 0.7058824 , 1. ],
[0.12156863, 0.46666667, 0.7058824 , 1. ],
[0.12156863, 0.46666667, 0.7058824 , 1. ],
[0.12156863, 0.46666667, 0.7058824 , 1. ],
[0.12156863, 0.46666667, 0.7058824 , 1. ]], dtype=float32),
'face_color_cycle': array([[0.12156863, 0.46666667, 0.7058824 , 1. ],
[1. , 0.49803922, 0.05490196, 1. ],
[0.17254902, 0.627451 , 0.17254902, 1. ],
[0.8392157 , 0.15294118, 0.15686275, 1. ],
[0.5803922 , 0.40392157, 0.7411765 , 1. ],
[0.54901963, 0.3372549 , 0.29411766, 1. ],
[0.8901961 , 0.46666667, 0.7607843 , 1. ],
[0.49803922, 0.49803922, 0.49803922, 1. ],
[0.7372549 , 0.7411765 , 0.13333334, 1. ],
[0.09019608, 0.74509805, 0.8117647 , 1. ]], dtype=float32),
'face_colormap': 'viridis',
'face_contrast_limits': None,
'edge_color': array([[0.41176471, 0.41176471, 0.41176471, 1. ],
[0.41176471, 0.41176471, 0.41176471, 1. ],
[0.41176471, 0.41176471, 0.41176471, 1. ],
[0.41176471, 0.41176471, 0.41176471, 1. ],
[0.41176471, 0.41176471, 0.41176471, 1. ],
[0.41176471, 0.41176471, 0.41176471, 1. ]]),
'edge_color_cycle': array([[1., 1., 1., 1.]], dtype=float32),
'edge_colormap': 'viridis',
'edge_contrast_limits': None,
'properties': {'path_id': array([0, 0, 0, 0, 0, 0]),
'spline_color': array([array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32),
array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32),
array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32),
array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32),
array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32),
array([0.12156863, 0.46666667, 0.7058824 , 1. ], dtype=float32)],
dtype=object)},
'property_choices': {},
'text': {'string': {'constant': array('', dtype='<U1'),
'encoding_type': 'ConstantStringEncoding'},
'color': {'constant': array([0., 1., 1., 1.], dtype=float32),
'encoding_type': 'ConstantColorEncoding'},
'visible': True,
'size': 12,
'blending': <Blending.TRANSLUCENT: 'translucent'>,
'anchor': <Anchor.CENTER: 'center'>,
'translation': array(0.),
'rotation': 0.0},
'out_of_slice_display': False,
'n_dimensional': False,
'size': array([10, 10, 10, 10, 10, 10]),
'ndim': 3,
'features': path_id spline_color
0 0 [0.12156863, 0.46666667, 0.7058824, 1.0]
1 0 [0.12156863, 0.46666667, 0.7058824, 1.0]
2 0 [0.12156863, 0.46666667, 0.7058824, 1.0]
3 0 [0.12156863, 0.46666667, 0.7058824, 1.0]
4 0 [0.12156863, 0.46666667, 0.7058824, 1.0]
5 0 [0.12156863, 0.46666667, 0.7058824, 1.0],
'feature_defaults': path_id spline_color
0 0 NaN,
'shading': <Shading.NONE: 'none'>,
'antialiasing': 1,
'canvas_size_limits': (2.0, 10000.0),
'shown': array([ True, True, True, True, True, True])},
'points')
...and features are Pandas:
type(viewer.layers['n3d paths'].as_layer_data_tuple()[1]['features'])
Out[8]: pandas.core.frame.DataFrame
Thanks for the feedback @psobolewskiPhD ! This might be related to the properties -> features migration on the napari side.
Unfortunately, I don't think I will have the time to push this across the line in the coming weeks, so I think it's best that we close this PR for now. Hopefully I (or someone else) can pick it up in the future!
This PR adds a widget for annotating a spline path through the data and then using it to set the camera path.