VolumeFileReader
Date: 2019-10-22

org.jmol.jvxl.readers

## Class VolumeFileReader

- java.lang.Object
- - org.jmol.jvxl.readers.SurfaceReader
  - - org.jmol.jvxl.readers.SurfaceFileReader
    - - org.jmol.jvxl.readers.VolumeFileReader

- All Implemented Interfaces:
    VertexDataServer
  Direct Known Subclasses:
    ApbsReader, CubeReader, DelPhiBinaryReader, IsoIntersectGridReader, JaguarReader, JvxlXmlReader, MapFileReader, PeriodicVolumeFileReader, PltFormattedReader, UhbdReader, XsfReader

      abstract class VolumeFileReader
      extends SurfaceFileReader

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `ac`
    `protected javajs.util.P3[]` | `boundingBox`
    `protected boolean` | `canDownsample`
    `protected int` | `downsampleFactor`
    `protected int[]` | `downsampleRemainders`
    `protected boolean` | `endOfData`
    `private boolean` | `getNCIPlanes`
    `private int` | `iPlaneNCI`
    `protected boolean` | `isAngstroms`
    `private boolean` | `isScaledAlready`
    `protected int` | `nData`
    `protected boolean` | `negativeAtomCount`
    `protected int` | `nSkipX`
    `protected int` | `nSkipY`
    `protected int` | `nSkipZ`
    `protected int` | `nSurfaces`
    `protected boolean` | `readerClosed`
    `private float[][]` | `yzPlanesRaw`

    - ### Fields inherited from class org.jmol.jvxl.readers.SurfaceFileReader

      `binarydoc, br, line, next, out`

    - ### Fields inherited from class org.jmol.jvxl.readers.SurfaceReader

      `allowSigma, ANGSTROMS_PER_BOHR, anisotropy, center, cJvxlEdgeNaN, colorFractionBase, colorFractionRange, contourVertexCount, dataMax, dataMean, dataMin, defaultCutoff, defaultMappedDataMax, defaultMappedDataMin, eccentricityMatrix, eccentricityMatrixInverse, eccentricityRatio, eccentricityScale, edgeFractionBase, edgeFractionRange, fractionData, hasColorData, haveSurfaceAtoms, isAnisotropic, isEccentric, isJvxl, isPeriodic, isProgressive, isQuiet, isXLowToHigh, jvxlColorDataRead, jvxlCutoff, jvxlData, jvxlDataIs2dContour, jvxlDataIsColorDensity, jvxlDataIsColorMapped, jvxlDataIsPrecisionColor, jvxlEdgeDataRead, jvxlFileHeaderBuffer, jvxlNSurfaceInts, jvxlVoxelBitSet, marchingCubes, marchingSquares, meshData, meshDataServer, minMax, nBytes, nDataPoints, nPointsX, nPointsY, nPointsZ, params, ptTemp, qpc, sg, vertexDataOnly, volumeData, volumetricOrigin, volumetricVectors, voxelCounts, voxelData, xyzMax, xyzMin, yzCount, yzPlanes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VolumeFileReader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `checkAtomLine(boolean isXLowToHigh, boolean isAngstroms, java.lang.String strAtomCount, java.lang.String atomLine, javajs.util.SB bs)` checks an atom line for "ANGSTROMS", possibly overriding the data's natural units, BOHR (similar to Gaussian CUBE files).
    `protected void` | `closeReader()`
    `private int` | `countData(java.lang.String str)`
    `protected float` | `getNextVoxelValue()`
    `float[]` | `getPlane(int x)`
    `float[]` | `getPlaneNCI(int x)` Retrieve raw file planes and pass them to the calculation object for processing into new data.
    `private void` | `getPlaneVFR(float[] plane, boolean doRecord)`
    `protected float` | `getSPFv(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, javajs.util.T3 ptReturn)`
    `protected float` | `getSurfacePointAndFraction(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, javajs.util.T3 ptReturn)`
    `float` | `getValue(int x, int y, int z, int ptyz)` for readers only
    `protected javajs.util.BS` | `getVoxelBitSet(int nPoints)`
    `protected void` | `gotoData(int n, int nPoints)`
    `(package private) void` | `init2(SurfaceGenerator sg, java.io.BufferedReader br)`
    `(package private) void` | `init2VFR(SurfaceGenerator sg, java.io.BufferedReader br)`
    `(package private) void` | `initializeSurfaceData()`
    `protected float` | `nextVoxel()`
    `protected abstract void` | `readParameters()`
    `protected void` | `readSurfaceData(boolean isMapData)`
    `protected void` | `readSurfaceDataVFR(boolean isMapData)`
    `protected boolean` | `readVolumeData(boolean isMapData)`
    `protected boolean` | `readVolumeDataVFR(boolean isMapData)`
    `protected boolean` | `readVolumeParameters(boolean isMapData)`
    `private int` | `readVolumetricHeader()`
    `protected void` | `readVoxelVector(int voxelVectorIndex)`
    `protected float` | `recordData(float value)`
    `private void` | `scaleIsosurface(float scale)`
    `protected java.lang.String` | `skipComments(boolean allowBlankLines)`
    `protected void` | `skipData(int nPoints)`
    `protected void` | `skipDataVFR(int nPoints)`
    `private void` | `skipVoxels(int n)`
    `protected void` | `swapXZ()`

    - ### Methods inherited from class org.jmol.jvxl.readers.SurfaceFileReader

      `closeReaderSFR, discardTempData, getQuotedStringNext, getTokens, init, init2SFR, newBinaryDocument, parseFloat, parseFloatArray, parseFloatArrayStr, parseFloatRange, parseFloatStr, parseInt, parseIntNext, parseIntStr, rd, setOutputChannel, setStream, skipTo`

    - ### Methods inherited from class org.jmol.jvxl.readers.SurfaceReader

      `addTriangleCheck, addVC, addVertexCopy, applyColorScale, colorIsosurface, createIsosurface, discardTempDataSR, excludeMaximumSet, excludeMinimumSet, finalizeMapping, getColorPhaseIndex, getMinMaxMappedValues, getPlaneSR, getSPF, getSurfaceAtomIndex, getSurfacePointIndexAndFraction, getValue2, getValueAtPoint, gotoAndReadVoxelData, initializeMapping, initializeVolumetricData, initPlanes, initSR, jvxlUpdateInfo, newVoxelDataCube, postProcessVertices, readAndSetVolumeParameters, readColorData, resetIsosurface, selectPocket, setBBox, setVectorAnisotropy, setVertexAnisotropy, setVolumeDataV, setVolumetricAnisotropy, setVolumetricOriginAnisotropy, slabIsosurface, updateSurfaceData, updateTriangles`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### endOfData

          protected boolean endOfData

    - #### negativeAtomCount

          protected boolean negativeAtomCount

    - #### ac

          protected int ac

    - #### nSurfaces

          protected int nSurfaces

    - #### isAngstroms

          protected boolean isAngstroms

    - #### canDownsample

          protected boolean canDownsample

    - #### downsampleRemainders

          protected int[] downsampleRemainders

    - #### getNCIPlanes

          private boolean getNCIPlanes

    - #### nData

          protected int nData

    - #### readerClosed

          protected boolean readerClosed

    - #### downsampleFactor

          protected int downsampleFactor

    - #### nSkipX

          protected int nSkipX

    - #### nSkipY

          protected int nSkipY

    - #### nSkipZ

          protected int nSkipZ

    - #### yzPlanesRaw

          private float[][] yzPlanesRaw

    - #### iPlaneNCI

          private int iPlaneNCI

    - #### boundingBox

          protected javajs.util.P3[] boundingBox

    - #### isScaledAlready

          private boolean isScaledAlready

  - ### Constructor Detail

    - #### VolumeFileReader

          VolumeFileReader()

  - ### Method Detail

    - #### init2

          void init2(SurfaceGenerator sg,
                     java.io.BufferedReader br)

      Overrides:
        `init2` in class `SurfaceFileReader`

    - #### init2VFR

          void init2VFR(SurfaceGenerator sg,
                        java.io.BufferedReader br)

    - #### recordData

          protected float recordData(float value)

    - #### closeReader

          protected void closeReader()

      Overrides:
        `closeReader` in class `SurfaceFileReader`

    - #### readVolumeParameters

          protected boolean readVolumeParameters(boolean isMapData)

      Specified by:
        `readVolumeParameters` in class `SurfaceReader`

    - #### readVolumeData

          protected boolean readVolumeData(boolean isMapData)

      Specified by:
        `readVolumeData` in class `SurfaceReader`

    - #### readVolumeDataVFR

          protected boolean readVolumeDataVFR(boolean isMapData)

    - #### readVolumetricHeader

          private int readVolumetricHeader()

    - #### readParameters

          protected abstract void readParameters()
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### skipComments

          protected java.lang.String skipComments(boolean allowBlankLines)
                                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readVoxelVector

          protected void readVoxelVector(int voxelVectorIndex)
                                  throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### initializeSurfaceData

          void initializeSurfaceData()

    - #### readSurfaceData

          protected void readSurfaceData(boolean isMapData)
                                  throws java.lang.Exception

      Specified by:
        `readSurfaceData` in class `SurfaceReader`
      Throws:
        `java.lang.Exception`

    - #### readSurfaceDataVFR

          protected void readSurfaceDataVFR(boolean isMapData)
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getPlane

          public float[] getPlane(int x)

      Specified by:
        `getPlane` in interface `VertexDataServer`
      Overrides:
        `getPlane` in class `SurfaceReader`

    - #### getPlaneNCI

          public float[] getPlaneNCI(int x)

      Retrieve raw file planes and pass them to the calculation object for processing into new data. Bob Hanson hansonr@stolaf.edu 6/7/2011
      Parameters:
        `x` -
      Returns:
        plane (for testing)

    - #### getPlaneVFR

          private void getPlaneVFR(float[] plane,
                                   boolean doRecord)

    - #### getValue

          public float getValue(int x,
                                int y,
                                int z,
                                int ptyz)

      Description copied from interface: `VertexDataServer`
      for readers only
      Specified by:
        `getValue` in interface `VertexDataServer`
      Overrides:
        `getValue` in class `SurfaceReader`
      Returns:
        value[x][y][z]

    - #### skipVoxels

          private void skipVoxels(int n)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getVoxelBitSet

          protected javajs.util.BS getVoxelBitSet(int nPoints)
                                           throws java.lang.Exception

      Parameters:
        `nPoints` -
      Returns:
        JVXL bitset
      Throws:
        `java.lang.Exception`

    - #### getNextVoxelValue

          protected float getNextVoxelValue()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### nextVoxel

          protected float nextVoxel()
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### gotoData

          protected void gotoData(int n,
                                  int nPoints)
                           throws java.lang.Exception

      Overrides:
        `gotoData` in class `SurfaceReader`
      Throws:
        `java.lang.Exception`

    - #### skipData

          protected void skipData(int nPoints)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### skipDataVFR

          protected void skipDataVFR(int nPoints)
                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### countData

          private int countData(java.lang.String str)

    - #### checkAtomLine

          protected static boolean checkAtomLine(boolean isXLowToHigh,
                                                 boolean isAngstroms,
                                                 java.lang.String strAtomCount,
                                                 java.lang.String atomLine,
                                                 javajs.util.SB bs)

      checks an atom line for "ANGSTROMS", possibly overriding the data's natural units, BOHR (similar to Gaussian CUBE files).
      Parameters:
        `isXLowToHigh` -
        `isAngstroms` -
        `strAtomCount` -
        `atomLine` -
        `bs` -
      Returns:
        isAngstroms

    - #### getSurfacePointAndFraction

          protected float getSurfacePointAndFraction(float cutoff,
                                                     boolean isCutoffAbsolute,
                                                     float valueA,
                                                     float valueB,
                                                     javajs.util.T3 pointA,
                                                     javajs.util.V3 edgeVector,
                                                     int x,
                                                     int y,
                                                     int z,
                                                     int vA,
                                                     int vB,
                                                     float[] fReturn,
                                                     javajs.util.T3 ptReturn)

      Overrides:
        `getSurfacePointAndFraction` in class `SurfaceReader`

    - #### getSPFv

          protected float getSPFv(float cutoff,
                                  boolean isCutoffAbsolute,
                                  float valueA,
                                  float valueB,
                                  javajs.util.T3 pointA,
                                  javajs.util.V3 edgeVector,
                                  int x,
                                  int y,
                                  int z,
                                  int vA,
                                  int vB,
                                  float[] fReturn,
                                  javajs.util.T3 ptReturn)

    - #### scaleIsosurface

          private void scaleIsosurface(float scale)

    - #### swapXZ

          protected void swapXZ()