@Override public void taskComplete() { if (!Thread.currentThread().isInterrupted()) { if (params.getBooleanParameterValue("deleteTiles")) parentObject.clearPathObjects(); if (pathAnnotations != null && !pathAnnotations.isEmpty()) parentObject.addPathObjects(pathAnnotations); imageData.getHierarchy().fireHierarchyChangedEvent(parentObject); } pathAnnotations = null; }
List<PathObject> newChildList = new ArrayList<>(child.getChildObjects()); newChildList.removeAll(pathObjects); parent.addPathObjects(newChildList);
hierarchy.getRootObject().addPathObjects(pathObjects); } catch (IOException e) { e.printStackTrace();
private synchronized void updateTMAHierarchy() { if (tmaGrid == null) return; // Assign annotations to cores List<PathObject> pathObjectChildren = new ArrayList<>(rootObject.getChildObjects()); rootObject.clearPathObjects(); // Add cores to the start of the object list rootObject.addPathObjects(tmaGrid.getTMACoreList()); // Add back any other objects for (PathObject pathObject : pathObjectChildren) addPathObject(pathObject, false, false); // Notify listeners of changes fireHierarchyChangedEvent(getRootObject()); }
boolean checkAllTestsComplete() { if (map.isEmpty() && getParent() != null) { if (countdown == null) { hierarchy.removeObject(this, true); } else if (countdown.decrementAndGet() == 0) { PathObject parent = getParent(); List<PathObject> parallelObjects = new ArrayList<>(); for (PathObject temp : parent.getChildObjects()) { if (temp instanceof ParallelTileObject) { parallelObjects.add(temp); } } parent.removePathObjects(parallelObjects); for (PathObject temp : parallelObjects) parent.addPathObjects(temp.getChildObjects()); if (parent.hasChildren() && parent instanceof PathROIObject) ((PathROIObject)parent).setLocked(true); hierarchy.fireHierarchyChangedEvent(parent); } return true; // getParent().removePathObject(this); // getParent().addPathObjects(getPathObjectList()); } return false; }
parentObject.addPathObjects(pathObjectsDetected); tryToSetObjectLock(parentObject, true); // Try to lock the parent ((ParallelTileObject)parentObject).setComplete(); } else if (!parentObject.hasChildren() || overlapAmount <= 0) { parentObject.addPathObjects(pathObjectsDetected); tryToSetObjectLock(parentObject, true); // Try to lock the parent } else if (pathObjectsDetected != null && !pathObjectsDetected.isEmpty()) { parentObject.addPathObjects(pathObjectsDetected);
pathSingleAnnotation = new PathAnnotationObject(pathROINew, pathClass); if (!deleteTiles) pathSingleAnnotation.addPathObjects(tiles);
public synchronized boolean removeObject(PathObject pathObject, boolean keepChildren, boolean fireEvent) { // Check the object is within the hierarchy & has a valid parent (from which it can be removed) PathObject pathObjectParent = pathObject.getParent(); if (!inHierarchy(pathObject) || pathObjectParent == null) { logger.warn(pathObject + " could not be removed from the hierarchy"); return false; } // Can't keep children if there aren't any keepChildren = keepChildren && pathObject.hasChildren(); pathObjectParent.removePathObject(pathObject); // Assign the children to the parent object, if necessary if (keepChildren) { // We create a new array list because getPathObjectList returns an unmodifiable collection // List<PathObject> list = new ArrayList<>(pathObject.getPathObjectList()); pathObjectParent.addPathObjects(pathObject.getChildObjects()); // pathObject.clearPathObjects(); // Clear child objects, just in case } if (fireEvent) { if (keepChildren) fireObjectRemovedEvent(this, pathObject, pathObjectParent); else fireHierarchyChangedEvent(this, pathObjectParent); } return true; }
@Override public void taskComplete() { parentObject.clearPathObjects(); parentObject.addPathObjects(tiles); imageData.getHierarchy().fireHierarchyChangedEvent(this, parentObject); if (params.getBooleanParameterValue("removeParentAnnotation") && params.getBooleanParameterValue("makeAnnotations") && parentObject.isAnnotation()) { imageData.getHierarchy().removeObject(parentObject, true); } }
iterChild.remove(); pathObject.addPathObjects(possibleChildren); possibleParent.addPathObject(pathObject);