Package gov.nih.mipav.model.file
Class FileMicroCat
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileMicroCat
- Author:
- Matthew J. McAuliffe
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileMicroCat(String fileName, String fileDir) MicroCat reader/writer constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.String[]getFileList(String fileDir, String fileName, boolean quiet) Looks in the image directory and returns all images with the same suffix asfileName, sorted in lexicographical order.private StringgetKeyString(String str) DOCUMENT ME!private StringgetValString(String str) DOCUMENT ME!DOCUMENT ME!readImage(boolean quiet) Reads the image as a full 3D dataset.Reads the image.private StringreadLine()Reads lines of the file and strips comments indicated by the : symbol until a nonnull String results or the end of the file is reached.voidsetFileName(String fileName) Sets the file name.static StringTrims the numbers(numerics and some special characters [-, _, .) off the end of a string (file name).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! -
fileName
DOCUMENT ME!
-
-
Constructor Details
-
FileMicroCat
MicroCat 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. -
trimmer
Trims the numbers(numerics and some special characters [-, _, .) off the end of a string (file name).- Parameters:
fName- File name where the last characters are alpha-numerics indicating the image number.- Returns:
- File name without numbers on the end.
-
getFileList
Looks in the image directory and returns all images with the same suffix asfileName, sorted in lexicographical order. Will set the number of images (nImages) for the calling program.- Parameters:
fileDir- Directory to looks for images in.fileName- File name of the image.quiet- DOCUMENT ME!- Returns:
- An array of the image names to be read in or saved as.
-
readHeader
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
IOException- DOCUMENT ME!
-
readImage
Reads the image as a full 3D dataset.- Parameters:
quiet- Flag for printing statements to the screen.- Returns:
- The image.
- Throws:
IOException- DOCUMENT ME!
-
readImage
Reads the image.- Parameters:
quiet- Flag for printing statements to the screen.one- Flag for reading only 1 image of 3D datasetinputName- Ifoneistrue, contains name of image to read.- Returns:
- returns the image
- Throws:
IOException- if there is an error reading the file
-
setFileName
Sets the file name.- Parameters:
fileName- New file name.
-
getKeyString
DOCUMENT ME!- Parameters:
str- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getValString
DOCUMENT ME!- Parameters:
str- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
readLine
Reads lines of the file and strips comments indicated by the : symbol 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
-