Class FileSurfaceGiftiXML_WM
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileXML
-
- gov.nih.mipav.model.file.FileSurfaceGiftiXML
-
- gov.nih.mipav.view.renderer.WildMagic.Interface.FileSurfaceGiftiXML_WM
-
public class FileSurfaceGiftiXML_WM extends FileSurfaceGiftiXML
Inherits from FileXML, reads gifti xml files based on the "gifti.xsd" file. Defines specific variables for reading and writing gifti ascii xml files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
FileSurfaceGiftiXML_WM.SurfaceGifitXMLHandler
Used by the XML Parser to parse the Surface.XML header.-
Nested classes/interfaces inherited from class gov.nih.mipav.model.file.FileXML
FileXML.XMLAttributes
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
GIFTI_HEADER
Gifti header string (for top of xml header).private int
indexCount
Connectivity index counter.private java.lang.String
intent
Intent value in theattributes. private int
vertexCount
Coordinate vertex point counter.-
Fields inherited from class gov.nih.mipav.model.file.FileSurfaceGiftiXML
ArrayIndexingOrderValues, CoordinateSystemTransformMatrixStr, DataArrayAttributes, DataArrayStr, DataSpaceValues, DataStr, DataTypeValues, EncodingTypes, EndianValues, GiftiAttributes, GiftiStr, IntentValues, LabelStr, LabelTableStr, MatrixDataStr, MDStr, MetaDataStr, NameStr, TransformedSpaceStr, ValueStr
-
Fields inherited from class gov.nih.mipav.model.file.FileXML
bw, fileDir, fileInfo, fileName, m_kHandler, MIPAV_HEADER, pInterface, TAB, tabLevel, W3C_XML_SCHEMA, XML_ENCODING, XML_HEADER
-
Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE
-
-
Constructor Summary
Constructors Constructor Description FileSurfaceGiftiXML_WM(java.lang.String fName, java.lang.String fDir)
Constructs new file object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closedTagGifti(java.lang.String tag, java.lang.String val)
Simple function to write an xml formatted closed tag including the tag value.protected void
closedTagWithCDATA(java.lang.String tag, java.lang.String val)
Simple function to write an xml formatted closed tag including the tag value.void
finalize()
Prepares class for cleanup.java.lang.String
getCDATA(java.lang.String value)
Converting string value to CDATA format.FileInfoSurfaceGiftiXML_WM
getFileInfo()
Returns the FileInfoSurfaceRefXML read from the file.void
openTag(java.lang.String tag, java.util.Vector<FileXML.XMLAttributes> attr)
Writes a closed tag where no value is specified, only attributes.WildMagic.LibGraphics.SceneGraph.TriMesh
readSurfaceXML(java.lang.String headerFileName, java.lang.String headerDir)
Reads and parses a Gifti XML file.boolean
writeXMLsurface(java.lang.String fileName, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
Writes the XML file information, including the surface out to the given filename and path:-
Methods inherited from class gov.nih.mipav.model.file.FileXML
closedTag, closedTag, closedTag, openTag, readHeader, setPBar
-
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 Detail
-
GIFTI_HEADER
protected static final java.lang.String GIFTI_HEADER
Gifti header string (for top of xml header).- See Also:
- Constant Field Values
-
intent
private java.lang.String intent
Intent value in theattributes.
-
vertexCount
private int vertexCount
Coordinate vertex point counter.
-
indexCount
private int indexCount
Connectivity index counter.
-
-
Method Detail
-
finalize
public void finalize()
Prepares class for cleanup.- Overrides:
finalize
in classFileSurfaceGiftiXML
-
getFileInfo
public FileInfoSurfaceGiftiXML_WM getFileInfo()
Returns the FileInfoSurfaceRefXML read from the file.- Returns:
- File info read from file, or null if it has not been read.
-
readSurfaceXML
public WildMagic.LibGraphics.SceneGraph.TriMesh readSurfaceXML(java.lang.String headerFileName, java.lang.String headerDir)
Reads and parses a Gifti XML file.- Parameters:
headerFileName
- file name of xml headerheaderDir
- directory- Returns:
- kMesh Triangle mesh
- Throws:
java.io.IOException
- file exception
-
writeXMLsurface
public boolean writeXMLsurface(java.lang.String fileName, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) throws java.io.IOException
Writes the XML file information, including the surface out to the given filename and path:- Parameters:
fileName
- file name to write tokMaterial
- surface materialopacity
- surface opacitylevelDetail
- surface level of detail- Returns:
- if header write was successful
- Throws:
java.io.IOException
- if a file I/O problem is encountered while writing the header
-
openTag
public void openTag(java.lang.String tag, java.util.Vector<FileXML.XMLAttributes> attr)
Writes a closed tag where no value is specified, only attributes.
-
closedTagGifti
protected void closedTagGifti(java.lang.String tag, java.lang.String val)
Simple function to write an xml formatted closed tag including the tag value.- Parameters:
bw
- write to usetag
- tag nameval
- tag value
-
closedTagWithCDATA
protected void closedTagWithCDATA(java.lang.String tag, java.lang.String val)
Simple function to write an xml formatted closed tag including the tag value.- Parameters:
bw
- write to usetag
- tag nameval
- tag value
-
getCDATA
public java.lang.String getCDATA(java.lang.String value)
Converting string value to CDATA format.- Parameters:
value
- string- Returns:
- CDATA section format string
-
-