Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoMRCImageRW Class Reference

VSG extension Class for encoding and decoding an MRC raster image More...

#include <Inventor/image/SoMRCImageRW.h>

+ Inheritance diagram for SoMRCImageRW:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoMRCImageRW ()
 Constructor.
 
virtual ~SoMRCImageRW ()
 Destructor.
 
virtual SbBool open (SoRasterImageIO *rasterImageIO, OpenMode openMode)
 Opens the reader/writer in the specified open mode.
 
virtual SbBool write (SbRasterImage *rasterImage, unsigned int xPos=0, unsigned int yPos=0)
 Writes and encodes the given data in the specific format.
 
virtual SbBool read (SbRasterImage *rasterImage, SbBool infoOnly=FALSE)
 Reads, decodes, and fills the rasterImage parameter.
 
virtual SbBool read (SbRasterImage *rasterImage, size_t imageIndex, SbBool infoOnly=FALSE)
 Read the current open image into rasterImage.
 
virtual SbBool readRegion (SbRasterImage *rasterImage, const SbBox2i32 &region)
 Read the specified region of current open image into rasterImage.
 
virtual SbBool readRegion (SbRasterImage *rasterImage, size_t imageIndex, const SbBox2i32 &region)
 Read the specified region of current open image into rasterImage.
 
- Public Member Functions inherited from SoRasterImageRW
virtual ~SoRasterImageRW ()
 Destructor.
 
virtual void close ()
 Closes the reader/writer.
 
virtual SbBool checkRead (SoRasterImageFile *imageFile)
 Checks if the specified file can be read.
 
virtual SbBool writeHeader (const SbVec2i32 &size)
 Writes and encodes the header for this specific format.
 
virtual SbBool writeFooter ()
 Writes and encodes the footer for this specific format.
 
virtual SbStringgetSuffixes (int &numSuffixes) const
 Returns the list of file suffixes supported.
 
virtual SbBool isMultipleBufferInverted () const
 Returns the write order when using multiple buffers.
 
virtual SoRasterImageRW::WriteCapability getWriteCapability () const
 Returns the write capability of the raster format.
 
virtual SoRasterImageRW::ReadCapability getReadCapability () const
 Returns the read capability of the raster format.
 
virtual void enableMultipleWriting (SbBool state)
 Enable writing image with multiple calls to write method.
 
virtual SbBool isMultipleWritingEnabled () const
 Returns TRUE if multiple buffer writing is enabled.
 
virtual SoDEPRECATED SbBool writeHeader (SbVec2i32 &size)
 Writes and encodes the header for this specific format.
 
virtual SoDEPRECATED SbBool writeHeader (SbVec2s &size)
 Writes and encodes the header for this specific format.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoRasterImageRW
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Additional Inherited Members

- Public Types inherited from SoRasterImageRW
enum  WriteCapability {
  WRITE_SCANLINES ,
  WRITE_FULL_IMAGE ,
  WRITE_UNAVAILABLE
}
 Write Capability enumeration values. More...
 
enum  ReadCapability {
  READ_AVAILABLE ,
  READ_UNAVAILABLE
}
 Read Capability enumeration values. More...
 
enum  OpenMode {
  OPEN_READ ,
  OPEN_WRITE
}
 open Mode enumeration values. More...
 

Detailed Description

VSG extension Class for encoding and decoding an MRC raster image

This class is used for encoding and decoding a MRC raster image.

MRC is a file format that has become industry standard in cryo-electron microscopy (cryoEM) and electron tomography (ET), where the result of the technique is a three-dimensional grid of voxels each with a value corresponding to electron density or electric potential. It was developed by the MRC (Medical Research Council, UK) Laboratory of Molecular Biology. In 2014, the format was standardised. The format specification is available on the CCP-EM website. For details see: http://www.ccpem.ac.uk/mrc_format/mrc2014.php

The writeCapability is WRITE_UNAVAILABLE and isMultipleBufferInverted is TRUE.

See SoRasterImageRW for more information and code examples.

NOTE: Class available since Open Inventor 10.4.

SEE ALSO

SoRasterImageFile, SoRasterImageRW, SbRasterImage, SoVRMrcFileReader

Definition at line 54 of file SoMRCImageRW.h.

Constructor & Destructor Documentation

◆ SoMRCImageRW()

SoMRCImageRW::SoMRCImageRW ( )

Constructor.

◆ ~SoMRCImageRW()

virtual SoMRCImageRW::~SoMRCImageRW ( )
virtual

Destructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoMRCImageRW::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType SoMRCImageRW::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Implements SoRasterImageRW.

◆ open()

virtual SbBool SoMRCImageRW::open ( SoRasterImageIO rasterImageIO,
OpenMode  openMode 
)
virtual

Opens the reader/writer in the specified open mode.

Returns true if successful.

Reimplemented from SoRasterImageRW.

◆ read() [1/2]

virtual SbBool SoMRCImageRW::read ( SbRasterImage rasterImage,
SbBool  infoOnly = FALSE 
)
virtual

Reads, decodes, and fills the rasterImage parameter.

If infoOnly is TRUE, then the buffer will not be read; the parameter rasterImage will be set with raster size and raster number of components, the buffer will be NULL.

Implements SoRasterImageRW.

◆ read() [2/2]

virtual SbBool SoMRCImageRW::read ( SbRasterImage rasterImage,
size_t  imageIndex,
SbBool  infoOnly = FALSE 
)
virtual

Read the current open image into rasterImage.

Returns true if successful. Call the open() method before calling this method.

If infoOnly is TRUE, then the buffer will not be read; the parameter rasterImage will be set with raster size and raster number of components, the buffer will be NULL.

Reimplemented from SoRasterImageRW.

◆ readRegion() [1/2]

virtual SbBool SoMRCImageRW::readRegion ( SbRasterImage rasterImage,
const SbBox2i32 region 
)
virtual

Read the specified region of current open image into rasterImage.

Returns true if successful. Call the open() method before calling this method.

After calling this method successfully, the size of the SbRasterImage is the requested region size. The requested region may extend outside the source image. In this case, undefined pixels are set to zero. The region may be as small as a single pixel, e.g. (1,1,1,1), but xmin must be <= xmax and ymin <= ymax.

Warning
This implementation read full image and after copy the desired region.

Reimplemented from SoRasterImageRW.

◆ readRegion() [2/2]

virtual SbBool SoMRCImageRW::readRegion ( SbRasterImage rasterImage,
size_t  imageIndex,
const SbBox2i32 region 
)
virtual

Read the specified region of current open image into rasterImage.

Returns true if successful. Call the open() method before calling this method.

After calling this method successfully, the size of the SbRasterImage is the requested region size. The requested region may extend outside the source image. In this case, undefined pixels are set to zero. The region may be as small as a single pixel, e.g. (1,1,1,1), but xmin must be <= xmax and ymin <= ymax.

Reimplemented from SoRasterImageRW.

◆ write()

virtual SbBool SoMRCImageRW::write ( SbRasterImage rasterImage,
unsigned int  xPos = 0,
unsigned int  yPos = 0 
)
virtual

Writes and encodes the given data in the specific format.

If you are using the multiple writing mode, then you can specify the offset (with xPos,yPos) you want to write to.

Implements SoRasterImageRW.


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