edu.ucla.stat.SOCR.analyses.command.volume
Class Volume_KruskalWallisAnalysis

java.lang.Object
  extended by edu.ucla.stat.SOCR.analyses.command.volume.Volume_KruskalWallisAnalysis

public class Volume_KruskalWallisAnalysis
extends java.lang.Object


Constructor Summary
Volume_KruskalWallisAnalysis()
           
 
Method Summary
static int byteArrayToInt(byte[] b, int offset)
          Convert the byte array to an int starting from the given offset.
static double[] getNextInputDataBuffer(int data_type, int xLength, int flush)
          This method READS IN a bufferSize chunk of all input volumes and returns it as a double[]
static byte[] intToBytes(int v)
          Convert an int to an array of 4 bytes.
static byte[] longToBytes(long v)
          Convert a long to an array of 8 bytes.
static void main(java.lang.String[] args)
           
static void putNextOutputDataBuffer(double pValue, double tStat, boolean writeResultsOrDefaults)
          This method WRITES OUT bufferSize chunks of all output volumes
static void setByteOrder(javax.imageio.stream.MemoryCacheImageInputStream dis, java.lang.String byteorder)
          This method sets the Bite-Order for a MemoryCacheImageInputStream
static void setByteOrder(javax.imageio.stream.MemoryCacheImageOutputStream dos, java.lang.String byteorder)
          This method sets the Bite-Order for a MemoryCacheImageOutputStream
static byte[] shortToBytes(short v)
          Convert a short to an array of 2 bytes.
static void skipNextInputDataBuffer(int data_type, int xLength, boolean flush)
          This method SKIPS in reading data from the bufferSize chunk of all input volumes
static char swapChar(byte[] b, int offset)
          Returns the char resulting from swapping 2 bytes at a specified offset in a byte array.
static double swapDouble(byte[] b, int offset)
          Returns the double resulting from reversing 8 bytes at a specified offset in a byte array.
static double swapDouble(double v)
          Returns the double resulting from reversing 8 bytes of a specified double.
static float swapFloat(byte[] b, int offset)
          Returns the float resulting from reversing 4 bytes at a specified offset in a byte array.
static float swapFloat(float v)
          Returns the float resulting from reversing 4 bytes of a specified float.
static int swapInt(byte[] b, int offset)
          Returns the int resulting from reversing 4 bytes at a specified offset in a byte array.
static int swapInt(int v)
          Returns the int resulting from reversing 4 bytes of a specified int.
static long swapLong(byte[] b, int offset)
          Returns the long resulting from reversing 8 bytes at a specified offset in a byte array.
static long swapLong(long l)
          Returns the long resulting from reversing 8 bytes of a specified long.
static short swapShort(byte[] b, int offset)
          Returns the short resulting from swapping 2 bytes at a specified offset in a byte array.
static short swapShort(short s)
          Returns the short resulting from swapping 2 bytes of a specified short.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Volume_KruskalWallisAnalysis

public Volume_KruskalWallisAnalysis()
Method Detail

main

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

setByteOrder

public static void setByteOrder(javax.imageio.stream.MemoryCacheImageInputStream dis,
                                java.lang.String byteorder)
This method sets the Bite-Order for a MemoryCacheImageInputStream

Parameters:
dis - - MemoryCacheImageInputStream
byteorder - - String representation of byteorder. Options are big (java.nio.ByteOrder.BIG_ENDIAN) little (java.nio.ByteOrder.LITTLE_ENDIAN) system (default system byteorder, java.nio.ByteOrder.nativeOrder())

setByteOrder

public static void setByteOrder(javax.imageio.stream.MemoryCacheImageOutputStream dos,
                                java.lang.String byteorder)
This method sets the Bite-Order for a MemoryCacheImageOutputStream

Parameters:
dis - - MemoryCacheImageOutputStream
byteorder - - String representation of byteorder. Options are big (java.nio.ByteOrder.BIG_ENDIAN) little (java.nio.ByteOrder.LITTLE_ENDIAN) system (default system byteorder, java.nio.ByteOrder.nativeOrder())

getNextInputDataBuffer

public static double[] getNextInputDataBuffer(int data_type,
                                              int xLength,
                                              int flush)
This method READS IN a bufferSize chunk of all input volumes and returns it as a double[]

