astex
Class Map

java.lang.Object
  extended by astex.Symmetry
      extended by astex.Map

public class Map
extends Symmetry

A class for storing an electron density map.


Field Summary
static int ASTEX_ASCII
           
 int[] axis
           
static int CCP4_BINARY
          Various definitions of map types.
 int[] centerGrid
          The center grid point for the current stored map data.
 float[] data
           
 int[] grid
          Size of map grid.
 boolean headerInitialised
          Is header initialised.
 boolean initialiseContours
           
static int INSIGHT_ASCII
           
static int Lines
          Types for the display style.
static int MaximumContourLevels
          Maximum number of contour levels.
 int[] maximumGrid
          The maximum grid point for the current stored map data.
 int[] minimumGrid
          The minimum grid point for the current stored map data.
 int[] ngrid
          The number of grid points along each axis.
static int O_BINARY
           
 Point3d origin
          The position of the first grid point.
 Point3d spacing
          The spacing along each axis.
static int Surface
           
static int SYBYL_ASCII
           
 int volumeColor
          Volume color.
 double volumeMax
          Volume max.
 double volumeMin
          Volume min.
 boolean volumeRender
          Volume render.
 
Fields inherited from class astex.Symmetry
cartesianToFractional, fractionalToCartesian, matricesAssigned, scale, unitCell
 
Method Summary
 void absoluteGridToCartesian(double ix, double iy, double iz, Point3d p)
          Convert grid coordiantes to cartesian.
static int convertBigToLittle(int i)
          Convert from big to little endian byte ordering.
static Map create()
          Public interface to map creation.
static Map createSimpleMap()
          Create a simple map for internal use.
 void ensureMapCapacity(int dataPoints)
          Ensure we have enough room to store the map.
 int getContourColor(int i)
          Get the specified contour color.
 boolean getContourDisplayed(int i)
          Get if the specified contour is displayed.
 double getContourLevel(int i)
          Get the specified contour level.
 int getContourStyle(int i)
          Get the specified contour color.
 float[] getDataArray()
          Get the actual data array.
 java.lang.String getFile()
          Get the filename.
 void getMapBoxDimensions(int[] dims)
          Return the size of map we have loaded.
 int getMapType()
          Get the value of mapType.
 java.lang.String getName()
          Get the map name.
 double getRadius()
          Get the radius of the current map region.
 int getRelativeGridIndex(int gx, int gy, int gz)
          Calculate the relative grid index.
 double getSigma()
          Return the sigma value for the map.
 double getValueAtRelativeGrid(int gx, int gy, int gz)
          Get the map value at relative grid point.
 boolean hasContoursDisplayed()
           
 void lowerRelativeGrid(Point3d p, int[] g)
          Find nearest relative grid point to the specified point.
static void main(java.lang.String[] args)
          Test program.
 void nearestRelativeGrid(Point3d p, int[] g)
          Find nearest relative grid point to the specified point.
 boolean needsReading()
          Does the map need reading.
static void printArray(java.lang.String name, double[] array)
          Print an array.
static void printArray(java.lang.String name, int[] array)
          Print an array.
 void printHeader(java.io.PrintStream printStream)
          Print the header for the map.
 void read()
          Read a map from the specified file object.
 void readHeader()
          Read a map from the specified file object.
 void readRegion()
          Read the determined region from the map.
 void relativeGridToCartesian(double ix, double iy, double iz, Point3d p)
          Convert grid coordiantes to cartesian.
 void setCenter(double x, double y, double z)
          Set the center point of the region we will contour.
 void setCenter(Point3d p)
          Set the center point of the region we will contour.
 void setContourColor(int i, int color)
          Set the specified contour color.
 void setContourDisplayed(int i, boolean displayed)
          Set if the specified contour is displayed.
 void setContourLevel(int i, double level)
          Set the specified contour level.
 void setContourStyle(int i, int style)
          Set the specified contour color.
 void setFile(java.lang.String file)
          Set the filename.
 void setMapType(int v)
          Set the value of mapType.
 void setName(java.lang.String mapName)
          Set the map name.
 void setNeedsReading(boolean flag)
          Set whether the map needs reading.
 void setRadius(double r)
          Set the radis of the region we will contour.
 void setSigma(double s)
          Set the sigma level.
 
Methods inherited from class astex.Symmetry
cnxSpaceGroupNameToNumber, decodeSymmetryToken, generateMatrices, getCartesianToFractionalMatrix, getFractionalToCartesianMatrix, getOriginalSpaceGroupName, getSpaceGroupName, getSpaceGroupName, getSpaceGroupNumber, getSymmetryOperators, getUnitCellCode, prepareSymmetry, readSymmetryOperator, setOriginalSpaceGroupName, setSpaceGroupName, setSpaceGroupNumber, setUnitCell, setUnitCellCode, SQ, transformPoint2
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

volumeRender

public boolean volumeRender
Volume render.


volumeColor

public int volumeColor
Volume color.


volumeMin

public double volumeMin
Volume min.


volumeMax

public double volumeMax
Volume max.


MaximumContourLevels

public static int MaximumContourLevels
Maximum number of contour levels.


