Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoVRSegyFileReader Class Reference

VolumeViz SEGY file format reader. More...

#include <VolumeViz/readers/SoVRSegyFileReader.h>

+ Inheritance diagram for SoVRSegyFileReader:

Public Types

enum  SegyScanningResp {
  SCAN_CONTINUE ,
  SCAN_ABORT
}
 SoSegyScanningCB return code. More...
 
enum  SegyByteOrder {
  SEGY_LITTLE_ENDIAN ,
  SEGY_BIG_ENDIAN
}
 Segy byte order mode. More...
 
enum  SegyAxisOrder {
  XYZ_AS_SAMPLE_INLINE_CROSSLINE ,
  XYZ_AS_INLINE_CROSSLINE_SAMPLE
}
 SegY axis order mode. More...
 
typedef SegyScanningResp SoSegyScanningCB(void *data, float percent, SoVRSegyFileReader *reader)
 SoSegyScanningCB Callback type.
 
- Public Types inherited from SoVolumeReader
enum  ReadError {
  RD_NO_ERROR ,
  RD_FILE_NOT_FOUND_ERROR ,
  RD_INVALID_DATA_ERROR ,
  RD_UNSUPPORTED_DATA_TYPE_ERROR ,
  RD_FILE_FORMAT_NOT_VALID_ERROR ,
  RD_UNKNOWN_ERROR
}
 Read error. More...
 
enum  Axis {
  X ,
  Y ,
  Z
}
 Which axis to handle. More...
 
enum  ReaderType {
  NO_READER ,
  AM ,
  AVS ,
  DICOM ,
  GENERIC ,
  LDM ,
  MEMORY ,
  RASTERSTACK ,
  SEGY ,
  VOL ,
  VOX ,
  TIFF ,
  MRC
}
 Available reader type. More...
 
enum  CoordinateType {
  COORDINATES_UNIFORM = 0 ,
  COORDINATES_RECTILINEAR
}
 Coordinate type used by this data set. More...
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoVRSegyFileReader ()
 Constructor.
 
virtual ReadError getDataChar (SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim) override
 Gets the characteristics (file header) of the data volume.
 
virtual void getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, void *data)
 Must copy the rectangular part defined by subSlice of the XY slice sliceNumber to the memory referenced by data.
 
virtual SbBool setDirectCoordSysAutoDetection (SbBool autoValue)
 Sets whether or not the reader should automatically try to detect if the coordinate system used is direct (right-handed) or not.
 
virtual SoVolumeReader::ReaderType getReaderType ()
 Returns the reader type, in this case, the enum value SoVolumeReader::SEGY.
 
virtual int setFilename (const SbString &filename)
 Specifies the path of the file.
 
void setScanningProgressCallback (SoSegyScanningCB *func, void *data)
 Sets a progress callback when the SEGY file is scanned.
 
virtual void setSegyTextHeaderAscii (bool ascii)
 Tells whether the textual header format is ASCII or not.
 
virtual SbString getSegyTextHeader ()
 Retreives the textual header (the first 3200-bytes) of the SEGY file.
 
virtual void setSegyByteOrder (SegyByteOrder byteOrder)
 Sets the byte ordering to use when reading the SEGY file.
 
virtual SegyByteOrder getSegyByteOrder ()
 Gets the byte ordering to use when reading the SEGY file.
 
virtual SbBool setSegyFileHeader (const SoVRSegyFileHeader &fileHeader)
 Specifies the header used to read the SEGY file.
 
virtual SbBool getSegyFileHeader (SoVRSegyFileHeader &fileHeader, bool readFile=false)
 Gets the SEGY file header.
 
virtual void setSegyTraceHeaderBytePosition (const SoVRSegyTraceHeaderBytePosition &traceHeaderBytePosition)
 Tells the file reader where the fields are actually located (i.e., the byte positions) within the trace header.
 
