motris.data
Class DataManager

java.lang.Object
  extended bymotris.data.DataManager

public class DataManager
extends java.lang.Object

Manages (creates, loads, saves and caches) image-related data, i.e. Bitmap Images, Derivative Images, EE Images and OF Images. Bitmap Images are loaded ahead of time asynchromeously in another Thread (AsyncImageReader)

Author:
ottlik, dahlkamp

Nested Class Summary
(package private)  class DataManager.AsyncImageReader
           
 
Field Summary
private  AlgorithmFactory algorithms
           
private  DataManager.AsyncImageReader asyncImageReader
           
(package private)  boolean DEBUGMODE
           
private  int DEFAULT_PREFETCH_IMAGES
           
private  Cache derivatives
           
private  int imagePreloadTooSlowCount
           
private  Cache images
           
private  ImageSequenceData imageSequenceData
           
 java.lang.String inputDirectory
           
private  int lastDifferentImageRequested
           
 Logger logger
           
private  int MAX_DERIVATIVE_IMAGES
           
private  int MAX_IMAGES
           
private  int MAX_OF_IMAGES
           
private  Cache ofimages
           
 java.lang.String outputDirectory
           
private  int PREFETCH_IMAGES
           
 
Constructor Summary
DataManager(Experiment _ex)
           
 
Method Summary
 void clearImages()
          Delete all entries in the image cache
 DerivativeImage getDerivativeImage(int frame)
           
 EdgeElementAdaption getEdgeElementAssignmentImage(int frame)
           
 DerivativeImage getEdgeElementImage(int frame)
           
 MotrisImage getImage(int time)
          Looks if the image is in the cache, otherwise loads it
 ImageSequenceData getImageSequenceData()
           
 OFImage getOFImage(int time)
           
 void printStats()
           
private  void requestImageLoading(int predictedNextImage)
           
 void setAlgorithmFactory(AlgorithmFactory factory)
           
private  GrayImage treatInterlacing(int time, GrayImage res, boolean createNextImageIfPossible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUGMODE

boolean DEBUGMODE

imageSequenceData

private ImageSequenceData imageSequenceData

algorithms

private AlgorithmFactory algorithms

images

private Cache images

asyncImageReader

private DataManager.AsyncImageReader asyncImageReader

ofimages

private Cache ofimages

derivatives

private Cache derivatives

MAX_IMAGES

private int MAX_IMAGES

MAX_OF_IMAGES

private int MAX_OF_IMAGES

MAX_DERIVATIVE_IMAGES

private int MAX_DERIVATIVE_IMAGES

inputDirectory

public java.lang.String inputDirectory

outputDirectory

public java.lang.String outputDirectory

logger

public Logger logger

DEFAULT_PREFETCH_IMAGES

private int DEFAULT_PREFETCH_IMAGES

PREFETCH_IMAGES

private int PREFETCH_IMAGES

lastDifferentImageRequested

private int lastDifferentImageRequested

imagePreloadTooSlowCount

private int imagePreloadTooSlowCount
Constructor Detail

DataManager

public DataManager(Experiment _ex)
Method Detail

treatInterlacing

private GrayImage treatInterlacing(int time,
                                   GrayImage res,
                                   boolean createNextImageIfPossible)

getImage

public MotrisImage getImage(int time)
Looks if the image is in the cache, otherwise loads it


requestImageLoading

private void requestImageLoading(int predictedNextImage)

clearImages

public void clearImages()
Delete all entries in the image cache


getImageSequenceData

public final ImageSequenceData getImageSequenceData()

getOFImage

public OFImage getOFImage(int time)

getDerivativeImage

public DerivativeImage getDerivativeImage(int frame)

setAlgorithmFactory

public void setAlgorithmFactory(AlgorithmFactory factory)
Parameters:
factory -

getEdgeElementImage

public DerivativeImage getEdgeElementImage(int frame)

getEdgeElementAssignmentImage

public EdgeElementAdaption getEdgeElementAssignmentImage(int frame)

printStats

public void printStats()