Lines

public static final int Lines
Types for the display style.

See Also:
Constant Field Values

Surface

public static final int Surface
See Also:
Constant Field Values

grid

public int[] grid
Size of map grid.


headerInitialised

public boolean headerInitialised
Is header initialised.


CCP4_BINARY

public static final int CCP4_BINARY
Various definitions of map types.

See Also:
Constant Field Values

SYBYL_ASCII

public static final int SYBYL_ASCII
See Also:
Constant Field Values

INSIGHT_ASCII

public static final int INSIGHT_ASCII
See Also:
Constant Field Values

ASTEX_ASCII

public static final int ASTEX_ASCII
See Also:
Constant Field Values

O_BINARY

public static final int O_BINARY
See Also:
Constant Field Values

centerGrid

public int[] centerGrid
The center grid point for the current stored map data.


minimumGrid

public int[] minimumGrid
The minimum grid point for the current stored map data.


maximumGrid

public int[] maximumGrid
The maximum grid point for the current stored map data.


axis

public int[] axis

data

public float[] data

origin

public Point3d origin
The position of the first grid point.


spacing

public Point3d spacing
The spacing along each axis.


ngrid

public int[] ngrid
The number of grid points along each axis.


initialiseContours

public boolean initialiseContours
Method Detail

create

public static Map create()
Public interface to map creation.


createSimpleMap

public static Map createSimpleMap()
Create a simple map for internal use.


getSigma

public double getSigma()
Return the sigma value for the map.


setSigma

public void setSigma(double s)
Set the sigma level.


needsReading

public boolean needsReading()
Does the map need reading.


setNeedsReading

public void setNeedsReading(boolean flag)
Set whether the map needs reading.


getMapType

public int getMapType()
Get the value of mapType.

Returns:
value of mapType.

setMapType

public void setMapType(int v)
Set the value of mapType.

Parameters:
v - Value to assign to mapType.

read

public void read()
Read a map from the specified file object.


convertBigToLittle

public static int convertBigToLittle(int i)
Convert from big to little endian byte ordering.


readHeader

public void readHeader()
Read a map from the specified file object.


printHeader

public void printHeader(java.io.PrintStream printStream)
Print the header for the map.


setCenter

public void setCenter(double x,
                      double y,
                      double z)
Set the center point of the region we will contour.


setCenter

public void setCenter(Point3d p)
Set the center point of the region we will contour.


setRadius

public void setRadius(double r)
Set the radis of the region we will contour.


getRadius

public double getRadius()
Get the radius of the current map region.


setName

public void setName(java.lang.String mapName)
Set the map name.


getName

public java.lang.String getName()
Get the map name.


setFile

public void setFile(java.lang.String file)
Set the filename. We need to know where it came from so we can reread the map when we recenter.


getFile

public java.lang.String getFile()
Get the filename.


ensureMapCapacity

public void ensureMapCapacity(int dataPoints)
Ensure we have enough room to store the map.


readRegion

public void readRegion()
Read the determined region from the map.


relativeGridToCartesian

public void relativeGridToCartesian(double ix,
                                    double iy,
                                    double iz,
                                    Point3d p)
Convert grid coordiantes to cartesian.


getValueAtRelativeGrid

public double getValueAtRelativeGrid(int gx,
                                     int gy,
                                     int gz)
Get the map value at relative grid point.


getRelativeGridIndex

public int getRelativeGridIndex(int gx,
                                int gy,
                                int gz)
Calculate the relative grid index.


getMapBoxDimensions

public void getMapBoxDimensions(int[] dims)
Return the size of map we have loaded.


getDataArray

public float[] getDataArray()
Get the actual data array.


absoluteGridToCartesian

public void absoluteGridToCartesian(double ix,
                                    double iy,
                                    double iz,
                                    Point3d p)
Convert grid coordiantes to cartesian.


nearestRelativeGrid

public void nearestRelativeGrid(Point3d p,
                                int[] g)
Find nearest relative grid point to the specified point.


lowerRelativeGrid

public void lowerRelativeGrid(Point3d p,
                              int[] g)
Find nearest relative grid point to the specified point.


printArray

public static void printArray(java.lang.String name,
                              int[] array)
Print an array.


printArray

public static void printArray(java.lang.String name,
                              double[] array)
Print an array.


setContourLevel

public void setContourLevel(int i,
                            double level)
Set the specified contour level.


setContourColor

public void setContourColor(int i,
                            int color)
Set the specified contour color.


setContourStyle

public void setContourStyle(int i,
                            int style)
Set the specified contour color.


setContourDisplayed

public void setContourDisplayed(int i,
                                boolean displayed)
Set if the specified contour is displayed.


getContourLevel

public double getContourLevel(int i)
Get the specified contour level.


getContourColor

public int getContourColor(int i)
Get the specified contour color.


getContourStyle

public int getContourStyle(int i)
Get the specified contour color.


getContourDisplayed

public boolean getContourDisplayed(int i)
Get if the specified contour is displayed.


hasContoursDisplayed

public boolean hasContoursDisplayed()

main

public static void main(java.lang.String[] args)
Test program.