virtual SoVRSegyTraceHeaderBytePosition getSegyTraceHeaderBytePosition ()
 Gets the byte positions within the trace header.
 
virtual int getNumTraces ()
 Returns the number of traces.
 
virtual SbBool getSegyTraceHeader (int traceNumber, SoVRSegyTraceIdHeader &traceHeader)
 Gets the SEGY trace header of the given trace traceNumber .
 
virtual SbBool isSegyRegular ()
 Sets the trace header of a specific trace used to read the SEGY file [OPTIONAL].
 
virtual void setCrosslineRange (int from, int to, int step)
 Sets the crossline range.
 
virtual void setInlineRange (int from, int to, int step)
 Sets the inline range.
 
virtual void setZRange (int from, int to, int step)
 Sets the Z (time axis) range.
 
virtual void getCrosslineRange (int &from, int &to, int &step)
 Gets the crossline range.
 
virtual void getInlineRange (int &from, int &to, int &step)
 Gets the inline range.
 
virtual void getZRange (int &from, int &to, int &step)
 Gets the Z (time axis range.
 
virtual SbBool getP1P2P3Coordinates (SbVec2d &P1, SbVec2d &P2, SbVec2d &P3, SbVec2d &P4)
 Gets the P1, P2, P3 and P4 coordinates.
 
virtual SbBool setDirectCoorSys (SbBool directCoord)
 Specifies if the coordinate system used is direct (right-handed) or not.
 
virtual void setSegyAxisOrder (SegyAxisOrder axisOrder)
 Sets the storage order for X, Y, and Z axes.
 
virtual SegyAxisOrder getSegyAxisOrder ()
 Get the storage order for X, Y, and Z axis.
 
virtual int getSegyTraceData (int traceNumber, void *&traceData, int start=0, int size=-1)
 Gets the SEGY trace data of the specified trace traceNumber.
 
bool getTraceCoord (const int i, const int j, SbVec2d &P)
 
virtual SbBool setOutputDataType (SbBool doChange, SoDataSet::DataType type)
 Requests that the input be converted (if necessary) to the specified data type.
 
virtual SbBool setInputDataRange (SbBool doChange, double min, double max)
 Requests that the input be converted from the specified range to the range depending on the output data type.
 
- Public Member Functions inherited from SoVolumeReader
 SoVolumeReader ()
 Constructor.
 
virtual int getNumSignificantBits ()
 This method is optional.
 
SbVec3i32 getNumVoxels (const SbVec3i32 &realSize, const SbVec3i32 &subsamplingLevel)
 Utility function provided by SoVolumeReader for subclass readers to call.
 
SbVec3i32 getSizeToAllocate (const SbVec3i32 &realSize, const SbVec3i32 &subsamplingLevel)
 Utility function provided by SoVolumeReader for subclass readers to call.
 
SbString getFilename () const
 Returns the path of the file.
 
virtual SbBool isDataConverted () const
 Returns TRUE if the data is already organized in tiles for the LDM module.
 
virtual void reloadTileMinMax ()
 
virtual SbBool getTileSize (SbVec3i32 &size)
 Returns tile dimensions in voxels when using data stored in tiles.
 
virtual SoBufferObjectreadTile (int index, const SbBox3i32 &tilePosition)
 Given an index, reads a tile if the data is organized in tiles (for LDM).
 
virtual SbBool readXTraceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const SbVec2i32 &tracePosition)
 Read directly from the data source, a trace inside a tile.
 
virtual SbBool readYSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
 Read directly from the data source, an orthoslice on the Y axis (Zaxis == 1) inside a tile.
 
virtual SbBool readZSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
 Read directly from the data source, an orthoslice on the Z axis (Zaxis == 2) inside a tile.
 
virtual SbBool readXSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
 Read directly from the data source, an orthoslice on the X axis (Zaxis == 0) inside a tile.
 
virtual SbBool isThreadSafe () const
 Should return TRUE if the reader is thread safe.
 
