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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ColourMapping
getColourMapping
(String filename) Returns aColourMapping
by reading the values from the given file which has the contain a colour lookup table in Analyze format.static void
writeToFile
(ColourMapping colourMapping, String filename) Writes the specifiedColourMapping
to 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 aColourMapping
by 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
ColourMapping
read 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 specifiedColourMapping
to an Analyze Colour Lookup file (.lkup).- Parameters:
colourMapping
- theColourMapping
to be written.filename
- the name of the file to be written.- Throws:
IOException
- if theColourMapping
cannot be written.
-