public class SoVRSegyFileReader extends SoVolumeReader
SEGY is a widely used format for storing seismic trace data, defined by the Society of Exploration Geophysicists publication "Digital Tape
Standards" (
The data will be mapped to the Open Inventor axes as follows:
Although in most cases the SEGY reader can automatically detect if the number of traces per line in a SEGY file is not uniform, in some cases it cannot. You can set environment variable IVVR_IRREGULAR_TRACE_NUM to request the use of a more sophisticated file parsing algorithm. However, be aware that the initialization for file reading will take longer when this environment variable is set. Missing data is assigned the value zero.
Although in most cases the SEGY reader can automatically detect if the length of traces in a SEGY data file is not uniform, in some cases it cannot. You can set environment variable IVVR_INCONSTANT_TRACE_LENGTH to request the use of a more sophisticated file parsing algorithm. However, be aware that the initialization for file reading will take significantly longer when this environment variable is set. Missing data is assigned the value zero.
In most cases the SEGY reader can automatically detect if the values in the file need to be "byte swapped", for example if the data was written on a "big-endian" machine (e.g., SPARC) and is being read on a "little-endian" machine (e.g., Intel). If necessary you can force byte swapping on or off using the environment variable IVVR_SEGY_SWAPBYTES.
A value of 1 in the format field of the SEGY header normally means that the data values were written in IBM floating point format. But in some cases the values were actually written in IEEE floating point format (which should be indicated by format = 5). Normally the SEGY reader is able to detect this, but if necessary you can specify that float values are in IEEE format by setting environment variable IVVR_SEGY_FLOATISIEEE.
If the SEGY reader fails to read the file correctly, you can set the following environment variables:
Limitations: In some circontances few first traces might be skipped, typically when the first line contains only one trace (this trace might be skipped). In such a case a message warns the application of how many traces are actually skipped (throught SoDebugError
).
See SoPreferences
for information on using environment variables.
In some cases information such as line numbers and crossline numbers will be stored in non-standard locations in the header. Applications can specify the byte position of values within the header using the setSegyTraceHeaderBytePosition()
method.
Information about the range of inline / crossline numbers and the range of time values can be queried using the getInlineRange()
, getCrosslineRange()
and getZRange()
methods.
Applications can use this class to open a SEGY file and extract information from the file directly (in other words without necessarily creating a volume data node). To get the SEGY text file header call getSegyTextHeader()
. To get the SEGY binary file header call getSegyFileHeader()
. To get the header of a specific trace call getSegyTraceHeader()
. To get the values in a specific trace call getSegyTraceData().
See also:
SoVRSegyFileHeader
, SoVRSegyTraceIdHeader
, SoVRSegyTraceHeaderBytePosition
Modifier and Type | Class and Description |
---|---|
static class |
SoVRSegyFileReader.SegyAxisOrders
SegY axis order mode.
|
static class |
SoVRSegyFileReader.SegyByteOrders
Segy byte order mode.
|
static class |
SoVRSegyFileReader.SegyScanningResps
SoSegyScanningCB return code.
|
SoVolumeReader.Axis, SoVolumeReader.CoordinateTypes, SoVolumeReader.CopyPolicies, SoVolumeReader.DataInfo, SoVolumeReader.ReadErrors, SoVolumeReader.ReaderTypes, SoVolumeReader.SubVolumeInfo
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
SCAN_ABORT
Deprecated.
Use
SoVRSegyFileReader.SegyScanningResps.SCAN_ABORT instead. |
static int |
SCAN_CONTINUE
Deprecated.
Use
SoVRSegyFileReader.SegyScanningResps.SCAN_CONTINUE instead. |
static int |
SEGY_BIG_ENDIAN
Deprecated.
Use
SoVRSegyFileReader.SegyByteOrders.SEGY_BIG_ENDIAN instead. |
static int |
SEGY_LITTLE_ENDIAN
Deprecated.
Use
SoVRSegyFileReader.SegyByteOrders.SEGY_LITTLE_ENDIAN instead. |
static int |
XYZ_AS_INLINE_CROSSLINE_SAMPLE
Deprecated.
|
static int |
XYZ_AS_SAMPLE_INLINE_CROSSLINE
Deprecated.
|
AM, AVS, COORDINATES_RECTILINEAR, COORDINATES_UNIFORM, COPY, DICOM, GENERIC, LDM, MEMORY, NO_COPY, NO_READER, RASTERSTACK, RD_FILE_FORMAT_NOT_VALID_ERROR, RD_FILE_NOT_FOUND_ERROR, RD_INVALID_DATA_ERROR, RD_NO_ERROR, RD_UNKNOWN_ERROR, RD_UNSUPPORTED_DATA_TYPE_ERROR, SEGY, TIFF, VOL, VOX, X, Y, Z
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVRSegyFileReader()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getCrosslineRange()
Gets the crossline range.
|
int[] |
getInlineRange()
Gets the inline range.
|
int |
getNumTraces()
Returns the number of traces.
|
SbVec2d[] |
getP1P2P3Coordinates()
Gets the P1, P2, P3 and P4 coordinates.
|
SoVRSegyFileReader.SegyAxisOrders |
getSegyAxisOrder()
Get the storage order for X, Y, and Z axis.
|
SoVRSegyFileReader.SegyByteOrders |
getSegyByteOrder()
Gets the byte ordering to use when reading the SEGY file.
|
SoVRSegyFileHeader |
getSegyFileHeader()
Calls getSegyFileHeader((boolean)false).
|
SoVRSegyFileHeader |
getSegyFileHeader(boolean readFile)
Gets the SEGY file header.
|
java.lang.String |
getSegyTextHeader()
Retreives the textual header (the first 3200-bytes) of the SEGY file.
|
SoVRSegyTraceIdHeader |
getSegyTraceHeader(int traceNumber)
Gets the SEGY trace header of the given trace traceNumber .
|
SoVRSegyTraceHeaderBytePosition |
getSegyTraceHeaderBytePosition()
Gets the byte positions within the trace header.
|
SbVec2d |
getTraceCoord(int i,
int j) |
int[] |
getZRange()
Gets the Z (time axis range.
|
boolean |
isSegyRegular()
Sets the trace header of a specific trace used to read the SEGY file [OPTIONAL].
|
void |
setCrosslineRange(int from,
int to,
int step)
Sets the crossline range.
|
void |
setInlineRange(int from,
int to,
int step)
Sets the inline range.
|
void |
setSegyAxisOrder(SoVRSegyFileReader.SegyAxisOrders axisOrder)
Sets the storage order for X, Y, and Z axes.
|
void |
setSegyByteOrder(SoVRSegyFileReader.SegyByteOrders byteOrder)
Sets the byte ordering to use when reading the SEGY file.
|
boolean |
setSegyFileHeader(SoVRSegyFileHeader fileHeader)
Specifies the header used to read the SEGY file.
|
void |
setSegyTextHeaderAscii(boolean ascii)
Tells whether the textual header format is ASCII or not.
|
void |
setSegyTraceHeaderBytePosition(SoVRSegyTraceHeaderBytePosition traceHeaderBytePosition)
Tells the file reader where the fields are actually located (i.e., the byte positions) within the trace header.
|
static void |
setVolumeSizeVoxels(boolean flag)
If true, the volume extent (bounds in world coordinates) is set to 0 to dimension-1 on each axis.
|
void |
setZRange(int from,
int to,
int step)
Sets the Z (time axis) range.
|
closeAllHandles, getAppropriateReader, getBorderFlag, getConfiguredWriter, getCoordinateType, getCurrentTimeStep, getDataChar, getDirectCoordSys, getDirectCoordSysAutoDetection, getDoubleMinMax, getFilename, getIntMinMax, getMinMax, getNumSignificantBits, getNumSubsampledTiles, getNumTimeSteps, getNumVoxels, getOriginalFilename, getReaderType, getShortTileSize, getSizeToAllocate, getSubSlice, getSubVolumeInfo, getTileMinMax, getTileSize, isDataConverted, isIgnoredFile, isRGBA, isThreadSafe, readTile, readTile, restoreAllHandles, setCurrentTimeStep, setDirectCoordSysAutoDetection, setDirectCoorSys, setFilename, setInputDataRange, setOutputDataType, setRectilinearCoordinates, setRGBA
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int SCAN_CONTINUE
SoVRSegyFileReader.SegyScanningResps.SCAN_CONTINUE
instead.@Deprecated public static final int SCAN_ABORT
SoVRSegyFileReader.SegyScanningResps.SCAN_ABORT
instead.@Deprecated public static final int SEGY_LITTLE_ENDIAN
SoVRSegyFileReader.SegyByteOrders.SEGY_LITTLE_ENDIAN
instead.@Deprecated public static final int SEGY_BIG_ENDIAN
SoVRSegyFileReader.SegyByteOrders.SEGY_BIG_ENDIAN
instead.@Deprecated public static final int XYZ_AS_SAMPLE_INLINE_CROSSLINE
SoVRSegyFileReader.SegyAxisOrders.XYZ_AS_SAMPLE_INLINE_CROSSLINE
instead.@Deprecated public static final int XYZ_AS_INLINE_CROSSLINE_SAMPLE
SoVRSegyFileReader.SegyAxisOrders.XYZ_AS_INLINE_CROSSLINE_SAMPLE
instead.public SoVRSegyFileHeader getSegyFileHeader()
public java.lang.String getSegyTextHeader()
public SoVRSegyFileReader.SegyByteOrders getSegyByteOrder()
public void setSegyByteOrder(SoVRSegyFileReader.SegyByteOrders byteOrder)
public boolean setSegyFileHeader(SoVRSegyFileHeader fileHeader)
Returns false if the operation fails, for example, if SoVolumeReader.setFilename()
was not called first.
public static void setVolumeSizeVoxels(boolean flag)
SoVolumeData
node's extent field.public void setSegyTextHeaderAscii(boolean ascii)
public void setZRange(int from, int to, int step)
getZRange()
.public int[] getCrosslineRange()
setCrosslineRange
are returned.public SoVRSegyFileReader.SegyAxisOrders getSegyAxisOrder()
setSegyAxisOrder()
.public void setInlineRange(int from, int to, int step)
getInlineRange()
.public void setSegyAxisOrder(SoVRSegyFileReader.SegyAxisOrders axisOrder)
The default value is XYZ_AS_SAMPLE_INLINE_CROSSLINE, meaning samples along X, lines along Y, and crosslines along Z axis.
Note: You must call this method before:
SoVolumeData
node.
(Because the last two operations indirectly cause getDataChar() to be called.)
public SbVec2d[] getP1P2P3Coordinates()
public int[] getZRange()
setZRange
are returned.public int[] getInlineRange()
setInlineRange
are returned. public SbVec2d getTraceCoord(int i, int j)
public SoVRSegyTraceHeaderBytePosition getSegyTraceHeaderBytePosition()
public void setSegyTraceHeaderBytePosition(SoVRSegyTraceHeaderBytePosition traceHeaderBytePosition)
public SoVRSegyFileHeader getSegyFileHeader(boolean readFile)
SoVolumeReader.setFilename()
first. Returns false if the operation fails, for example, if SoVolumeReader.setFilename()
was not called first. If readFile is true the file header is read from the file, otherwise the value set by setSegyFileHeader()
is returned instead. If readFile is false but setSegyFileHeader()
was never called, the file header is read from the file anyway.public int getNumTraces()
isSegyRegular()
), an approximate number (considering it as regular) is returned (to avoid scanning the whole file).public void setCrosslineRange(int from, int to, int step)
getCrosslineRange()
.public boolean isSegyRegular()
public SoVRSegyTraceIdHeader getSegyTraceHeader(int traceNumber)
SoVolumeReader.setFilename()
first. Returns false if the operation fails, for example, if SoVolumeReader.setFilename()
was not called first.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com