Class ANZColourMapping
java.lang.Object
com.xinapse.multisliceimage.Analyze.ANZColourMapping
Class to handle Analyze lookup files (colour mapping files).
Lookup files end in the extension ".lkup" or ".LKUP" and consist of a binary format with 256 entries, where each entry is 3-byte triplet of RBG values for that entry.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColourMappinggetColourMapping(String filename) Returns aColourMappingby reading the values from the given file which has the contain a colour lookup table in Analyze format.static voidwriteToFile(ColourMapping colourMapping, String filename) Writes the specifiedColourMappingto an Analyze Colour Lookup file (.lkup).
-
Field Details
-
LOWERCASEEXTENSION
The file extension for Analyze lookup files in lower case form.- See Also:
-
UPPERCASEEXTENSION
The file extension for Analyze lookup files in upper case form. -
NENTRIES
public static final short NENTRIESThe number of entries in an Analyze colour mapping lookup file.- See Also:
-
-
Constructor Details
-
ANZColourMapping
public ANZColourMapping()
-
-
Method Details
-
getColourMapping
public static ColourMapping getColourMapping(String filename) throws ANZException, IOException, FileNotFoundException Returns aColourMappingby reading the values from the given file which has the contain a colour lookup table in Analyze format.- Parameters:
filename- the file name for the lookup, with or without the extension.- Returns:
- the
ColourMappingread from the file. - Throws:
ANZException- if the file format is bad.FileNotFoundException- if the supplied filename cannot be found.IOException- if an I/O error occurs.
-
writeToFile
Writes the specifiedColourMappingto an Analyze Colour Lookup file (.lkup).- Parameters:
colourMapping- theColourMappingto be written.filename- the name of the file to be written.- Throws:
IOException- if theColourMappingcannot be written.
-