org.joone.io
Class ImageOutputSynapse
- java.lang.Object
-
- org.joone.engine.Synapse
-
- org.joone.io.StreamOutputSynapse
-
- org.joone.io.ImageOutputSynapse
-
- All Implemented Interfaces:
- java.io.Serializable, InputPatternListener, Learnable, LearnableSynapse, NeuralElement, OutputPatternListener, Inspectable, PlugInListener
public class ImageOutputSynapse extends StreamOutputSynapse
This class collects the output from the connected layer and places it into an image file. Images can be produced in GIF, JPG and PNG formats.Colour Mode In colour mode ImageOutputSynapse expects seperate RGB input values in the range 0 to 1 from the connected layer. So to produce an image of width 10 and height 10 there must be 10x10x3 inputs from the previous layer/s. The red, green and blue components in the final image are set using the individual component values from the input.
Non Colour Mode / Grey Scale Mode In this mode the synapse treats each input value as a grey scale value for each pixel. In this mode only Width*Height values are required. To produce the final image the Red, Green and Blue components are the set to this same value.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ImageOutputSynapse()Creates a new instance of ImageOutputSynapse
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.TreeSetcheck()Checks and returns any problems found with the settings of this synapse.booleangetColourMode()Determines if this synapse is in colour mode.intgetHeight()Gets the desired height of the generated image files.intgetImageFileType()Obtains the image type JPG = 1, GIF = 2, PNG = 3 of the format of the output files.java.lang.StringgetOutputDirectory()Gets the directory where Image files will be created.intgetWidth()Gets the desired width of the generated image files.voidsetColourMode(boolean ColourMode)Sets the colour mode of this synapse.voidsetHeight(int Height)Sets the desired height of the generated image files.voidsetImageFileType(int ImageFileType)Sets the image type JPG = 1, GIF = 2, PNG = 3 of the format of the generated image files.voidsetOutputDirectory(java.lang.String OutputDirectory)Sets the name of the directory where Image files will be created.voidsetWidth(int Width)Sets the desired width of the generated image files.voidwrite(Pattern pattern)Writes the Neural Network pattern to an Image file, the Image type is specified by the ImageFileType property.-
Methods inherited from class org.joone.io.StreamOutputSynapse
addPlugIn, dataChanged, fwdPut, getPlugIn, getSeparator, isBuffered, removeAllPlugIns, revGet, setBuffered, setPlugIn, setSeparator
-
Methods inherited from class org.joone.engine.Synapse
addNoise, canCountSteps, fwdGet, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getOutputDimension, getWeights, init, initLearner, InspectableTitle, Inspections, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, reset, revPut, setEnabled, setIgnoreBefore, setInputDimension, setInputFull, setLearningRate, setLoopBack, setMomentum, setMonitor, setName, setOutputDimension, setOutputFull, setWeights
-
-
-
-
Field Detail
-
JPG
public final int JPG
- See Also:
- Constant Field Values
-
GIF
public final int GIF
- See Also:
- Constant Field Values
-
PNG
public final int PNG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImageOutputSynapse
public ImageOutputSynapse()
Creates a new instance of ImageOutputSynapse
-
-
Method Detail
-
write
public void write(Pattern pattern)
Writes the Neural Network pattern to an Image file, the Image type is specified by the ImageFileType property.- Specified by:
writein classStreamOutputSynapse
-
getOutputDirectory
public java.lang.String getOutputDirectory()
Gets the directory where Image files will be created.
-
setOutputDirectory
public void setOutputDirectory(java.lang.String OutputDirectory)
Sets the name of the directory where Image files will be created.- Parameters:
OutputDirectory- The directory used to store generated image files.
-
getImageFileType
public int getImageFileType()
Obtains the image type JPG = 1, GIF = 2, PNG = 3 of the format of the output files.
-
setImageFileType
public void setImageFileType(int ImageFileType)
Sets the image type JPG = 1, GIF = 2, PNG = 3 of the format of the generated image files.- Parameters:
ImageFileType- JPG = 1, GIF = 2, PNG = 3.
-
getWidth
public int getWidth()
Gets the desired width of the generated image files.
-
setWidth
public void setWidth(int Width)
Sets the desired width of the generated image files.
-
getHeight
public int getHeight()
Gets the desired height of the generated image files.
-
setHeight
public void setHeight(int Height)
Sets the desired height of the generated image files.
-
getColourMode
public boolean getColourMode()
Determines if this synapse is in colour mode. false if in grey scale mode.- Returns:
- The ColourMode if this synapse.
-
setColourMode
public void setColourMode(boolean ColourMode)
Sets the colour mode of this synapse.- Parameters:
ColourMode- true if in colour mode, false if in grey scale mode.
-
check
public java.util.TreeSet check()
Checks and returns any problems found with the settings of this synapse.- Specified by:
checkin interfaceNeuralElement- Overrides:
checkin classStreamOutputSynapse- Returns:
- A TreeSet of problems or errors found with this synapse.
- See Also:
InputPaternListener,OutputPaternListener
-
-
DataMelt 3.0 © DataMelt by jWork.ORG