diff --git a/starfish/core/spots/AssignTargets/label.py b/starfish/core/spots/AssignTargets/label.py index d627e30c5..cc6fc54c5 100644 --- a/starfish/core/spots/AssignTargets/label.py +++ b/starfish/core/spots/AssignTargets/label.py @@ -61,7 +61,8 @@ def _assign( selectors['z'] = in_bbox.z in_mask = mask.sel(**selectors) spot_ids = in_bbox[Features.SPOT_ID][in_mask.values] - decoded_intensities[Features.CELL_ID].loc[spot_ids] = mask.name + decoded_intensities[Features.CELL_ID].loc[ + decoded_intensities[Features.SPOT_ID].isin(spot_ids)] = mask.name return decoded_intensities diff --git a/starfish/core/spots/DecodeSpots/trace_builders.py b/starfish/core/spots/DecodeSpots/trace_builders.py index e913c7cbb..a41aa1a55 100644 --- a/starfish/core/spots/DecodeSpots/trace_builders.py +++ b/starfish/core/spots/DecodeSpots/trace_builders.py @@ -55,7 +55,10 @@ def build_traces_sequential(spot_results: SpotFindingResults, **kwargs) -> Inten """ - all_spots = pd.concat([sa.spot_attrs.data for sa in spot_results.values()], sort=True) + all_spots = pd.concat([sa.spot_attrs.data for sa in spot_results.values()], + ignore_index=True, sort=True) + # reassign spot_ids to index number so they are unique + all_spots['spot_id'] = all_spots.index intensity_table = IntensityTable.zeros( spot_attributes=SpotAttributes(all_spots),