Package tritechgemini.imagedata
Class GeminiImageRecord
java.lang.Object
tritechgemini.imagedata.PublicMessageHeader
tritechgemini.imagedata.GeminiImageRecord
- All Implemented Interfaces:
Serializable,Cloneable,SonarImageRecordI,SonarRecordI
- Direct Known Subclasses:
ECDImageRecord,GLFImageRecord
public abstract class GeminiImageRecord
extends PublicMessageHeader
implements SonarImageRecordI, Cloneable, Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble[]Bearing tableintPosition in fileprotected byte[]Uncompressed image data.booleanFlag to say image has been read fully.intIndex in fileFields inherited from class tritechgemini.imagedata.PublicMessageHeader
genericHeader -
Constructor Summary
ConstructorsConstructorDescriptionGeminiImageRecord(GLFGenericHeader glfGenericHeader, String filePath, int filePos, int recordIndex) -
Method Summary
Modifier and TypeMethodDescriptionclone()Clone in interface which is properly overridden in inherited classesvoidFree the data to save memory.intgetBearingIndex(double bearing) Get the index from the bearing table of the bearing closest to the given bearing.double[]Get storage for echogram lines.Path to the image filebyte[]Get uncompressed imageData.longGet the record load time in nanoseconds.intgetNBeam()intgetRangeIndex(double range) Get the index of the range bin closest to the given rangeintshort[]Get the decompressed image data in an array of shorts this allows correction of problems caused by Java not understanding unsigned values, so what should be large values (>=128) are negative.booleanIs record fully loaded ?voidsetImageData(byte[] imageData) Set the uncompressed image data.voidsetLoadTime(long nanos) Record how long it took to load the record in nanoseconds.voidsetRecordNumber(int recordNumber) Set the record numberMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tritechgemini.imagedata.SonarImageRecordI
getChirp, getGain, getMaxRange, getnBeam, getnRange, getSonarType, getSoSMethods inherited from interface tritechgemini.imagedata.SonarRecordI
getDeviceId, getRecordTime, getSonarIndex, getSonarPlatform
-
Field Details
-
filePos
public int filePosPosition in file -
isFullyRead
public boolean isFullyReadFlag to say image has been read fully. It's quite possible that there is a file catalogue which just has the basic info (time and device id) without the full image and bearing table data to save on memory. -
recordIndex
public int recordIndexIndex in file -
bearingTable
public double[] bearingTableBearing table -
imageData
protected byte[] imageDataUncompressed image data.
-
-
Constructor Details
-
GeminiImageRecord
public GeminiImageRecord(GLFGenericHeader glfGenericHeader, String filePath, int filePos, int recordIndex)
-
-
Method Details
-
getImageData
public byte[] getImageData()Get uncompressed imageData.- Specified by:
getImageDatain interfaceSonarImageRecordI- Returns:
- image data in a single array
-
setImageData
public void setImageData(byte[] imageData) Set the uncompressed image data.- Specified by:
setImageDatain interfaceSonarImageRecordI- Parameters:
imageData-
-
getShortImageData
public short[] getShortImageData()Get the decompressed image data in an array of shorts this allows correction of problems caused by Java not understanding unsigned values, so what should be large values (>=128) are negative.
This will return an array of values between 0 and 255- Specified by:
getShortImageDatain interfaceSonarImageRecordI- Returns:
- Decompressed raw data in short format.
-
getNBeam
public int getNBeam()- Returns:
- the number of beams
-
getBearingTable
public double[] getBearingTable()- Specified by:
getBearingTablein interfaceSonarImageRecordI- Returns:
- List of beam angles in radians.
-
getFilePath
Description copied from interface:SonarImageRecordIPath to the image file- Specified by:
getFilePathin interfaceSonarImageRecordI- Returns:
- path name of file
-
getRecordNumber
public int getRecordNumber()- Specified by:
getRecordNumberin interfaceSonarImageRecordI- Returns:
- Record number in file (zero indexed)
-
setRecordNumber
public void setRecordNumber(int recordNumber) Description copied from interface:SonarImageRecordISet the record number- Specified by:
setRecordNumberin interfaceSonarImageRecordI- Parameters:
recordNumber-
-
isFullyLoaded
public boolean isFullyLoaded()Description copied from interface:SonarImageRecordIIs record fully loaded ?- Specified by:
isFullyLoadedin interfaceSonarImageRecordI- Returns:
- true if record is fully loaded.
-
setLoadTime
public void setLoadTime(long nanos) Description copied from interface:SonarImageRecordIRecord how long it took to load the record in nanoseconds.- Specified by:
setLoadTimein interfaceSonarImageRecordI
-
getLoadTime
public long getLoadTime()Description copied from interface:SonarImageRecordIGet the record load time in nanoseconds.- Specified by:
getLoadTimein interfaceSonarImageRecordI- Returns:
-
freeImageData
public void freeImageData()Description copied from interface:SonarImageRecordIFree the data to save memory.- Specified by:
freeImageDatain interfaceSonarImageRecordI
-
clone
Description copied from interface:SonarImageRecordIClone in interface which is properly overridden in inherited classes- Specified by:
clonein interfaceSonarImageRecordI- Overrides:
clonein classObject- Returns:
- cloned record.
-
getBearingIndex
public int getBearingIndex(double bearing) Description copied from interface:SonarImageRecordIGet the index from the bearing table of the bearing closest to the given bearing.- Specified by:
getBearingIndexin interfaceSonarImageRecordI- Parameters:
bearing- in radians- Returns:
- index of closest bearing.
-
getRangeIndex
public int getRangeIndex(double range) Description copied from interface:SonarImageRecordIGet the index of the range bin closest to the given range- Specified by:
getRangeIndexin interfaceSonarImageRecordI- Parameters:
range- range in metres- Returns:
- index of closest range bin.
-
getEchoLineStore
Description copied from interface:SonarImageRecordIGet storage for echogram lines.- Specified by:
getEchoLineStorein interfaceSonarImageRecordI- Returns:
-