MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / flush

Method flush

ij/src/main/java/ij/ImagePlus.java:2598–2622  ·  view source on GitHub ↗

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

()

Source from the content-addressed store, hash-verified

2596 /** Sets the ImageProcessor, Roi, AWT Image and stack image
2597 arrays to null. Does nothing if the image is locked. */
2598 public synchronized void flush() {
2599 notifyListeners(CLOSED);
2600 if (locked || ignoreFlush) return;
2601 ip = null;
2602 if (roi!=null) roi.setImage(null);
2603 roi = null;
2604 if (stack!=null && stack.viewers(-1)<=0) {
2605 Object[] arrays = stack.getImageArray();
2606 if (arrays!=null) {
2607 for (int i=0; i<arrays.length; i++)
2608 arrays[i] = null;
2609 }
2610 if (isComposite())
2611 ((CompositeImage)this).setChannelsUpdated(); //flush
2612 }
2613 setStackNull();
2614 img = null;
2615 win = null;
2616 if (roi!=null) roi.setImage(null);
2617 roi = null;
2618 properties = null;
2619 //calibration = null;
2620 overlay = null;
2621 flatteningCanvas = null;
2622 }
2623
2624 public void setIgnoreFlush(boolean ignoreFlush) {
2625 this.ignoreFlush = ignoreFlush;

Callers

nothing calls this directly

Calls 7

notifyListenersMethod · 0.95
isCompositeMethod · 0.95
setStackNullMethod · 0.95
viewersMethod · 0.80
setChannelsUpdatedMethod · 0.80
setImageMethod · 0.45
getImageArrayMethod · 0.45

Tested by

no test coverage detected