virtual SbBool isIgnoredFile () const
 Should return TRUE if at least one file has been ignored during reading.
 
virtual SbString getOriginalFilename () const
 Returns original file name from which the data has been converted to LDM format if stored in file.
 
virtual SbBool getMinMax (int64_t &min, int64_t &max)
 Returns min and max for integer data type, if available.
 
virtual SbBool getMinMax (double &min, double &max)
 Returns min max for float data type, if available.
 
virtual SbBool getHistogram (std::vector< int64_t > &numVox)
 Returns histogram if available.
 
virtual SbBool getDirectCoordSysAutoDetection ()
 Return automatic detection value.
 
virtual SbBool getDirectCoordSys ()
 Return whether the coordinate system used is direct or not.
 
virtual SbVec2d getTileMinMax (int index) const
 Returns the minimum and maximum data values for the given tile.
 
virtual SoVolumeWritergetConfiguredWriter ()
 Returns a volume writer that corresponds to this reader
(same format, parameters, etc).
 
CoordinateType getCoordinateType ()
 Returns coordinate type used by the data set.
 
const float * getRectilinearCoordinates (Axis axis) const
 Returns the coordinates for the specified axis.
 
void setRectilinearCoordinates (const float *x, const float *y, const float *z)
 Sets rectilinear coordinates for the data set.
 
virtual SbBool isRGBA () const
 Returns TRUE if the data set contains RGBA color values.
 
void setRGBA (const SbBool flag)
 Specifies if data must be considered as RGBA.
 
virtual void closeAllHandles ()
 Close all resources that are locked by the reader.
 
virtual void restoreAllHandles ()
 Restore resources that were closed by closeAllHandles().
 
virtual SoDEPRECATED SbBool readTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition)
 Given an index, reads a tile if the data is organized in tiles (for LDM).
 
virtual SoDEPRECATED SbBool readTile (int index, SoBufferObject *buffer, const SbBox3i32 &tilePosition)
 Same as readTile(int index, unsigned char*& buffer, const SbBox3i32& tilePosition) but using an SoBufferObject (allocated by LDM) as the target of the data.
 
virtual SoDEPRECATED int getBorderFlag ()
 Returns border (overlap) value if stored in file.
 
virtual SoDEPRECATED SbBool getMinMax (int &min, int &max)
 Returns min max if stored in file.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void setVolumeSizeVoxels (SbBool flag)
 If TRUE, the volume extent (bounds in world coordinates) is set to 0 to dimension-1 on each axis.
 
- Static Public Member Functions inherited from SoVolumeReader
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoVolumeReadergetAppropriateReader (const SbString &filename)
 Returns a preconfigured SoVolumeReader instance that can be used to load the given file (based on the filename extension).
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Additional Inherited Members

- Protected Member Functions inherited from SoVolumeReader
virtual ~SoVolumeReader ()
 Destructor.
 
void * getBuffer (int64_t offset, unsigned int size)
 Returns a pointer to a buffer of size bytes corresponding to a part of the file at offset bytes from the beginning of the file.
 
int64_t fileSize ()
 Returns the size of the file when file I/O is handled by this class.
 
- Static Protected Member Functions inherited from SoVolumeReader
static bool registerVolumeReaderExtension (const SbString &fileExtension, const SoType &readerType)
 Register an SoVolumeReader class to handle a file extension.
 
static bool unregisterVolumeReaderExtensions (const SoType &readerType)
 Unregister all filename extensions associated with the specified SoVolumeReader class.
 
static int bytesToInt (const unsigned char *ptr, int sizeBytes)
 Utility method that returns an integer from sizeBytes bytes starting at address ptr.
 
static void swapBytes (int *intPtr, int sizeBytes)
 Utility method to convert an integer into the correct architecture (little/big endian).
 
static void swapBytesN (void *buffer, int numElements, int numBytesPerElement)
 Utility method to swap bytes of each element of an array of numElements elements.
 