Parameters:
data_type - - type of the input data
xLength - - number of volumes/subjects in the second-column (file-names) in the Design-matrix
flush - - variable indicating whether the buffer should be flushed as the stream keeps in memory all the data it has read from disk. This will free up memory, but too frequent calls (flush==true) will slow down the process!

putNextOutputDataBuffer

public static void putNextOutputDataBuffer(double pValue,
                                           double tStat,
                                           boolean writeResultsOrDefaults)
This method WRITES OUT bufferSize chunks of all output volumes

Parameters:
result - is a (MultiLinearRegressionResult) Result object
beta - is a beta/regression value outputted by (MultiLinearRegressionResult) Result object
pValue - is a Probability value outputed by (MultiLinearRegressionResult) Result object
tStat - is a T-statistics as outputed by (MultiLinearRegressionResult) Result object
independentLength - - integer value representing the number of Independent X Variables
writeResultsOrDefaults - - true==results; false=Default

skipNextInputDataBuffer

public static void skipNextInputDataBuffer(int data_type,
                                           int xLength,
                                           boolean flush)
This method SKIPS in reading data from the bufferSize chunk of all input volumes

Parameters:
data_type - - type of the input data
xLength - - number of volumes/subjects in the second-column (file-names) in the Design-matrix
flush - - Boolean variable indicating whether the buffer should be flushed as teh ...keeps in memory all the data it has read from disk. This will free up memory, but too frequent calls (flush==true) will slow down the process!

swapShort

public static short swapShort(byte[] b,
                              int offset)
Returns the short resulting from swapping 2 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the short represented by the bytes b[offset+1], b[offset]

swapInt

public static int swapInt(byte[] b,
                          int offset)
Returns the int resulting from reversing 4 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the int represented by the bytes b[offset+3], b[offset+2], ..., b[offset]

swapLong

public static long swapLong(byte[] b,
                            int offset)
Returns the long resulting from reversing 8 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the long represented by the bytes b[offset+7], b[offset+6], ..., b[offset]

swapFloat

public static float swapFloat(byte[] b,
                              int offset)
Returns the float resulting from reversing 4 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the float represented by the bytes b[offset+3], b[offset+2], ..., b[offset]

swapDouble

public static double swapDouble(byte[] b,
                                int offset)
Returns the double resulting from reversing 8 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the double represented by the bytes b[offset+7], b[offset+6], ..., b[offset]

swapChar

public static char swapChar(byte[] b,
                            int offset)
Returns the char resulting from swapping 2 bytes at a specified offset in a byte array.

Parameters:
b - the byte array
offset - the offset of the first byte
Returns:
the char represented by the bytes b[offset+1], b[offset]

swapShort

public static short swapShort(short s)
Returns the short resulting from swapping 2 bytes of a specified short.

Parameters:
s - input value for which byte reversal is desired
Returns:
the value represented by the bytes of s reversed

swapInt

public static int swapInt(int v)
Returns the int resulting from reversing 4 bytes of a specified int.

Parameters:
v - input value for which byte reversal is desired
Returns:
the value represented by the bytes of v reversed

swapLong

public static long swapLong(long l)
Returns the long resulting from reversing 8 bytes of a specified long.

Parameters:
l - input value for which byte reversal is desired
Returns:
the value represented by the bytes of l reversed

swapFloat

public static float swapFloat(float v)
Returns the float resulting from reversing 4 bytes of a specified float.

Parameters:
v - input value for which byte reversal is desired
Returns:
the value represented by the bytes of v reversed

byteArrayToInt

public static int byteArrayToInt(byte[] b,
                                 int offset)
Convert the byte array to an int starting from the given offset.

Parameters:
b - The byte array
offset - The array offset
Returns:
The integer

swapDouble

public static double swapDouble(double v)
Returns the double resulting from reversing 8 bytes of a specified double.

Parameters:
v - input value for which byte reversal is desired
Returns:
the value represented by the bytes of v reversed

shortToBytes

public static byte[] shortToBytes(short v)
Convert a short to an array of 2 bytes.

Parameters:
v - input value
Returns:
the corresponding array of bytes

intToBytes

public static byte[] intToBytes(int v)
Convert an int to an array of 4 bytes.

Parameters:
v - input value
Returns:
the corresponding array of bytes

longToBytes

public static byte[] longToBytes(long v)
Convert a long to an array of 8 bytes.

Parameters:
v - input value
Returns:
the corresponding array of bytes