/*
- DataType contains all Types:
	* BYTE / UBYTE - Integer 8-bit
	* SHORT / USHORT - Integer 16 bit
	* INT / UINT - Integer 32-bit 
	* FLOAT - Decimal 32-bit
	* DOUBLE - Decimal 64-bit
- Use Unsigned versions (with the 'U' preceeding the type) by default
*/
importClass(Packages.icy.type.DataType)
importClass(Packages.icy.sequence.Sequence)
importClass(Packages.icy.gui.main.MainInterface)

// Get the focused Sequence, raise an exception if none.
seq = getSequence()
if (seq == null) throw "> Please open a sequence first <\n"

type = seq.getDataType_()
println("Current Type: " + type.toLongString())

// convert the sequence and get the result in another one
// the second parameter is for scaling the values.
seqConverted = seq.convertToType(DataType.USHORT, true)

type = seqConverted.getDataType_()
println("New Type: " + type.toLongString())

// Add the sequence in the GUI
gui.addSequence(seqConverted)
