public class WlzServiceImpl extends loci.common.services.AbstractService implements WlzService
Modifier and Type | Field and Description |
---|---|
private uk.ac.mrc.hgu.Wlz.WlzIBox3 |
bBox |
static java.lang.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 java.lang.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 java.lang.String |
wlzVersion |
Constructor and Description |
---|
WlzServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkClassDependency(java.lang.Class<? extends java.lang.Object> klass) |
void |
close()
Closes the file.
|
java.lang.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.
|
java.lang.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(java.lang.String file,
java.lang.String rw)
Initializes the service for the given file path.
|
private void |
openRead(java.lang.String file) |
private void |
openWrite(java.lang.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 java.lang.String WLZ_ORG_LABEL
public static final java.lang.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 java.lang.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(java.lang.Class<? extends java.lang.Object> klass)
checkClassDependency
in class loci.common.services.AbstractService
public java.lang.String getNoWlzMsg()
WlzService
getNoWlzMsg
in interface WlzService
public java.lang.String getWlzOrgLabelName()
WlzService
getWlzOrgLabelName
in interface WlzService
public void open(java.lang.String file, java.lang.String rw) throws FormatException, java.io.IOException
WlzService
open
in interface WlzService
file
- File path with which to initialize the service.FormatException
java.io.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 java.io.IOException
WlzService
close
in interface WlzService
java.io.IOException
public byte[] readBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.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.w
- rectangle width (in columns).h
- rectangle heigth (in lines).FormatException
java.io.IOException
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.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
java.io.IOException
private void openRead(java.lang.String file) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private void openWrite(java.lang.String file) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private byte[] readBytes2DDomObj(byte[] buf, int x, int y, int w, int h) throws uk.ac.mrc.hgu.Wlz.WlzException
uk.ac.mrc.hgu.Wlz.WlzException
private 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.WlzException
Copyright © 2022 Open Microscopy Environment