Package gov.nih.mipav.model.file
Class FileBioRad
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileBioRad
-
public class FileBioRad extends FileBase
Reads BioRaD pic file format.
-
-
Field Summary
Fields Modifier and Type Field Description private intbufferSizeDOCUMENT ME!private byte[]byteBufferDOCUMENT ME!private shortbyteFormatif 1 data is UBYTE, otherwise data is SHORT.private intcolor1LUT1 color status.private intcolor2LUT2 color status.private intdataTypeDOCUMENT ME!private shorteditednot used in disk files.private java.io.FilefileDOCUMENT ME!private java.lang.StringfileDirDOCUMENT ME!private intfileIDalways set to 12345 in BioRad pic files.private FileInfoBioRadfileInfoDOCUMENT ME!private FileInfoBioRadfileInfoCopyprivate java.lang.StringfileNameDOCUMENT ME!private java.lang.StringfNameDOCUMENT ME!private ModelImageimageDOCUMENT ME!private float[]imgBufferDOCUMENT ME!private int[]imgExtentsDOCUMENT ME!private shortlensInteger part of the lens magnification.private floatmagFactormagnification factor.private shortmergedmerged format.private byte[]nameDOCUMENT ME!private intnotesif 0 no notes are present if nonzero 96 byte notes follow after the image data at the end of the file.private shortramp1Maxprivate shortramp1Minprivate shortramp2MaxLUT2 ramp max.private shortramp2MinLUT2 ramp min.private booleanreadAgainDOCUMENT ME!private intxDimDOCUMENT ME!private intyDimDOCUMENT ME!private intzDimDOCUMENT 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 Constructor Description FileBioRad(java.lang.String fileName, java.lang.String fileDir)reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()Prepares this class for cleanup.private voidreadBuffer(int slice, float[] buffer)Reads a slice of data at a time and stores the results in the buffer.ModelImagereadImage(boolean one)reads the BioRad pic file header and data.-
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 Detail
-
bufferSize
private int bufferSize
DOCUMENT ME!
-
byteBuffer
private byte[] byteBuffer
DOCUMENT ME!
-
byteFormat
private short byteFormat
if 1 data is UBYTE, otherwise data is SHORT.
-
color1
private int color1
LUT1 color status.
-
color2
private int color2
LUT2 color status.
-
dataType
private int dataType
DOCUMENT ME!
-
edited
private short edited
not used in disk files.
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileID
private int fileID
always set to 12345 in BioRad pic files.
-
fileInfo
private FileInfoBioRad fileInfo
DOCUMENT ME!
-
fileInfoCopy
private FileInfoBioRad fileInfoCopy
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
fName
private java.lang.String fName
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
imgBuffer
private float[] imgBuffer
DOCUMENT ME!
-
imgExtents
private int[] imgExtents
DOCUMENT ME!
-
lens
private short lens
Integer part of the lens magnification.
-
magFactor
private float magFactor
magnification factor.
-
merged
private short merged
merged format.
-
name
private byte[] name
DOCUMENT ME!
-
notes
private int notes
if 0 no notes are present if nonzero 96 byte notes follow after the image data at the end of the file.
-
ramp1Max
private short ramp1Max
-
ramp1Min
private short ramp1Min
-
ramp2Max
private short ramp2Max
LUT2 ramp max.
-
ramp2Min
private short ramp2Min
LUT2 ramp min.
-
readAgain
private boolean readAgain
DOCUMENT ME!
-
xDim
private int xDim
DOCUMENT ME!
-
yDim
private int yDim
DOCUMENT ME!
-
zDim
private int zDim
DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull.
-
readImage
public ModelImage readImage(boolean one) throws java.io.IOException
reads the BioRad pic file header and data.- Parameters:
one- DOCUMENT ME!- Returns:
- returns a black and white image
- Throws:
java.io.IOException- if there is an error reading the file
-
readBuffer
private void readBuffer(int slice, float[] buffer) throws java.io.IOExceptionReads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- into the filebuffer- buffer where the info is stored- Throws:
java.io.IOException- if there is an error reading the file
-
-