|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDPortHashAccess
de.unihalle.informatik.MiToBo.core.operator.MTBPortHashAccess
public class MTBPortHashAccess
Interface to the port database of the Alida / MiToBo operator history.
This class implements an interface to access the history database. It yields the only possibility to access the database, direct access is blocked to guarantee database consistency.
Compared to the superclass a special treatment of MiToBo images takes place to ensure proper association of MiToBo images and underlying ImageJ ImagePlus data. Objects are usually registered by their references in the port database, however, in case of MiToBo images and underlying ImagePlus data different object references, i.e. the MTBImage and the ImagePlus, essentially represent the same data in the system. Hence, for history database validity explicit associations need to be established between ImagePlus and MTBImage data.
Database consistency is ensured by introducing a specialized data type
which is the MTBHistoryImageBox
. If a MTBImage is fed into an
operator as parameter the first time, a corresponding image box is created
and registered in the local hash.
Lateron, when the ImagePlus object linked to the MTBImage is directly
used as parameter, the MiToBo images within all boxes are searched to find
the corresponding MTBImage. Then the history port associated with the
box is updated, ensuring history consistency and at the same time
proper association of the ImagePlus with the formerly known MTBImage.
In case of using an ImagePlus as parameter that has not been seen before, the same mechanism is applied. First an image box is initialized for the new ImagePlus. When at a later point in time the MTBImage is used as parameter which is associated to the formerly seen ImagePlus, the association is explicitly established by linking the MTBImage to the box and updating the history port of the box accordingly.
Nested Class Summary | |
---|---|
private static class |
MTBPortHashAccess.MTBHistoryImageBox
Database object boxing ImagePlus and MTBImage. |
Field Summary | |
---|---|
private static java.util.WeakHashMap<ij.ImagePlus,MTBPortHashAccess.MTBHistoryImageBox> |
boxLinksImagePlus
Associative list for links between ImagePlus and associated image boxes. |
private static java.util.WeakHashMap<MTBImage,MTBPortHashAccess.MTBHistoryImageBox> |
boxLinksMTBImage
Associative list for links between MTBImages and associated image boxes. |
static java.lang.String |
MPH_EXTENSION
Default extension of MiToBo processing history file. |
private static boolean |
verbose
If true, verbose outputs are written to standard output. |
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDPortHashAccess |
---|
ALD_EXTENSION |
Constructor Summary | |
---|---|
protected |
MTBPortHashAccess()
Constructor without function. |
Method Summary | |
---|---|
protected de.unihalle.informatik.Alida.operator.ALDPort |
getHistoryLink(java.lang.Object obj)
Gets the port to which the object is currently linked in history. |
private static MTBPortHashAccess.MTBHistoryImageBox |
getImageBox(java.lang.Object obj)
Gets the image container associated with the given image object. |
protected boolean |
isRegistered(java.lang.Object obj)
Checks if an object is registered in the database. |
private static boolean |
isRegisteredImageBox(java.lang.Object obj)
Checks if the given image object is already registered. |
protected void |
register(java.lang.Object obj)
Registers the object to the database. |
private void |
registerImageBox(java.lang.Object obj)
Registers the given (image) object. |
protected void |
setHistoryLink(java.lang.Object obj,
de.unihalle.informatik.Alida.operator.ALDPort port)
Sets the port to which the object is to be linked in history. |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDPortHashAccess |
---|
getNumEntries, readHistory, writeHistory, writeHistory, writeHistory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.WeakHashMap<ij.ImagePlus,MTBPortHashAccess.MTBHistoryImageBox> boxLinksImagePlus
The hash provides fast access to stored image boxes by keeoing track of all included ImagePlus images as keys in the map.
private static java.util.WeakHashMap<MTBImage,MTBPortHashAccess.MTBHistoryImageBox> boxLinksMTBImage
The hash provides fast access to stored image boxes by keeping track of all included MiToBo images as keys in the map.
public static final java.lang.String MPH_EXTENSION
private static boolean verbose
Constructor Detail |
---|
protected MTBPortHashAccess()
Note that there will be only one processing history per session and not many different objects of this type.
Method Detail |
---|
protected de.unihalle.informatik.Alida.operator.ALDPort getHistoryLink(java.lang.Object obj)
getHistoryLink
in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
private static MTBPortHashAccess.MTBHistoryImageBox getImageBox(java.lang.Object obj)
protected boolean isRegistered(java.lang.Object obj)
isRegistered
in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
obj
- Object to check.
private static boolean isRegisteredImageBox(java.lang.Object obj)
An image is registered if a corresponding image container exists.
obj
- Image object in question.
protected void register(java.lang.Object obj)
register
in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
obj
- Object to register.private void registerImageBox(java.lang.Object obj)
Image objects are treated in a special way as different physical objects may relate to the same logical object. In particular, images are boxed in containers where each container keeps track of a pair of MTBImage/ImagePlus objects.
obj
- Object to register.protected void setHistoryLink(java.lang.Object obj, de.unihalle.informatik.Alida.operator.ALDPort port)
setHistoryLink
in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
port
- New port the data object is to be linked to.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |