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
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 ClassesModifier and TypeClassDescriptionprivate classUsed 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
FieldsModifier and TypeFieldDescriptionprotected static final StringGifti header string (for top of xml header).private intConnectivity index counter.private StringIntent value in theattributes. private intCoordinate 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, ValueStrFields 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_HEADERFields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileSurfaceGiftiXML_WM(String fName, String fDir) Constructs new file object. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclosedTagGifti(String tag, String val) Simple function to write an xml formatted closed tag including the tag value.protected voidclosedTagWithCDATA(String tag, String val) Simple function to write an xml formatted closed tag including the tag value.voidfinalize()Prepares class for cleanup.Converting string value to CDATA format.Returns the FileInfoSurfaceRefXML read from the file.voidopenTag(String tag, Vector<FileXML.XMLAttributes> attr) Writes a closed tag where no value is specified, only attributes.WildMagic.LibGraphics.SceneGraph.TriMeshreadSurfaceXML(String headerFileName, String headerDir) Reads and parses a Gifti XML file.booleanwriteXMLsurface(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, setPBarMethods 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 Details
-
GIFTI_HEADER
Gifti header string (for top of xml header).- See Also:
-
intent
Intent value in theattributes. -
vertexCount
private int vertexCountCoordinate vertex point counter. -
indexCount
private int indexCountConnectivity index counter.
-
-
Constructor Details
-
FileSurfaceGiftiXML_WM
Constructs new file object.- Parameters:
fName- File name.fDir- File directory.
-
-
Method Details
-
finalize
public void finalize()Prepares class for cleanup.- Overrides:
finalizein classFileSurfaceGiftiXML
-
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(String headerFileName, String headerDir) Reads and parses a Gifti XML file.- Parameters:
headerFileName- file name of xml headerheaderDir- directory- Returns:
- kMesh Triangle mesh
- Throws:
IOException- file exception
-
writeXMLsurface
public boolean writeXMLsurface(String fileName, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) throws 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:
IOException- if a file I/O problem is encountered while writing the header
-
openTag
Writes a closed tag where no value is specified, only attributes. -
closedTagGifti
Simple function to write an xml formatted closed tag including the tag value.- Parameters:
tag- tag nameval- tag valuebw- write to use
-
closedTagWithCDATA
Simple function to write an xml formatted closed tag including the tag value.- Parameters:
tag- tag nameval- tag valuebw- write to use
-
getCDATA
Converting string value to CDATA format.- Parameters:
value- string- Returns:
- CDATA section format string
-