static SbBool isValidFloat (const float val)
 Utility method to check if value is a valid IEEE 754 floating point number.
 
static SbBox3f adjustFlatExtent (const SbString &fileName, const SbBox3f &extent, const SbVec3i32 &dim)
 VolumeViz doesn't handles empty extent (for ex.
 
- Protected Attributes inherited from SoVolumeReader
SoDEPRECATED SbBool m_dataConverted
 

Detailed Description

VolumeViz SEGY file format reader.

Reader for SEGY files (SEG Y revision 1). The following data types are supported: unsigned or signed byte, short, int32, and float.

SEGY is a widely used format for storing seismic trace data, defined by the Society of Exploration Geophysicists publication "Digital Tape Standards" (http://www.seg.org). The VolumeViz reader supports all sizes of integer and float data, and can correctly determine the number of samples per trace in most cases.

The data will be mapped to the Open Inventor axes as follows:

  • The trace length is mapped onto the Inventor X axis (time).
  • The number of trace sensors per line is mapped onto the Inventor Y axis (inlines).
  • Z is the number of lines (crosslines).

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. 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. 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:

  • IVVR_SEGY_DEBUG=1 This outputs information of what the reader is actually doing.
  • IVVR_SEGY_DUMP=filename This requests that some information of the file and trace headers be written to the specified file while processing the SEGY data file. All these information can be sent to the VSG support for assitance.

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.
Example :

reader->setFilename(theFilePath);
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> SEGY file format read...
SoVRSegyFileReader()
Constructor.
virtual int setFilename(const SbString &filename)
Specifies the path of the file.
virtual void setSegyTraceHeaderBytePosition(const SoVRSegyTraceHeaderBytePosition &traceHeaderBytePosition)
Tells the file reader where the fields are actually located (i.e., the byte positions) within the tra...
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> SEGY file trace heade...
void setBytePosition(TraceAttribute attr, uint8_t position)
Sets/Gets the byte position of a specific attribute within the trace header.

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

Definition at line 151 of file SoVRSegyFileReader.h.

Member Typedef Documentation

◆ SoSegyScanningCB

typedef SegyScanningResp SoVRSegyFileReader::SoSegyScanningCB(void *data, float percent, SoVRSegyFileReader *reader)

SoSegyScanningCB Callback type.

Definition at line 214 of file SoVRSegyFileReader.h.

Member Enumeration Documentation

◆ SegyAxisOrder

SegY axis order mode.

Enumerator
XYZ_AS_SAMPLE_INLINE_CROSSLINE 

XYZ_AS_SAMPLE_INLINE_CROSSLINE.

XYZ_AS_INLINE_CROSSLINE_SAMPLE 

XYZ_AS_INLINE_CROSSLINE_SAMPLE.

Definition at line 419 of file SoVRSegyFileReader.h.

◆ SegyByteOrder

Segy byte order mode.

Enumerator
SEGY_LITTLE_ENDIAN 

Little endian.

SEGY_BIG_ENDIAN 

Big endian.

Definition at line 248 of file SoVRSegyFileReader.h.

◆ SegyScanningResp

SoSegyScanningCB return code.

Enumerator
SCAN_CONTINUE 
SCAN_ABORT 

Definition at line 206 of file SoVRSegyFileReader.h.

Constructor & Destructor Documentation

◆ SoVRSegyFileReader()

SoVRSegyFileReader::SoVRSegyFileReader ( )

Constructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoVRSegyFileReader::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getCrosslineRange()

virtual void SoVRSegyFileReader::getCrosslineRange ( int &  from,
int &  to,
int &  step 
)
virtual

Gets the crossline range.

This method returns the actual values from the file if the corresponding set method has not been called previously. Otherwise, the values previously specified with setCrosslineRange are returned.

◆ getDataChar()

virtual ReadError SoVRSegyFileReader::getDataChar ( SbBox3f size,
SoDataSet::DataType type,
SbVec3i32 dim 
)
overridevirtual

Gets the characteristics (file header) of the data volume.

See SoDataSet::setVolumeData().
You can use the convenience method setFilename() to specify the file location, in which case you will not have to open the file yourself. Then you can use the convenience method getBuffer() to read the header in order to get the requested information.

NOTE: We strongly recommend that readers implement this version of getDataChar, introduced in VolumeViz 5.1, because it uses SbVec3i32 for the volume dimension.

Implements SoVolumeReader.

◆ getInlineRange()

virtual void SoVRSegyFileReader::getInlineRange ( int &  from,
int &  to,
int &  step 
)
virtual

Gets the inline range.

This method returns the actual values from the file if the corresponding set method has not been called previously. Otherwise, the values previously specified with setInlineRange are returned.

NOTE: If the inline values are incorrect in the file, or are not retrieved correctly for any reason, getInlineRange returns (1, numLines, 1).

◆ getNumTraces()

virtual int SoVRSegyFileReader::getNumTraces ( )
virtual

Returns the number of traces.

If the file is not regular (see isSegyRegular()), an approximate number (considering it as regular) is returned (to avoid
scanning the whole file).

◆ getP1P2P3Coordinates()

virtual SbBool SoVRSegyFileReader::getP1P2P3Coordinates ( SbVec2d P1,
SbVec2d P2,
SbVec2d P3,
SbVec2d P4 
)
virtual

Gets the P1, P2, P3 and P4 coordinates.

P1, P2 are on the corners corresponding to the first line. P4, P3 are on the corners corresponding to the last line. If these points do not exist, the crossline and inline values are used instead. Returns TRUE for a right-handed coordinate system (Xline/Inline/Time).

◆ getReaderType()

virtual SoVolumeReader::ReaderType SoVRSegyFileReader::getReaderType ( )
inlinevirtual

Returns the reader type, in this case, the enum value SoVolumeReader::SEGY.

Reimplemented from SoVolumeReader.

Definition at line 190 of file SoVRSegyFileReader.h.

◆ getSegyAxisOrder()

virtual SegyAxisOrder SoVRSegyFileReader::getSegyAxisOrder ( )
virtual

Get the storage order for X, Y, and Z axis.

See setSegyAxisOrder().

◆ getSegyByteOrder()

virtual SegyByteOrder SoVRSegyFileReader::getSegyByteOrder ( )
virtual

Gets the byte ordering to use when reading the SEGY file.

◆ getSegyFileHeader()

virtual SbBool SoVRSegyFileReader::getSegyFileHeader ( SoVRSegyFileHeader fileHeader,
bool  readFile = false 
)
virtual

Gets the SEGY file header.

If you use this class to read a SEGY file directly, you will have to call the method 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.

◆ getSegyTextHeader()

virtual SbString SoVRSegyFileReader::getSegyTextHeader ( )
virtual

Retreives the textual header (the first 3200-bytes) of the SEGY file.

◆ getSegyTraceData()

virtual int SoVRSegyFileReader::getSegyTraceData ( int  traceNumber,
void *&  traceData,
int  start = 0,
int  size = -1 
)
virtual

Gets the SEGY trace data of the specified trace traceNumber.

traceNumber can range from zero to the number of traces minus one. If you want to get a subset of the data, specify the start position in the trace and the number of data values ( size ). The return value is the number of data values read, or 0, if the operation failed.

If you use this class to read a SEGY file directly, you will have to call the method SoVolumeReader::setFilename() first. Additionally your application will be responsible for releasing the memory afterward. Otherwise,VolumeViz will release the memory.

This returns a pointer to an internal buffer, so if you want to call this method twice in order to get two traces, copy the first trace into your own buffer before calling this method for the second trace.

◆ getSegyTraceHeader()

virtual SbBool SoVRSegyFileReader::getSegyTraceHeader ( int  traceNumber,
SoVRSegyTraceIdHeader traceHeader 
)
virtual

Gets the SEGY trace header of the given trace traceNumber .

traceNumber can range from zero to the number of traces minus one. If you use this class to read a SEGY file directly, you will have to call the method SoVolumeReader::setFilename() first. Returns FALSE if the operation fails, for example, if SoVolumeReader::setFilename() was not called first.

◆ getSegyTraceHeaderBytePosition()

virtual SoVRSegyTraceHeaderBytePosition SoVRSegyFileReader::getSegyTraceHeaderBytePosition ( )
virtual

Gets the byte positions within the trace header.

◆ getSubSlice()

virtual void SoVRSegyFileReader::getSubSlice ( const SbBox2i32 subSlice,
int  sliceNumber,
void *  data 
)
virtual

Must copy the rectangular part defined by subSlice of the XY slice sliceNumber to the memory referenced by data.

Slices will not always be read sequentially.

Parameters
subSlice2D region of the slice to return.
sliceNumberSlice number on the volume Z axis (first slice is 0).
dataCopy the data into this buffer.

You can use the convenience method getBuffer() to read data from file. Note: setFilename() must have been called previously.

Reimplemented from SoVolumeReader.

◆ getTraceCoord()

bool SoVRSegyFileReader::getTraceCoord ( const int  i,
const int  j,
SbVec2d P 
)

◆ getTypeId()

virtual SoType SoVRSegyFileReader::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoVolumeReader.

◆ getZRange()

virtual void SoVRSegyFileReader::getZRange ( int &  from,
int &  to,
int &  step 
)
virtual

Gets the Z (time axis range.

This method returns the actual values from the file if the corresponding set method has not been called previously. Otherwise, the values previously specified with setZRange are returned.

◆ isSegyRegular()

virtual SbBool SoVRSegyFileReader::isSegyRegular ( )
virtual

Sets the trace header of a specific trace used to read the SEGY file [OPTIONAL].

Indicates if SEGY file is regular. A file with the same number of traces in each inline and with the same number of samples for each trace is considered as regular.

◆ setCrosslineRange()

virtual void SoVRSegyFileReader::setCrosslineRange ( int  from,
int  to,
int  step 
)
virtual

Sets the crossline range.

Note that this setting does not limit the amount of data read from the file (although a subclass could do that). It just specifies the range values that will be returned by getCrosslineRange().

◆ setDirectCoordSysAutoDetection()

virtual SbBool SoVRSegyFileReader::setDirectCoordSysAutoDetection ( SbBool  autoValue)
virtual

Sets whether or not the reader should automatically try to detect if the coordinate system used is direct (right-handed) or not.

Default is FALSE.

Reimplemented from SoVolumeReader.

◆ setDirectCoorSys()

virtual SbBool SoVRSegyFileReader::setDirectCoorSys ( SbBool  directCoord)
virtual

Specifies if the coordinate system used is direct (right-handed) or not.

Default is TRUE. If the coordinate system is direct, then samples are stored in increasing order along the positive X axis, traces are stored in increasing order along the positive Y axis, and lines are stored in increasing order along the positive Z axis. If the coordinate system in indirect, everything is the same except that lines are stored in decreasing order along the positive Z axis. NOTE: If you pass the value returned by getP1P2P3Coordinates(), the resulting LDM file will be always right handed.

Reimplemented from SoVolumeReader.

◆ setFilename()

virtual int SoVRSegyFileReader::setFilename ( const SbString filename)
virtual

Specifies the path of the file.

Returns 0 for success. Any other return value indicates failure.

Reimplemented from SoVolumeReader.

◆ setInlineRange()

virtual void SoVRSegyFileReader::setInlineRange ( int  from,
int  to,
int  step 
)
virtual

Sets the inline range.

Note that this setting does not limit the amount of data read from the file (although a subclass could do that). It just specifies the range values that will be returned by getInlineRange().

◆ setInputDataRange()

virtual SbBool SoVRSegyFileReader::setInputDataRange ( SbBool  doChange,
double  min,
double  max 
)
virtual

Requests that the input be converted from the specified range to the range depending on the output data type.

This allows, for instance, if the output data type is unsigned byte, conversion of float data from range [min,max] to range [0,255]. If doChange is FALSE no range conversion is applied. Always returns TRUE.

Reimplemented from SoVolumeReader.

◆ setOutputDataType()

virtual SbBool SoVRSegyFileReader::setOutputDataType ( SbBool  doChange,
SoDataSet::DataType  type 
)
virtual

Requests that the input be converted (if necessary) to the specified data type.

This allows, for instance, conversion of float data to unsigned byte. If doChange is FALSE no type conversion is applied. Always returns TRUE.

Reimplemented from SoVolumeReader.

◆ setScanningProgressCallback()

void SoVRSegyFileReader::setScanningProgressCallback ( SoSegyScanningCB func,
void *  data 
)

Sets a progress callback when the SEGY file is scanned.

The SEGY file is scanned when:

◆ setSegyAxisOrder()

virtual void SoVRSegyFileReader::setSegyAxisOrder ( SegyAxisOrder  axisOrder)
virtual

Sets the storage order for X, Y, and Z axes.


For example, XYZ_AS_INLINE_CROSSLINE_SAMPLE means lines along X, crosslines along Y, and samples along Z axis.

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:

(Because the last two operations indirectly cause getDataChar() to be called.)

◆ setSegyByteOrder()

virtual void SoVRSegyFileReader::setSegyByteOrder ( SegyByteOrder  byteOrder)
virtual

Sets the byte ordering to use when reading the SEGY file.

The default value is SEGY_LITTLE_ENDIAN. In most cases, even when the SEGY file is big endian, the SEGY file reader is able to detect this and read the file accordingly. This method is for the very rare case when the automatic byte order detection fails.

◆ setSegyFileHeader()

virtual SbBool SoVRSegyFileReader::setSegyFileHeader ( const SoVRSegyFileHeader fileHeader)
virtual

Specifies the header used to read the SEGY file.

If this method is called, the reader uses the binary file header you pass rather than the actual binary file header. The following fields from the binary file header are used:

  • formatRevisionNumber
  • numTextHeaderExt
  • format
  • fixedLengthTraceFlag
  • hns (number of samples per trace)

Returns FALSE if the operation fails, for example, if SoVolumeReader::setFilename() was not called first.

◆ setSegyTextHeaderAscii()

virtual void SoVRSegyFileReader::setSegyTextHeaderAscii ( bool  ascii)
virtual

Tells whether the textual header format is ASCII or not.

The default value is false, i.e., the textual header format is EBCDIC

◆ setSegyTraceHeaderBytePosition()

virtual void SoVRSegyFileReader::setSegyTraceHeaderBytePosition ( const SoVRSegyTraceHeaderBytePosition traceHeaderBytePosition)
virtual

Tells the file reader where the fields are actually located (i.e., the byte positions) within the trace header.

Only the field SEGY_CDP is used (Xline position).

◆ setVolumeSizeVoxels()

static void SoVRSegyFileReader::setVolumeSizeVoxels ( SbBool  flag)
static

If TRUE, the volume extent (bounds in world coordinates) is set to 0 to dimension-1 on each axis.

Else the volume extent is normalized to fit inside a unit cube centered at the origin. In other words, the size will be -.5 to +.5 along the longest dimension. FALSE by default. The application can also set the volume extent to whatever is appropriate by setting the SoVolumeData node's extent field.

◆ setZRange()

virtual void SoVRSegyFileReader::setZRange ( int  from,
int  to,
int  step 
)
virtual

Sets the Z (time axis) range.

Note that this setting does not limit the amount of data read from the file (although a subclass could do that). It just specifies the range values that will be returned by getZRange().


The documentation for this class was generated from the following file: