0x00b1 / napari-features

A feature extraction plugin for Napari
MIT License
7 stars 4 forks source link

Bug if labels are non-sequential #9

Open sofroniewn opened 3 years ago

sofroniewn commented 3 years ago

If you run python examples/add_labels.py from the main napari repo you get an example with 8 coins painted colors. If you run the featurizer you get 8 rows, one for each label.

If you now though set the layer.selected_label = 10 (either from GUI/ of console) and paint a label 10 and run the featurizer you get an error, presumable because the missing 9. If you paint some 9 it then works

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/magicgui/widgets/_bases/value_widget.py in _on_value_change(self=PushButton(value=False, annotation=None, name='call_button'), *args=(False,))
     53     def _on_value_change(self, *args):
     54         """Called when the widget value changes.  args come from the widget itself."""
---> 55         self.changed(value=args[0] if args else None)
        self.changed = 
        global value = undefined
        args = (False,)
     56 
     57     def get_value(self):

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/events.py in __call__(self=, *args=(), **kwargs={'value': False})
    651                     continue
    652 
--> 653                 self._invoke_callback(cb, event)
        self._invoke_callback = >
        cb = ._disable_button_and_call at 0x7f8d7e772320>
        event = 
    654                 if event.blocked:
    655                     break

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/events.py in _invoke_callback(self=, cb=._disable_button_and_call>, event=)
    676                 self.print_callback_errors,
    677                 self,
--> 678                 cb_event=(cb, event),
        global cb_event = undefined
        cb = ._disable_button_and_call at 0x7f8d7e772320>
        event = 
    679             )
    680 

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/events.py in _handle_exception(ignore_callback_errors=False, print_callback_errors='reminders', obj=, cb_event=(._disable_button_and_call>, ), node=None)
    139     # Handle
    140     if value and not ignore_callback_errors:
--> 141         raise value
        value = TypeError("'NoneType' object is not subscriptable")
    142     if print_callback_errors != "never":
    143         this_print: Optional[str] = "full"

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/events.py in _invoke_callback(self=, cb=._disable_button_and_call>, event=)
    670     def _invoke_callback(self, cb: Callback, event: Event):
    671         try:
--> 672             cb(event)
        cb = ._disable_button_and_call at 0x7f8d7e772320>
        event = 
    673         except Exception:
    674             _handle_exception(

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/widgets/_function_gui.py in _disable_button_and_call(val=)
    185                     self._call_button.enabled = False
    186                     try:
--> 187                         self.__call__()
        global self.__call__ = undefined
    188                     finally:
    189                         self._call_button.enabled = True

~/opt/anaconda3/lib/python3.7/site-packages/magicgui/widgets/_function_gui.py in __call__(self=>}))>, *args=(), **kwargs={})
    283         self._tqdm_depth = 0  # reset the tqdm stack count
    284         with _function_name_pointing_to_widget(self):
