Package mgui.io.standard.gifti
Class GiftiSurfaceWriter
java.lang.Object
mgui.io.FileWriter
mgui.io.domestic.shapes.SurfaceFileWriter
mgui.io.standard.gifti.GiftiSurfaceWriter
- All Implemented Interfaces:
InterfaceIO
,IconObject
public class GiftiSurfaceWriter extends SurfaceFileWriter
Writes a surface to Gifti format. See
http://www.nitrc.org/projects/gifti/ for details and specification.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.io.domestic.shapes.SurfaceFileWriter
number_format
Fields inherited from class mgui.io.FileWriter
dataFile, dataURL, failure_message, options, success_message
-
Constructor Summary
Constructors Constructor Description GiftiSurfaceWriter()
GiftiSurfaceWriter(java.io.File file)
-
Method Summary
Modifier and Type Method Description InterfaceIOType
getLoaderComplement()
Returns theInterfaceIOType
of aFileLoader
which is the complement of this writer; i.e., reads what this writer writes with identical encoding.protected void
writeAsciiArray(java.io.BufferedWriter writer, java.util.ArrayList<MguiNumber> data, int decimals)
Write vertex data as ASCII data to an XML writer; formats todecimals
decimal places.protected void
writeAsciiColours(java.io.BufferedWriter writer, VertexDataColumn column, int decimals, boolean has_alpha)
Write coordinates as ASCII data to an XML writer; formats todecimals
decimal places.protected void
writeAsciiCoords(java.io.BufferedWriter writer, Mesh3D mesh, int decimals)
Write coordinates as ASCII data to an XML writer; formats todecimals
decimal places.protected void
writeAsciiFaces(java.io.BufferedWriter writer, Mesh3D mesh)
Write faces as ASCII data to an XML writer; formats todecimals
decimal places.protected void
writeBinaryArray(java.io.BufferedWriter writer, java.util.ArrayList<MguiNumber> array, boolean compress, java.nio.ByteOrder b_order)
protected void
writeBinaryColours(java.io.BufferedWriter writer, VertexDataColumn column, boolean compress, java.nio.ByteOrder b_order, boolean has_alpha)
protected void
writeBinaryCoords(java.io.BufferedWriter writer, Mesh3D mesh, boolean compress, java.nio.ByteOrder b_order)
Write mesh coordinates as Base64 encoded binary data to an XML writer, in row major order.protected void
writeBinaryFaces(java.io.BufferedWriter writer, Mesh3D mesh, boolean compress, java.nio.ByteOrder b_order)
Write mesh faces as Base64 encoded binary data to an XML writer, in row major order.boolean
writeSurface(Mesh3DInt mesh_int, InterfaceIOOptions options, ProgressUpdater progress_bar)
Writemesh
with thisFileWriter
.protected void
writeVertexColours(java.io.BufferedWriter writer, VertexDataColumn this_column, GiftiOutputOptions _options, boolean has_alpha)
protected void
writeVertexData(java.io.BufferedWriter writer, VertexDataColumn this_column, GiftiOutputOptions _options)
Methods inherited from class mgui.io.domestic.shapes.SurfaceFileWriter
getFailureMessage, getObjectIcon, getSuccessMessage, getSupportedObjects, getTitle, setFormat, write, writeSurface, writeSurfaces, writeSurfaces
Methods inherited from class mgui.io.FileWriter
getComplementIOType, getFile, getIOType, getOptions, getProgressMessage, getURL, setFile, setOptions, setURL, toString, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
GiftiSurfaceWriter
public GiftiSurfaceWriter() -
GiftiSurfaceWriter
public GiftiSurfaceWriter(java.io.File file)
-
-
Method Details
-
writeSurface
public boolean writeSurface(Mesh3DInt mesh_int, InterfaceIOOptions options, ProgressUpdater progress_bar)Description copied from class:SurfaceFileWriter
Writemesh
with thisFileWriter
.- Specified by:
writeSurface
in classSurfaceFileWriter
- Returns:
-
writeVertexData
protected void writeVertexData(java.io.BufferedWriter writer, VertexDataColumn this_column, GiftiOutputOptions _options) throws java.io.IOException- Throws:
java.io.IOException
-
writeVertexColours
protected void writeVertexColours(java.io.BufferedWriter writer, VertexDataColumn this_column, GiftiOutputOptions _options, boolean has_alpha) throws java.io.IOException- Throws:
java.io.IOException
-
writeBinaryCoords
protected void writeBinaryCoords(java.io.BufferedWriter writer, Mesh3D mesh, boolean compress, java.nio.ByteOrder b_order) throws java.io.IOExceptionWrite mesh coordinates as Base64 encoded binary data to an XML writer, in row major order.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
writeBinaryArray
protected void writeBinaryArray(java.io.BufferedWriter writer, java.util.ArrayList<MguiNumber> array, boolean compress, java.nio.ByteOrder b_order) throws java.io.IOException- Throws:
java.io.IOException
-
writeBinaryColours
protected void writeBinaryColours(java.io.BufferedWriter writer, VertexDataColumn column, boolean compress, java.nio.ByteOrder b_order, boolean has_alpha) throws java.io.IOException- Throws:
java.io.IOException
-
writeAsciiArray
protected void writeAsciiArray(java.io.BufferedWriter writer, java.util.ArrayList<MguiNumber> data, int decimals) throws java.io.IOExceptionWrite vertex data as ASCII data to an XML writer; formats todecimals
decimal places. Wraps line when it exceeds 76 characters.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
writeBinaryFaces
protected void writeBinaryFaces(java.io.BufferedWriter writer, Mesh3D mesh, boolean compress, java.nio.ByteOrder b_order) throws java.io.IOExceptionWrite mesh faces as Base64 encoded binary data to an XML writer, in row major order.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
writeAsciiCoords
protected void writeAsciiCoords(java.io.BufferedWriter writer, Mesh3D mesh, int decimals) throws java.io.IOExceptionWrite coordinates as ASCII data to an XML writer; formats todecimals
decimal places. Wraps line when it exceeds 76 characters.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
writeAsciiColours
protected void writeAsciiColours(java.io.BufferedWriter writer, VertexDataColumn column, int decimals, boolean has_alpha) throws java.io.IOExceptionWrite coordinates as ASCII data to an XML writer; formats todecimals
decimal places. Wraps line when it exceeds 76 characters.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
writeAsciiFaces
protected void writeAsciiFaces(java.io.BufferedWriter writer, Mesh3D mesh) throws java.io.IOExceptionWrite faces as ASCII data to an XML writer; formats todecimals
decimal places. Wraps line when it exceeds 76 characters.- Parameters:
mesh
-encoding
-- Throws:
java.io.IOException
-
getLoaderComplement
Description copied from class:FileWriter
Returns theInterfaceIOType
of aFileLoader
which is the complement of this writer; i.e., reads what this writer writes with identical encoding. Transfer between loader and writer should be lossless.Returns
null
if no complement is defined.- Overrides:
getLoaderComplement
in classFileWriter
- Returns:
-