private static class MTBPortHashAccess.MTBHistoryImageBox extends Object
In MiToBo the data type MTBImage
most of the time acts like
a wrapper for an underlying ImagePlus object. In addition, an object of
type ImagePlus is required anyway to display the MTBImage to the user.
Currently all changes done to either the MTBImage or the corresponding
ImagePlus object trigger changes in the associated object as well.
The MiToBo history tracks operations performed on an object during its lifetime assuming a unique identifier for each object. In case of MTBImage this is not true anymore as the image can be accessed either as MTBImage or as ImagePlus. These are physically two different objects, however, should logically be treated the same. Consequently, the history database needs to explicitly link both objects to each other and treat them internally as one single object.
This class implements a container for a pair of associated images of type MTBImage and ImagePlus. Whenever the database is queried for an object of either of both types, the query is redirected to the associated container object. Each container object owns a unique dataport and a history, if available, i.e. may be treated as any other object in the database.
Modifier and Type | Field and Description |
---|---|
private WeakReference<ij.ImagePlus> |
imgPlusRef
ImagePlus object in container.
|
private WeakReference<MTBImage> |
mtbImageRef
MTBImage object in container.
|
Modifier | Constructor and Description |
---|---|
protected |
MTBHistoryImageBox(ij.ImagePlus i)
Default constructor for an ImagePlus without linked MTBImage.
|
protected |
MTBHistoryImageBox(MTBImage m)
Default constructor for an MTBImage without associated ImagePlus.
|
protected |
MTBHistoryImageBox(MTBImage m,
ij.ImagePlus i)
Default constructor for an image pair.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
containsImagePlus()
Checks if the box contains an ImagePlus.
|
protected boolean |
containsMTBImage()
Checks if the box contains a MTBImage.
|
protected ij.ImagePlus |
getImagePlus()
Gets the stored ImagePlus.
|
protected MTBImage |
getMTBImage()
Gets the stored MTBImage.
|
protected void |
setImagePlus(ij.ImagePlus imp)
Stores given image to the container.
|
protected void |
setMTBImage(MTBImage mimg)
Stores given image to the container.
|
private WeakReference<MTBImage> mtbImageRef
private WeakReference<ij.ImagePlus> imgPlusRef
protected MTBHistoryImageBox(MTBImage m, ij.ImagePlus i)
m
- MTBImage object of the pair.i
- ImagePlus object of the pair.protected MTBHistoryImageBox(MTBImage m)
m
- MTBImage object.protected MTBHistoryImageBox(ij.ImagePlus i)
m
- MTBImage object.protected void setMTBImage(MTBImage mimg)
mimg
- MTBImage to be stored in container.protected void setImagePlus(ij.ImagePlus imp)
mimg
- ImagePlus to be stored in container.protected ij.ImagePlus getImagePlus()
null
.protected MTBImage getMTBImage()
null
.protected boolean containsMTBImage()
protected boolean containsImagePlus()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.