--> 285             value = self._function(*bound.args, **bound.kwargs)
        value = undefined
        self._function = 
        bound.args = (, , Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 101.0, 141.5), zoom=1.5806700437485608, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=False), cursor=Cursor(position=(275.60950407255234, 286.691599405443), scaled=True, size=10, style=), dims=Dims(ndim=2, ndisplay=2, last_used=1, range=((0.0, 202.0, 1.0), (0.0, 283.0, 1.0)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[, ], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='hold  to pan/zoom, hold  to toggle preserve_labels, hold  to fill, hold  to erase, drag to paint a label', status='segmentation [276 287]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >}))
        bound.kwargs = {}
    286 
    287         self._call_count += 1

~/GitHub/napari-features/napari_features/_features.py in features(image=, masks=, viewer=Viewer(axes=Axes(visible=False, labels=True, col...t.qt_viewer.QtViewer object at 0x7f8d905e2a50>>}))
     26     generator = Generator(masks.data, image.data, feature_selection_widget.selected)
     27 
---> 28     data = pandas.DataFrame([feature for feature in generator], columns=generator.columns)
        data = undefined
        global pandas.DataFrame = 
        global feature = undefined
        generator = 
        global columns = undefined
        generator.columns = ['color_image_integrated_intensity', 'color_image_maximum_intensity', 'color_image_mean_intensity', 'color_image_median_absolute_deviation_intensity', 'color_image_median_intensity', 'color_image_minimum_intensity', 'color_image_quantile_1_intensity', 'color_image_quantile_3_intensity', 'color_image_standard_deviation_intensity', 'color_object_center_mass_intensity_x', 'color_object_center_mass_intensity_y', 'color_object_edge_integrated_intensity', 'color_object_edge_maximum_intensity', 'color_object_edge_mean_intensity', 'color_object_edge_median_intensity', 'color_object_edge_minimum_intensity', 'color_object_edge_quantile_1_intensity', 'color_object_edge_quantile_3_intensity', 'color_object_edge_standard_deviation_intensity', 'color_object_integrated_intensity', 'color_object_mass_displacement', 'color_object_maximum_intensity', 'color_object_maximum_intensity_x', 'color_object_maximum_intensity_y', 'color_object_mean_intensity', 'color_object_median_absolute_deviation_intensity', 'color_object_median_intensity', 'color_object_minimum_intensity', 'color_object_quantile_1_intensity', 'color_object_quantile_3_intensity', 'color_object_standard_deviation_intensity', 'location_object_neighborhood_angle', 'location_object_neighborhood_closest_0_distance', 'location_object_neighborhood_closest_0_object_index', 'location_object_neighborhood_closest_1_distance', 'location_object_neighborhood_closest_1_object_index', 'location_object_neighborhood_closest_2_distance', 'location_object_neighborhood_closest_2_object_index', 'location_object_neighborhood_neighbors', 'location_object_neighborhood_touching', 'metadata_image_checksum', 'metadata_image_filename', 'metadata_layer_name', 'metadata_layer_type', 'metadata_object_index', 'shape_image_area', 'shape_image_skeleton_branches', 'shape_image_skeleton_endpoints', 'shape_image_skeleton_length', 'shape_image_skeleton_trunks', 'shape_object_area', 'shape_object_bounding_box_area', 'shape_object_bounding_box_maximum_x', 'shape_object_bounding_box_maximum_y', 'shape_object_bounding_box_maximum_z', 'shape_object_bounding_box_minimum_x', 'shape_object_bounding_box_minimum_y', 'shape_object_bounding_box_minimum_z', 'shape_object_central_moment_0_0_0', 'shape_object_central_moment_0_0_1', 'shape_object_central_moment_0_0_2', 'shape_object_central_moment_0_0_3', 'shape_object_central_moment_0_1_0', 'shape_object_central_moment_0_1_1', 'shape_object_central_moment_0_1_2', 'shape_object_central_moment_0_1_3', 'shape_object_central_moment_0_2_0', 'shape_object_central_moment_0_2_1', 'shape_object_central_moment_0_2_2', 'shape_object_central_moment_0_2_3', 'shape_object_central_moment_0_3_0', 'shape_object_central_moment_0_3_1', 'shape_object_central_moment_0_3_2', 'shape_object_central_moment_0_3_3', 'shape_object_central_moment_1_0_0', 'shape_object_central_moment_1_0_1', 'shape_object_central_moment_1_0_2', 'shape_object_central_moment_1_0_3', 'shape_object_central_moment_1_1_0', 'shape_object_central_moment_1_1_1', 'shape_object_central_moment_1_1_2', 'shape_object_central_moment_1_1_3', 'shape_object_central_moment_1_2_0', 'shape_object_central_moment_1_2_1', 'shape_object_central_moment_1_2_2', 'shape_object_central_moment_1_2_3', 'shape_object_central_moment_1_3_0', 'shape_object_central_moment_1_3_1', 'shape_object_central_moment_1_3_2', 'shape_object_central_moment_1_3_3', 'shape_object_central_moment_2_0_0', 'shape_object_central_moment_2_0_1', 'shape_object_central_moment_2_0_2', 'shape_object_central_moment_2_0_3', 'shape_object_central_moment_2_1_0', 'shape_object_central_moment_2_1_1', 'shape_object_central_moment_2_1_2', 'shape_object_central_moment_2_1_3', 'shape_object_central_moment_2_2_0', 'shape_object_central_moment_2_2_1', 'shape_object_central_moment_2_2_2', 'shape_object_central_moment_2_2_3', 'shape_object_central_moment_2_3_0', 'shape_object_central_moment_2_3_1', 'shape_object_central_moment_2_3_2', 'shape_object_central_moment_2_3_3', 'shape_object_central_moment_3_0_0', 'shape_object_central_moment_3_0_1', 'shape_object_central_moment_3_0_2', 'shape_object_central_moment_3_0_3', 'shape_object_central_moment_3_1_0', 'shape_object_central_moment_3_1_1', 'shape_object_central_moment_3_1_2', 'shape_object_central_moment_3_1_3', 'shape_object_central_moment_3_2_0', 'shape_object_central_moment_3_2_1', 'shape_object_central_moment_3_2_2', 'shape_object_central_moment_3_2_3', 'shape_object_central_moment_3_3_0', 'shape_object_central_moment_3_3_1', 'shape_object_central_moment_3_3_2', 'shape_object_central_moment_3_3_3', 'shape_object_centroid_x', 'shape_object_centroid_y', 'shape_object_centroid_z', 'shape_object_compactness', 'shape_object_eccentricity', 'shape_object_elongation', 'shape_object_equivalent_diameter', 'shape_object_euler_number', 'shape_object_extent', 'shape_object_form_factor', 'shape_object_hu_moment_0', 'shape_object_hu_moment_1', 'shape_object_hu_moment_2', 'shape_object_hu_moment_3', 'shape_object_hu_moment_4', 'shape_object_hu_moment_5', 'shape_object_hu_moment_6', 'shape_object_inertia_tensor_eigenvalues_x', 'shape_object_inertia_tensor_eigenvalues_y', 'shape_object_inertia_tensor_eigenvalues_z', 'shape_object_inertia_tensor_x_x', 'shape_object_inertia_tensor_x_y', 'shape_object_inertia_tensor_x_z', 'shape_object_inertia_tensor_y_x', 'shape_object_inertia_tensor_y_y', 'shape_object_inertia_tensor_y_z', 'shape_object_inertia_tensor_z_x', 'shape_object_inertia_tensor_z_y', 'shape_object_inertia_tensor_z_z', 'shape_object_major_axis_length', 'shape_object_maximum_feret_diameter', 'shape_object_maximum_radius', 'shape_object_mean_radius', 'shape_object_median_radius', 'shape_object_minimum_feret_diameter', 'shape_object_minor_axis_length', 'shape_object_normalized_moment_x_y', 'shape_object_orientation', 'shape_object_perimeter', 'shape_object_skeleton_branches', 'shape_object_skeleton_endpoints', 'shape_object_skeleton_length', 'shape_object_skeleton_trunks', 'shape_object_solidity', 'shape_object_spatial_moment_0_0_0', 'shape_object_spatial_moment_0_0_1', 'shape_object_spatial_moment_0_0_2', 'shape_object_spatial_moment_0_0_3', 'shape_object_spatial_moment_0_1_0', 'shape_object_spatial_moment_0_1_1', 'shape_object_spatial_moment_0_1_2', 'shape_object_spatial_moment_0_1_3', 'shape_object_spatial_moment_0_2_0', 'shape_object_spatial_moment_0_2_1', 'shape_object_spatial_moment_0_2_2', 'shape_object_spatial_moment_0_2_3', 'shape_object_spatial_moment_0_3_0', 'shape_object_spatial_moment_0_3_1', 'shape_object_spatial_moment_0_3_2', 'shape_object_spatial_moment_0_3_3', 'shape_object_spatial_moment_1_0_0', 'shape_object_spatial_moment_1_0_1', 'shape_object_spatial_moment_1_0_2', 'shape_object_spatial_moment_1_0_3', 'shape_object_spatial_moment_1_1_0', 'shape_object_spatial_moment_1_1_1', 'shape_object_spatial_moment_1_1_2', 'shape_object_spatial_moment_1_1_3', 'shape_object_spatial_moment_1_2_0', 'shape_object_spatial_moment_1_2_1', 'shape_object_spatial_moment_1_2_2', 'shape_object_spatial_moment_1_2_3', 'shape_object_spatial_moment_1_3_0', 'shape_object_spatial_moment_1_3_1', 'shape_object_spatial_moment_1_3_2', 'shape_object_spatial_moment_1_3_3', 'shape_object_spatial_moment_2_0_0', 'shape_object_spatial_moment_2_0_1', 'shape_object_spatial_moment_2_0_2', 'shape_object_spatial_moment_2_0_3', 'shape_object_spatial_moment_2_1_0', 'shape_object_spatial_moment_2_1_1', 'shape_object_spatial_moment_2_1_2', 'shape_object_spatial_moment_2_1_3', 'shape_object_spatial_moment_2_2_0', 'shape_object_spatial_moment_2_2_1', 'shape_object_spatial_moment_2_2_2', 'shape_object_spatial_moment_2_2_3', 'shape_object_spatial_moment_2_3_0', 'shape_object_spatial_moment_2_3_1', 'shape_object_spatial_moment_2_3_2', 'shape_object_spatial_moment_2_3_3', 'shape_object_spatial_moment_3_0_0', 'shape_object_spatial_moment_3_0_1', 'shape_object_spatial_moment_3_0_2', 'shape_object_spatial_moment_3_0_3', 'shape_object_spatial_moment_3_1_0', 'shape_object_spatial_moment_3_1_1', 'shape_object_spatial_moment_3_1_2', 'shape_object_spatial_moment_3_1_3', 'shape_object_spatial_moment_3_2_0', 'shape_object_spatial_moment_3_2_1', 'shape_object_spatial_moment_3_2_2', 'shape_object_spatial_moment_3_2_3', 'shape_object_spatial_moment_3_3_0', 'shape_object_spatial_moment_3_3_1', 'shape_object_spatial_moment_3_3_2', 'shape_object_spatial_moment_3_3_3', 'shape_object_surface_area', 'shape_object_volume', 'texture_object_haralick_angular_second_moment', 'texture_object_haralick_contrast', 'texture_object_haralick_coorelation', 'texture_object_haralick_difference_variance', 'texture_object_haralick_entropy', 'texture_object_haralick_inverse_difference_moment', 'texture_object_haralick_maximum_correlation_coefficient', 'texture_object_haralick_measure_of_correlation_0', 'texture_object_haralick_measure_of_correlation_1', 'texture_object_haralick_sum_average', 'texture_object_haralick_sum_entropy', 'texture_object_haralick_sum_of_squares_variance', 'texture_object_haralick_sum_variance']
     29 
     30     data["_feature_metadata_image_filename"] = image.source.path

~/GitHub/napari-features/napari_features/_features.py in (.0=)
     26     generator = Generator(masks.data, image.data, feature_selection_widget.selected)
     27 
---> 28     data = pandas.DataFrame([feature for feature in generator], columns=generator.columns)
        global data = undefined
        global pandas.DataFrame = 
        feature = [20686.81, 0.98823535, 0.35882208, 0.125490203499794, 0.26666668, 0.027450982, 0.16862745583057404, 0.5764706134796143, 0.23214705, nan, nan, 18.203922, 0.43137258, 0.0122833485, 0.0, 0.0, 0.0, 0.0, 0.05656721, 802.1687, nan, 0.9686275, 75, 15, 0.5412744, 0.08627450466156006, 0.6666667, 0.0, 0.5058823823928833, 0.7372549176216125, 0.30026674, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, 1, 57652, nan, nan, nan, nan, 1155, 1482, 167, 124, nan, 129, 85, nan, 204553.0, -1.4199486031429842e-10, 20197364.734694675, -4916058.346658073, 2.432898327242583e-10, -122410.80023759128, -368455.4140558587, 25774270.237857383, 18185185.985724974, -1971701.6669830305, 1187665657.3161967, -312454851.2796402, 384237.74950417585, -39580986.96310945, 248823345.92295143, -2178565955.250059, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 230.0, 226.5, nan, 45.079229355316635, 0.9679182501871775, 1.0263157894736843, 267.99420933934573, 9, 0.9784222576840352, nan, 0.15932337697222165, 2.6970573040853915e-05, 5.3072853349044e-07, 1.9280866045860786e-10, -1.7930606402072417e-18, -9.293627993156528e-13, 7.674859152665665e-19, 95.00839252472417, 89.01010787819187, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, 38.98889945094099, nan, nan, nan, nan, nan, 37.73806733327861, nan, 1.5283667840580495, 125.39696961966999, nan, nan, nan, nan, nan, 204553.0, 3910977.0, 94973785.0, 2583279405.0, 3812893.0, 72778680.0, 1765273644.0, 48023039400.0, 89257979.0, 1700044032.0, 40570844724.0, 1085490922032.0, 2342112103.0, 44502873396.0, 1042663336044.0, 27345844460640.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]
        global generator = undefined
        global columns = undefined
        global generator.columns = undefined
     29 
     30     data["_feature_metadata_image_filename"] = image.source.path

~/GitHub/napari-features/napari_features/generator.py in __next__(self=)
     58             raise StopIteration
     59 
---> 60         features = [getattr(self, member) for member in self._members]
        features = undefined
        global getattr = undefined
        self = 
        global member = undefined
        self._members = ['_feature_color_image_integrated_intensity', '_feature_color_image_maximum_intensity', '_feature_color_image_mean_intensity', '_feature_color_image_median_absolute_deviation_intensity', '_feature_color_image_median_intensity', '_feature_color_image_minimum_intensity', '_feature_color_image_quantile_1_intensity', '_feature_color_image_quantile_3_intensity', '_feature_color_image_standard_deviation_intensity', '_feature_color_object_center_mass_intensity_x', '_feature_color_object_center_mass_intensity_y', '_feature_color_object_edge_integrated_intensity', '_feature_color_object_edge_maximum_intensity', '_feature_color_object_edge_mean_intensity', '_feature_color_object_edge_median_intensity', '_feature_color_object_edge_minimum_intensity', '_feature_color_object_edge_quantile_1_intensity', '_feature_color_object_edge_quantile_3_intensity', '_feature_color_object_edge_standard_deviation_intensity', '_feature_color_object_integrated_intensity', '_feature_color_object_mass_displacement', '_feature_color_object_maximum_intensity', '_feature_color_object_maximum_intensity_x', '_feature_color_object_maximum_intensity_y', '_feature_color_object_mean_intensity', '_feature_color_object_median_absolute_deviation_intensity', '_feature_color_object_median_intensity', '_feature_color_object_minimum_intensity', '_feature_color_object_quantile_1_intensity', '_feature_color_object_quantile_3_intensity', '_feature_color_object_standard_deviation_intensity', '_feature_location_object_neighborhood_angle', '_feature_location_object_neighborhood_closest_0_distance', '_feature_location_object_neighborhood_closest_0_object_index', '_feature_location_object_neighborhood_closest_1_distance', '_feature_location_object_neighborhood_closest_1_object_index', '_feature_location_object_neighborhood_closest_2_distance', '_feature_location_object_neighborhood_closest_2_object_index', '_feature_location_object_neighborhood_neighbors', '_feature_location_object_neighborhood_touching', '_feature_metadata_image_checksum', '_feature_metadata_image_filename', '_feature_metadata_layer_name', '_feature_metadata_layer_type', '_feature_metadata_object_index', '_feature_shape_image_area', '_feature_shape_image_skeleton_branches', '_feature_shape_image_skeleton_endpoints', '_feature_shape_image_skeleton_length', '_feature_shape_image_skeleton_trunks', '_feature_shape_object_area', '_feature_shape_object_bounding_box_area', '_feature_shape_object_bounding_box_maximum_x', '_feature_shape_object_bounding_box_maximum_y', '_feature_shape_object_bounding_box_maximum_z', '_feature_shape_object_bounding_box_minimum_x', '_feature_shape_object_bounding_box_minimum_y', '_feature_shape_object_bounding_box_minimum_z', '_feature_shape_object_central_moment_0_0_0', '_feature_shape_object_central_moment_0_0_1', '_feature_shape_object_central_moment_0_0_2', '_feature_shape_object_central_moment_0_0_3', '_feature_shape_object_central_moment_0_1_0', '_feature_shape_object_central_moment_0_1_1', '_feature_shape_object_central_moment_0_1_2', '_feature_shape_object_central_moment_0_1_3', '_feature_shape_object_central_moment_0_2_0', '_feature_shape_object_central_moment_0_2_1', '_feature_shape_object_central_moment_0_2_2', '_feature_shape_object_central_moment_0_2_3', '_feature_shape_object_central_moment_0_3_0', '_feature_shape_object_central_moment_0_3_1', '_feature_shape_object_central_moment_0_3_2', '_feature_shape_object_central_moment_0_3_3', '_feature_shape_object_central_moment_1_0_0', '_feature_shape_object_central_moment_1_0_1', '_feature_shape_object_central_moment_1_0_2', '_feature_shape_object_central_moment_1_0_3', '_feature_shape_object_central_moment_1_1_0', '_feature_shape_object_central_moment_1_1_1', '_feature_shape_object_central_moment_1_1_2', '_feature_shape_object_central_moment_1_1_3', '_feature_shape_object_central_moment_1_2_0', '_feature_shape_object_central_moment_1_2_1', '_feature_shape_object_central_moment_1_2_2', '_feature_shape_object_central_moment_1_2_3', '_feature_shape_object_central_moment_1_3_0', '_feature_shape_object_central_moment_1_3_1', '_feature_shape_object_central_moment_1_3_2', '_feature_shape_object_central_moment_1_3_3', '_feature_shape_object_central_moment_2_0_0', '_feature_shape_object_central_moment_2_0_1', '_feature_shape_object_central_moment_2_0_2', '_feature_shape_object_central_moment_2_0_3', '_feature_shape_object_central_moment_2_1_0', '_feature_shape_object_central_moment_2_1_1', '_feature_shape_object_central_moment_2_1_2', '_feature_shape_object_central_moment_2_1_3', '_feature_shape_object_central_moment_2_2_0', '_feature_shape_object_central_moment_2_2_1', '_feature_shape_object_central_moment_2_2_2', '_feature_shape_object_central_moment_2_2_3', '_feature_shape_object_central_moment_2_3_0', '_feature_shape_object_central_moment_2_3_1', '_feature_shape_object_central_moment_2_3_2', '_feature_shape_object_central_moment_2_3_3', '_feature_shape_object_central_moment_3_0_0', '_feature_shape_object_central_moment_3_0_1', '_feature_shape_object_central_moment_3_0_2', '_feature_shape_object_central_moment_3_0_3', '_feature_shape_object_central_moment_3_1_0', '_feature_shape_object_central_moment_3_1_1', '_feature_shape_object_central_moment_3_1_2', '_feature_shape_object_central_moment_3_1_3', '_feature_shape_object_central_moment_3_2_0', '_feature_shape_object_central_moment_3_2_1', '_feature_shape_object_central_moment_3_2_2', '_feature_shape_object_central_moment_3_2_3', '_feature_shape_object_central_moment_3_3_0', '_feature_shape_object_central_moment_3_3_1', '_feature_shape_object_central_moment_3_3_2', '_feature_shape_object_central_moment_3_3_3', '_feature_shape_object_centroid_x', '_feature_shape_object_centroid_y', '_feature_shape_object_centroid_z', '_feature_shape_object_compactness', '_feature_shape_object_eccentricity', '_feature_shape_object_elongation', '_feature_shape_object_equivalent_diameter', '_feature_shape_object_euler_number', '_feature_shape_object_extent', '_feature_shape_object_form_factor', '_feature_shape_object_hu_moment_0', '_feature_shape_object_hu_moment_1', '_feature_shape_object_hu_moment_2', '_feature_shape_object_hu_moment_3', '_feature_shape_object_hu_moment_4', '_feature_shape_object_hu_moment_5', '_feature_shape_object_hu_moment_6', '_feature_shape_object_inertia_tensor_eigenvalues_x', '_feature_shape_object_inertia_tensor_eigenvalues_y', '_feature_shape_object_inertia_tensor_eigenvalues_z', '_feature_shape_object_inertia_tensor_x_x', '_feature_shape_object_inertia_tensor_x_y', '_feature_shape_object_inertia_tensor_x_z', '_feature_shape_object_inertia_tensor_y_x', '_feature_shape_object_inertia_tensor_y_y', '_feature_shape_object_inertia_tensor_y_z', '_feature_shape_object_inertia_tensor_z_x', '_feature_shape_object_inertia_tensor_z_y', '_feature_shape_object_inertia_tensor_z_z', '_feature_shape_object_major_axis_length', '_feature_shape_object_maximum_feret_diameter', '_feature_shape_object_maximum_radius', '_feature_shape_object_mean_radius', '_feature_shape_object_median_radius', '_feature_shape_object_minimum_feret_diameter', '_feature_shape_object_minor_axis_length', '_feature_shape_object_normalized_moment_x_y', '_feature_shape_object_orientation', '_feature_shape_object_perimeter', '_feature_shape_object_skeleton_branches', '_feature_shape_object_skeleton_endpoints', '_feature_shape_object_skeleton_length', '_feature_shape_object_skeleton_trunks', '_feature_shape_object_solidity', '_feature_shape_object_spatial_moment_0_0_0', '_feature_shape_object_spatial_moment_0_0_1', '_feature_shape_object_spatial_moment_0_0_2', '_feature_shape_object_spatial_moment_0_0_3', '_feature_shape_object_spatial_moment_0_1_0', '_feature_shape_object_spatial_moment_0_1_1', '_feature_shape_object_spatial_moment_0_1_2', '_feature_shape_object_spatial_moment_0_1_3', '_feature_shape_object_spatial_moment_0_2_0', '_feature_shape_object_spatial_moment_0_2_1', '_feature_shape_object_spatial_moment_0_2_2', '_feature_shape_object_spatial_moment_0_2_3', '_feature_shape_object_spatial_moment_0_3_0', '_feature_shape_object_spatial_moment_0_3_1', '_feature_shape_object_spatial_moment_0_3_2', '_feature_shape_object_spatial_moment_0_3_3', '_feature_shape_object_spatial_moment_1_0_0', '_feature_shape_object_spatial_moment_1_0_1', '_feature_shape_object_spatial_moment_1_0_2', '_feature_shape_object_spatial_moment_1_0_3', '_feature_shape_object_spatial_moment_1_1_0', '_feature_shape_object_spatial_moment_1_1_1', '_feature_shape_object_spatial_moment_1_1_2', '_feature_shape_object_spatial_moment_1_1_3', '_feature_shape_object_spatial_moment_1_2_0', '_feature_shape_object_spatial_moment_1_2_1', '_feature_shape_object_spatial_moment_1_2_2', '_feature_shape_object_spatial_moment_1_2_3', '_feature_shape_object_spatial_moment_1_3_0', '_feature_shape_object_spatial_moment_1_3_1', '_feature_shape_object_spatial_moment_1_3_2', '_feature_shape_object_spatial_moment_1_3_3', '_feature_shape_object_spatial_moment_2_0_0', '_feature_shape_object_spatial_moment_2_0_1', '_feature_shape_object_spatial_moment_2_0_2', '_feature_shape_object_spatial_moment_2_0_3', '_feature_shape_object_spatial_moment_2_1_0', '_feature_shape_object_spatial_moment_2_1_1', '_feature_shape_object_spatial_moment_2_1_2', '_feature_shape_object_spatial_moment_2_1_3', '_feature_shape_object_spatial_moment_2_2_0', '_feature_shape_object_spatial_moment_2_2_1', '_feature_shape_object_spatial_moment_2_2_2', '_feature_shape_object_spatial_moment_2_2_3', '_feature_shape_object_spatial_moment_2_3_0', '_feature_shape_object_spatial_moment_2_3_1', '_feature_shape_object_spatial_moment_2_3_2', '_feature_shape_object_spatial_moment_2_3_3', '_feature_shape_object_spatial_moment_3_0_0', '_feature_shape_object_spatial_moment_3_0_1', '_feature_shape_object_spatial_moment_3_0_2', '_feature_shape_object_spatial_moment_3_0_3', '_feature_shape_object_spatial_moment_3_1_0', '_feature_shape_object_spatial_moment_3_1_1', '_feature_shape_object_spatial_moment_3_1_2', '_feature_shape_object_spatial_moment_3_1_3', '_feature_shape_object_spatial_moment_3_2_0', '_feature_shape_object_spatial_moment_3_2_1', '_feature_shape_object_spatial_moment_3_2_2', '_feature_shape_object_spatial_moment_3_2_3', '_feature_shape_object_spatial_moment_3_3_0', '_feature_shape_object_spatial_moment_3_3_1', '_feature_shape_object_spatial_moment_3_3_2', '_feature_shape_object_spatial_moment_3_3_3', '_feature_shape_object_surface_area', '_feature_shape_object_volume', '_feature_texture_object_haralick_angular_second_moment', '_feature_texture_object_haralick_contrast', '_feature_texture_object_haralick_coorelation', '_feature_texture_object_haralick_difference_variance', '_feature_texture_object_haralick_entropy', '_feature_texture_object_haralick_inverse_difference_moment', '_feature_texture_object_haralick_maximum_correlation_coefficient', '_feature_texture_object_haralick_measure_of_correlation_0', '_feature_texture_object_haralick_measure_of_correlation_1', '_feature_texture_object_haralick_sum_average', '_feature_texture_object_haralick_sum_entropy', '_feature_texture_object_haralick_sum_of_squares_variance', '_feature_texture_object_haralick_sum_variance']
     61 
     62         self.index += 1

~/GitHub/napari-features/napari_features/generator.py in (.0=)
     58             raise StopIteration
     59 
---> 60         features = [getattr(self, member) for member in self._members]
        global features = undefined
        global getattr = undefined
        global self = undefined
        member = '_feature_shape_object_centroid_x'
        global self._members = undefined
     61 
     62         self.index += 1

~/GitHub/napari-features/napari_features/generator.py in _feature_shape_object_centroid_x(self=)
    678     @property
    679     def _feature_shape_object_centroid_x(self):
--> 680         return self.centroid[0]
        self.centroid = undefined
    681 
    682     @property

~/GitHub/napari-features/napari_features/generator.py in centroid(self=)
     82     @property
     83     def centroid(self):
---> 84         return self.coordinates.mean(axis=0)
        self.coordinates.mean = undefined
        global axis = undefined
     85 
     86     @property

~/GitHub/napari-features/napari_features/generator.py in coordinates(self=)
     99 
    100         for index in range(self.masks.ndim):
--> 101             stack += [indices[index] + self.object[index].start]
        stack = []
        indices = ( (57652,) int64,  (57652,) int64)
        index = 0
        self.object = None
        index.start = undefined
    102 
    103         return numpy.vstack(stack).T

TypeError: 'NoneType' object is not subscriptable
0x00b1 commented 3 years ago

Great catch @sofroniewn!