Class SoMRCImageRW


  • public class SoMRCImageRW
    extends SoRasterImageRW
    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
    • Constructor Detail

      • SoMRCImageRW

        public SoMRCImageRW()
        Constructor.
    • Method Detail

      • read

        public boolean read​(SbRasterImage rasterImage,
                            long imageIndex)
        Calls read(rasterImage, imageIndex, false).
      • readRegion

        public boolean readRegion​(SbRasterImage rasterImage,
                                  long imageIndex,
                                  SbBox2i32 region)
        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.

      • read

        public boolean read​(SbRasterImage rasterImage,
                            long imageIndex,
                            boolean infoOnly)
        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.