Class FileCOR
The header fields are as follows: imnr0 the first slice number imnr1 the last slice number ptype the data type; 2 for unsigned byte x the x dimension y the y dimension fov the field of view thick the z resolution psiz = a common value for both the x and y resolutions locatn location strtx the minimum x value in meters endx the maximum x value in meters strty the minimum y value in meters endy the maximum y value in meters strtz the minimum z value in meters endz the maximum z value in meters tr T_r te T_e ti T_i xform transform file ras_good_file = 1 if the orientation fields are set, 0 otherwise x_ras x axis orientation y_ras y axis orientation z_ras z axis orientation c_ras volume center coordinates If orientation information is missing, the file is assumed to be coronal with z axis = R to L, y axis = S to I, and z axis = P to A. readInfoImage reads in the header information from the set of FreeSurfer COR volume images and then readImage is called once for each slice that must be read from a COR image file set.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileDOCUMENT ME!private StringDOCUMENT ME!private FileInfoCORDOCUMENT ME!private StringDOCUMENT ME!private booleanDOCUMENT ME!private ModelImageDOCUMENT ME!private int[]DOCUMENT ME!private intDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private ModelLUTDOCUMENT ME!private int[]DOCUMENT ME!Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.Accessor that returns the file info.float[]Accessor that returns the image buffer.Rreturns LUT if defined.private String[]DOCUMENT ME!voidreadImage(int length) This method reads one slice from the file into byteBuffer and then transfers into the float array imgBuffer.voidDOCUMENT ME!private StringreadLine()Reads lines of the file until a nonnull String results or the end of the file is reached.voidsetFileName(String fName) Accessor to set the file name (used for reading COR multiFile).voidwriteImage(ModelImage image, FileWriteOptions options) Writes a COR format type image.Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
Field Details
-
file
DOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileName
DOCUMENT ME! -
foundEOF
private boolean foundEOFDOCUMENT ME! -
image
DOCUMENT ME! -
imageExtents
private int[] imageExtentsDOCUMENT ME! -
imageOrientation
private int imageOrientationDOCUMENT ME! -
imgBuffer
private float[] imgBufferDOCUMENT ME! -
imgResols
private float[] imgResolsDOCUMENT ME! -
LUT
DOCUMENT ME! -
orient
private int[] orientDOCUMENT ME!
-
-
Constructor Details
-
FileCOR
COR reader/writer constructor.- Parameters:
fileName- file namefileDir- file directory- Throws:
IOException- if there is an error making the file
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
getFileInfo
Accessor that returns the file info.- Returns:
- FileInfoBase containing the file info
-
getImageBuffer
public float[] getImageBuffer()Accessor that returns the image buffer.- Returns:
- buffer of image.
-
getModelLUT
Rreturns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
This method reads one slice from the file into byteBuffer and then transfers into the float array imgBuffer.- Parameters:
length- length = imageExtents[0] * imageExtents[1]- Throws:
IOException- if there is an error reading the file
-
readInfoImage
DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
setFileName
Accessor to set the file name (used for reading COR multiFile).- Parameters:
fName- file name of image to read.
-
writeImage
Writes a COR format type image.- Parameters:
image- Image model of data to write.options- options such as starting and ending slices and times- Throws:
IOException- if there is an error writing the file
-
parse
DOCUMENT ME!- Parameters:
inString- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
readLine
Reads lines of the file until a nonnull String results or the end of the file is reached.- Returns:
- the line read in
- Throws:
IOException- if there is an error reading the file
-