File tree Expand file tree Collapse file tree
src/main/java/org/mastodon/mamut/detection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646import org .mastodon .mamut .model .ModelGraph ;
4747import org .mastodon .mamut .util .ImgUtils ;
4848import org .mastodon .mamut .util .LabelImageUtils ;
49+ import org .mastodon .tracking .detection .AbstractDetectorOp ;
50+ import org .mastodon .tracking .detection .DetectionCreatorFactory ;
4951import org .mastodon .tracking .detection .DetectionUtil ;
5052import org .mastodon .tracking .detection .DetectorKeys ;
5153import org .mastodon .tracking .mamut .detection .AbstractSpotDetectorOp ;
@@ -301,4 +303,22 @@ public Map< String, Object > getDefaultSettings()
301303 protected abstract void addSpecificDefaultSettings ( final Map < String , Object > defaultSettings );
302304
303305 protected abstract String getDetectorName ();
306+
307+ /** Cancels the command execution, with the given reason for doing so. */
308+ @ Override
309+ public void cancel ( final String reason )
310+ {
311+ // this is a workaround to avoid a null pointer exception during the cancel operation
312+ detector = new DummyDetectorOp ();
313+ super .cancel ( reason );
314+ }
315+
316+ private class DummyDetectorOp extends AbstractDetectorOp
317+ {
318+ @ Override
319+ public void mutate1 ( final DetectionCreatorFactory arg , final List < SourceAndConverter < ? > > in )
320+ {
321+ // Do nothing
322+ }
323+ }
304324}
You can’t perform that action at this time.
0 commit comments