|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mosaic.sim.neuron.netinputs.ImageInput
This class reads an image and converts it to either a one-dimensional vector of dimension height*width or a two-dimensional matrix of dimension [height, width]. For inputting a one-dimensional vector to the network, this class uses the interface VectorInput; for inputting a two-dimensional matrix, it uses MatrixInput. Objects implementing these interface have to be given in the constructor when initializing. This class needs the JAI (Java Advanced Imaging) library to do its work.
VectorInputCoder
,
MatrixInputCoder
Field Summary | |
protected VectorInputCoder |
coderOneDim
This object is used as the coder when using one-dimensional (vector) input. |
protected MatrixInputCoder |
coderTwoDim
This object is used as the coder when using two-dimensional (matrix) input. |
protected int |
dim
The dimension of the network input. |
protected javax.media.jai.PlanarImage |
image
The image. |
Constructor Summary | |
ImageInput(java.lang.String filename,
int dim)
This constructor initializes the class for one-dimensional or two-dimensional input. |
Method Summary | |
java.awt.image.ColorModel |
getColorModel()
Returns the color model of the loaded image. |
int |
getHeight()
Returns the height of the loaded image. |
java.awt.image.SampleModel |
getSampleModel()
Returns the sample model of the loaded image. |
int |
getWidth()
Returns the width of the loaded image. |
void |
setCoder(MatrixInputCoder coder)
|
void |
setCoder(VectorInputCoder coder)
Initializes the Spike coder. |
void |
startInput()
This method really starts the network input and should only be called after the coder has been initialized with setCoder(). |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected int dim
protected VectorInputCoder coderOneDim
protected MatrixInputCoder coderTwoDim
protected javax.media.jai.PlanarImage image
Constructor Detail |
public ImageInput(java.lang.String filename, int dim) throws CodingException, java.io.FileNotFoundException
filename
- The filename of the image file that should be used.dim
- The dimension of the network input (1 or 2)setCoder(mosaic.sim.neuron.netinputs.VectorInputCoder)
,
startInput()
Method Detail |
public int getHeight()
public int getWidth()
public java.awt.image.ColorModel getColorModel()
public java.awt.image.SampleModel getSampleModel()
public void setCoder(VectorInputCoder coder) throws CodingException
public void setCoder(MatrixInputCoder coder) throws CodingException
public void startInput() throws CodingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |