public class WlzServiceImpl extends AbstractService implements WlzService
| Modifier and Type | Field and Description |
|---|---|
private uk.ac.mrc.hgu.Wlz.WlzIBox3 |
bBox |
static String |
NO_WLZ_MSG |
private int |
objGType |
private int |
objType |
private int |
pixelType |
private int |
state |
private uk.ac.mrc.hgu.Wlz.WlzDVertex3 |
voxSz |
static String |
WLZ_ORG_LABEL |
static int |
WLZ_SERVICE_READ |
static int |
WLZ_SERVICE_UNKNOWN |
static int |
WLZ_SERVICE_WRITE |
private uk.ac.mrc.hgu.Wlz.WlzFileStream |
wlzFP |
private uk.ac.mrc.hgu.Wlz.WlzObject |
wlzObj |
private String |
wlzVersion |
| 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.
|
private void |
openRead(String file) |
private void |
openWrite(String file) |
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.
|
private byte[] |
readBytes2DDomObj(byte[] buf,
int x,
int y,
int w,
int h) |
private byte[] |
readBytes3DDomObj(byte[] buf,
int x,
int y,
int z,
int w,
int h) |
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
private int state
private int pixelType
private int objType
private int objGType
private String wlzVersion
private uk.ac.mrc.hgu.Wlz.WlzIBox3 bBox
private uk.ac.mrc.hgu.Wlz.WlzDVertex3 voxSz
private uk.ac.mrc.hgu.Wlz.WlzObject wlzObj
private uk.ac.mrc.hgu.Wlz.WlzFileStream wlzFP
protected void checkClassDependency(Class<? extends Object> klass)
AbstractServicecheckClassDependency in class AbstractServiceklass - A class that this service depends upon.public String getNoWlzMsg()
WlzServicegetNoWlzMsg in interface WlzServicepublic String getWlzOrgLabelName()
WlzServicegetWlzOrgLabelName in interface WlzServicepublic void open(String file, String rw) throws FormatException, IOException
WlzServiceopen in interface WlzServicefile - File path with which to initialize the service.FormatExceptionIOExceptionpublic int getSizeX()
WlzServicegetSizeX in interface WlzServicepublic int getSizeY()
WlzServicegetSizeY in interface WlzServicepublic int getSizeZ()
WlzServicegetSizeZ in interface WlzServicepublic int getSizeC()
WlzServicegetSizeC in interface WlzServicepublic int getSizeT()
WlzServicegetSizeT in interface WlzServicepublic boolean isRGB()
WlzServiceisRGB in interface WlzServicepublic double getVoxSzX()
WlzServicegetVoxSzX in interface WlzServicepublic double getVoxSzY()
WlzServicegetVoxSzY in interface WlzServicepublic double getVoxSzZ()
WlzServicegetVoxSzZ in interface WlzServicepublic double getOrgX()
WlzServicegetOrgX in interface WlzServicepublic double getOrgY()
WlzServicegetOrgY in interface WlzServicepublic double getOrgZ()
WlzServicegetOrgZ in interface WlzServicepublic int[] getSupPixelTypes()
WlzServicegetSupPixelTypes in interface WlzServicepublic int getPixelType()
WlzServicegetPixelType in interface WlzServicepublic 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
WlzServicesetupWrite in interface WlzServiceorgX - 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.FormatExceptionpublic void close()
throws IOException
WlzServiceclose in interface WlzServiceIOExceptionpublic byte[] readBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
IOException
WlzServicereadBytes in interface WlzServiceno - plane coordinate (set to 0 for 2D).buf - buffer for bytes.x - rectangle first column.y - rectangle first line.w - rectangle width (in columns).h - rectangle heigth (in lines).FormatExceptionIOExceptionpublic void saveBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
IOException
WlzServicesaveBytes in interface WlzServiceno - 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).FormatExceptionIOExceptionprivate void openRead(String file) throws FormatException, IOException
FormatExceptionIOExceptionprivate void openWrite(String file) throws FormatException, IOException
FormatExceptionIOExceptionprivate byte[] readBytes2DDomObj(byte[] buf,
int x,
int y,
int w,
int h)
throws uk.ac.mrc.hgu.Wlz.WlzException
uk.ac.mrc.hgu.Wlz.WlzExceptionprivate byte[] readBytes3DDomObj(byte[] buf,
int x,
int y,
int z,
int w,
int h)
throws uk.ac.mrc.hgu.Wlz.WlzException
uk.ac.mrc.hgu.Wlz.WlzExceptionCopyright © 2016 Open Microscopy Environment