public class WlzServiceImpl extends AbstractService implements WlzService
Modifier and Type | Field and Description |
---|---|
static String |
NO_WLZ_MSG |
static String |
WLZ_ORG_LABEL |
static int |
WLZ_SERVICE_READ |
static int |
WLZ_SERVICE_UNKNOWN |
static int |
WLZ_SERVICE_WRITE |
Constructor and Description |
---|
WlzServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkClassDependency(Class<? extends Object> klass)
Checks a given class dependency at runtime to ensure that a given class
will be available.
|
void |
close()
Closes the file.
|
String |
getNoWlzMsg()
Gets the text string for when Woolz has not been found.
|
double |
getOrgX()
Gets column origin.
|
double |
getOrgY()
Gets line origin.
|
double |
getOrgZ()
Gets plane origin.
|
int |
getPixelType()
Gets the image pixel type.
|
int |
getSizeC()
Gets number of channels.
|
int |
getSizeT()
Gets number of time samples.
|
int |
getSizeX()
Gets width in pixels/voxels.
|
int |
getSizeY()
Gets height in pixels/voxels.
|
int |
getSizeZ()
Gets depth (number of x-y planes) in voxels.
|
int[] |
getSupPixelTypes()
Gets supported pixel types.
|
double |
getVoxSzX()
Gets voxel width.
|
double |
getVoxSzY()
Gets voxel height.
|
double |
getVoxSzZ()
Gets voxel depth.
|
String |
getWlzOrgLabelName()
Gets the text string used for the Woolz origin label.
|
boolean |
isRGB()
Gets boolean for whether image is colour or not.
|
void |
open(String file,
String rw)
Initializes the service for the given file path.
|
byte[] |
readBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Reads a rectangle of bytes in an x-y plane from the opened Woolz
object.
|
void |
saveBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Adds a rectangle of bytes in an x-y plane to the opened Woolz object.
|
void |
setupWrite(int orgX,
int orgY,
int orgZ,
int pixSzX,
int pixSzY,
int pixSzZ,
int pixSzC,
int pixSzT,
double voxSzX,
double voxSzY,
double voxSzZ,
int gType)
Sets up the service, which must have already been opened for writing.
|
public static final String WLZ_ORG_LABEL
public static final String NO_WLZ_MSG
public static final int WLZ_SERVICE_UNKNOWN
public static final int WLZ_SERVICE_READ
public static final int WLZ_SERVICE_WRITE
protected void checkClassDependency(Class<? extends Object> klass)
AbstractService
checkClassDependency
in class AbstractService
klass
- A class that this service depends upon.public String getNoWlzMsg()
WlzService
getNoWlzMsg
in interface WlzService
public String getWlzOrgLabelName()
WlzService
getWlzOrgLabelName
in interface WlzService
public void open(String file, String rw) throws FormatException, IOException
WlzService
open
in interface WlzService
file
- File path with which to initialize the service.FormatException
IOException
public int getSizeX()
WlzService
getSizeX
in interface WlzService
public int getSizeY()
WlzService
getSizeY
in interface WlzService
public int getSizeZ()
WlzService
getSizeZ
in interface WlzService
public int getSizeC()
WlzService
getSizeC
in interface WlzService
public int getSizeT()
WlzService
getSizeT
in interface WlzService
public boolean isRGB()
WlzService
isRGB
in interface WlzService
public double getVoxSzX()
WlzService
getVoxSzX
in interface WlzService
public double getVoxSzY()
WlzService
getVoxSzY
in interface WlzService
public double getVoxSzZ()
WlzService
getVoxSzZ
in interface WlzService
public double getOrgX()
WlzService
getOrgX
in interface WlzService
public double getOrgY()
WlzService
getOrgY
in interface WlzService
public double getOrgZ()
WlzService
getOrgZ
in interface WlzService
public int[] getSupPixelTypes()
WlzService
getSupPixelTypes
in interface WlzService
public int getPixelType()
WlzService
getPixelType
in interface WlzService
public void setupWrite(int orgX, int orgY, int orgZ, int pixSzX, int pixSzY, int pixSzZ, int pixSzC, int pixSzT, double voxSzX, double voxSzY, double voxSzZ, int gType) throws FormatException
WlzService
setupWrite
in interface WlzService
orgX
- x origin.orgY
- y origin.orgZ
- z origin (set to 0 for 2D).pixSzX
- width.pixSzY
- height.pixSzZ
- depth (number of planes, set to 1 for 2D).pixSzC
- number of channels.pixSzT
- number of time samples.voxSzX
- pixel/voxel width.voxSzY
- pixel/voxel heigth.voxSzZ
- voxel deoth.gType
- image value type.FormatException
public void close() throws IOException
WlzService
close
in interface WlzService
IOException
public byte[] readBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
WlzService
readBytes
in interface WlzService
no
- plane coordinate (set to 0 for 2D).buf
- buffer for bytes.x
- rectangle first column.y
- rectangle first line.h
- rectangle heigth (in lines).FormatException
IOException
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
WlzService
saveBytes
in interface WlzService
no
- plane coordinate (set to 0 for 2D).buf
- buffer with bytes.x
- rectangle first column.y
- rectangle first line.w
- rectangle width (in columns).h
- rectangle heigth (in lines).FormatException
IOException
Copyright © 2014 Open Microscopy Environment