private class SPEReader.SpeHeader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private byte[] |
header |
private static int |
headerSize |
Constructor and Description |
---|
SpeHeader(byte[] header)
Constructor for SpeHeader
|
Modifier and Type | Method and Description |
---|---|
private int |
getByte(int index)
Private method used to retrieve a Byte value from the SPE header
|
int |
getByte(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Byte entries into the SPE header table
|
byte[] |
getHeader() |
int |
getHeaderSize() |
private int |
getInt(int index)
Private method used to retrieve an Integer value from the SPE header
|
int |
getInt(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Integer entries into the SPE header table
|
int[] |
getIntArray(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Integer Array entries into the SPE header table
|
private long |
getLong(int index)
Private method used to retrieve a Long value from the SPE header
|
long |
getLong(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Long enteries into the SPE header table
|
long[] |
getLongArray(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Long Array entries into the SPE header table
|
SPEReader.SpeROI[] |
getROIs()
Method used to read and return meta data for upto 10 rectangular ROI's stored in the SPE header table
|
private int |
getShort(int index)
Private method used to retrieve a Short value from the SPE header
|
int |
getShort(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Short entries into the SPE header table
|
int[] |
getShortArray(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for Short Array entries into the SPE header table
|
int |
getStackSize()
Method used to determined the stack size of the SPE file.
|
private java.lang.String |
getString(int index,
int length)
Private method used to retrieve a String value from the SPE header
|
java.lang.String |
getString(SPEReader.SpeHeaderEntry entry)
Method used to retrieve data values for String entries into the SPE header table
|
private boolean |
setByte(int index,
int value)
Private method used to set a Byte value in the SPE header
|
void |
setHeader(byte[] header) |
private void |
setInt(int index,
int value)
Private method used to set an Integer value in the SPE header
|
private void |
setLong(int index,
int value)
Private method used to set a Long value in the SPE header
|
private boolean |
setShort(int index,
int value)
Private method used to set a Short value in the SPE header
|
private void |
setString(int index,
java.lang.String string)
Private method used to set a String value in the SPE header
|
private static final int headerSize
private byte[] header
public SpeHeader(byte[] header)
header
- The binary data header read from the associated SPE filepublic byte[] getHeader()
public void setHeader(byte[] header)
header
- The binary data header to be usedpublic int getHeaderSize()
public int getByte(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Byteprivate int getByte(int index)
index
- The index of the expected value in the header arrayprivate boolean setByte(int index, int value)
index
- The starting index in the header array in which to write the valuevalue
- The Byte value to be written to the SPE headerpublic int getShort(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Shortprivate int getShort(int index)
index
- The index of the expected value in the header arrayprivate boolean setShort(int index, int value)
index
- The starting index in the header array in which to write the valuevalue
- The Short value to be written to the SPE headerpublic int getInt(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Integerprivate int getInt(int index)
index
- The index of the expected value in the header arrayprivate void setInt(int index, int value)
index
- The starting index in the header array in which to write the valuevalue
- The Integer value to be written to the SPE headerpublic long getLong(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Longprivate long getLong(int index)
index
- The index of the expected value in the header arrayprivate void setLong(int index, int value)
index
- The starting index in the header array in which to write the valuevalue
- The Long value to be written to the SPE headerpublic java.lang.String getString(SPEReader.SpeHeaderEntry entry) throws FormatException, java.io.UnsupportedEncodingException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type String or if the length of the String cannot be determinedjava.io.UnsupportedEncodingException
- Thrown if the String value found in the header location is not in UTF-8 encodingprivate java.lang.String getString(int index, int length) throws java.io.UnsupportedEncodingException
index
- The starting index of the expected value in the header arraylength
- The length of the String to be read from the arrayjava.io.UnsupportedEncodingException
- Thrown if the String read at the given location is not in UTF-8 encodingprivate void setString(int index, java.lang.String string)
index
- The starting index in the header array in which to write the Stringstring
- The String to be written to the SPE headerpublic int[] getIntArray(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Integer Arraypublic int[] getShortArray(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Short Arraypublic long[] getLongArray(SPEReader.SpeHeaderEntry entry) throws FormatException
entry
- The header entry to readFormatException
- Thrown if the value at the given header entry location is not of type Long Arraypublic SPEReader.SpeROI[] getROIs() throws FormatException
FormatException
- Thrown if any of the values read during the call are not in the correct formatpublic int getStackSize() throws FormatException
FormatException
- Thrown if any of the values read during the call are not in the correct formatCopyright © 2022 Open Microscopy Environment