Class INDArrayWrapper
- java.lang.Object
-
- science.aist.imaging.api.domain.wrapper.AbstractImageWrapper<org.nd4j.linalg.api.ndarray.INDArray>
-
- science.aist.imaging.nd4j.imageprocessing.wrapper.INDArrayWrapper
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,ImageWrapper<org.nd4j.linalg.api.ndarray.INDArray>
public class INDArrayWrapper extends AbstractImageWrapper<org.nd4j.linalg.api.ndarray.INDArray>
Implementation of a
ImageWrapper
for Deeplearning4j'sINDArray
- Since:
- 1.1
- Author:
- Christoph Praschl
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class science.aist.imaging.api.domain.wrapper.AbstractImageWrapper
channelType, closed, image
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
INDArrayWrapper(org.nd4j.linalg.api.ndarray.INDArray image, ChannelType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Overrides signature of close method fromAutoCloseable
Interface to not throw an exceptionint
getChannels()
int
getHeight()
Class<org.nd4j.linalg.api.ndarray.INDArray>
getSupportedType()
double
getValue(int x, int y, int channel)
Returns the value for a specific pixel and channelint
getWidth()
void
setValue(int x, int y, int channel, double val)
Sets a value for a specific pixel and channel-
Methods inherited from class science.aist.imaging.api.domain.wrapper.AbstractImageWrapper
equals, freeAllocatedImageWrappers, getChannelType, getImage, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.imaging.api.domain.wrapper.ImageWrapper
applyColumnFunction, applyFunction, applyFunction, applyFunction, applyFunction, copyTo, createCopy, createCopy, getValues, getValuesAsColor, setValues, setValues, supportsParallelAccess
-
-
-
-
Constructor Detail
-
INDArrayWrapper
protected INDArrayWrapper(org.nd4j.linalg.api.ndarray.INDArray image, ChannelType type)
-
-
Method Detail
-
close
public void close()
Description copied from interface:ImageWrapper
Overrides signature of close method fromAutoCloseable
Interface to not throw an exception- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceImageWrapper<org.nd4j.linalg.api.ndarray.INDArray>
- Overrides:
close
in classAbstractImageWrapper<org.nd4j.linalg.api.ndarray.INDArray>
-
getWidth
public int getWidth()
- Returns:
- The image width
-
getHeight
public int getHeight()
- Returns:
- The image height
-
getChannels
public int getChannels()
- Returns:
- The number of channels
-
getValue
public double getValue(int x, int y, int channel)
Description copied from interface:ImageWrapper
Returns the value for a specific pixel and channel- Parameters:
x
- the x-coordinate of the pixely
- the y-coordinate of the pixelchannel
- the channel to select of a specific pixel- Returns:
- the value for the pixel and channel
-
setValue
public void setValue(int x, int y, int channel, double val)
Description copied from interface:ImageWrapper
Sets a value for a specific pixel and channel- Parameters:
x
- the x-coordinate of the pixely
- the y-coordinate of the pixelchannel
- the channel to select of a specific pixelval
- the value for the pixel and channel
-
getSupportedType
public Class<org.nd4j.linalg.api.ndarray.INDArray> getSupportedType()
- Returns:
- the supported image type.
-
-