Package mgui.io.foreign.caret
Class CaretSurfaceLoader
java.lang.Object
mgui.io.FileLoader
mgui.io.domestic.shapes.InterfaceShapeLoader
mgui.io.domestic.shapes.SurfaceFileLoader
mgui.io.foreign.caret.CaretSurfaceLoader
- All Implemented Interfaces:
InterfaceIO,IconObject
public class CaretSurfaceLoader extends SurfaceFileLoader
Loads a Caret surface from topology and coordinate files, in either binary or ASCII format.
See http://brainmap.wustl.edu/caret/caret_help/file_formats/file_formats.html
TODO: represent versions
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description java.io.FilecoordFilejava.net.URLcoordURLprotected intformatstatic intFORMAT_ASCIIstatic intFORMAT_BINARYFields inherited from class mgui.io.FileLoader
dataFile, dataURL, options -
Constructor Summary
Constructors Constructor Description CaretSurfaceLoader()CaretSurfaceLoader(java.io.File topoFile)Instantiates a new loader with the given topo file, with formatFORMAT_BINARY.CaretSurfaceLoader(java.io.File topoFile, java.io.File coordFile)Instantiates a new loader with the given topo and coord files, with formatFORMAT_BINARY.CaretSurfaceLoader(java.io.File topoFile, java.io.File coordFile, int frmt)Instantiates a new loader with the given topo and coord files, and the specified format (one ofFORMAT_BINARY=0, FORMAT_ASCII=1). -
Method Summary
Modifier and Type Method Description booleanload(InterfaceIOOptions options, ProgressUpdater progress_bar)Loads data from the set of files or URLs specified byoptions.protected Mesh3DIntloadBinarySurface(ProgressUpdater progress_bar)Mesh3DIntloadSurface(ProgressUpdater progress_bar, InterfaceIOOptions options)Loads a single surface from the appropriate source.voidsetCoordFile(java.io.File file)voidsetTopoFile(java.io.File file)Methods inherited from class mgui.io.domestic.shapes.SurfaceFileLoader
getFailureMessage, getObjectIcon, getSuccessMessage, getSupportedObjects, getTitle, loadObject, loadShape, loadSurface, loadSurface, loadSurfacesMethods inherited from class mgui.io.FileLoader
getComplementIOType, getFile, getIOType, getOptions, getProgressMessage, getWriterComplement, load, load, loadObject, loadObject, loadObject, setFile, setOptions, setURL, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
FORMAT_BINARY
public static final int FORMAT_BINARY- See Also:
- Constant Field Values
-
FORMAT_ASCII
public static final int FORMAT_ASCII- See Also:
- Constant Field Values
-
coordFile
public java.io.File coordFile -
coordURL
public java.net.URL coordURL -
format
protected int format
-
-
Constructor Details
-
CaretSurfaceLoader
public CaretSurfaceLoader() -
CaretSurfaceLoader
public CaretSurfaceLoader(java.io.File topoFile)Instantiates a new loader with the given topo file, with formatFORMAT_BINARY. Uses a coord file with the same name.- Parameters:
topoFile-
-
CaretSurfaceLoader
public CaretSurfaceLoader(java.io.File topoFile, java.io.File coordFile)Instantiates a new loader with the given topo and coord files, with formatFORMAT_BINARY.- Parameters:
topoFile-coordFile-
-
CaretSurfaceLoader
public CaretSurfaceLoader(java.io.File topoFile, java.io.File coordFile, int frmt)Instantiates a new loader with the given topo and coord files, and the specified format (one ofFORMAT_BINARY=0, FORMAT_ASCII=1).- Parameters:
topoFile-coordFile-frmt-
-
-
Method Details
-
setTopoFile
public void setTopoFile(java.io.File file) -
setCoordFile
public void setCoordFile(java.io.File file) -
load
Description copied from class:FileLoaderLoads data from the set of files or URLs specified byoptions. Loading is controlled by the specifications ofoptions. If loaded object is of typePersistentObject, this method should also set the file loader and reference URL for the object.This method should also set the URL reference and writer and loader attributes to match this one and its complement.
- Overrides:
loadin classSurfaceFileLoaderprogress_bar- An optional progress updater. Can benull.- Returns:
-
loadSurface
public Mesh3DInt loadSurface(ProgressUpdater progress_bar, InterfaceIOOptions options) throws java.io.IOExceptionDescription copied from class:SurfaceFileLoaderLoads a single surface from the appropriate source. Returns a Mesh3DInt object if load was successful, or null otherwise. This method should also set the file loader and reference URL for the object.- Specified by:
loadSurfacein classSurfaceFileLoader- Returns:
- Mesh3DInt mesh representing the surface being loaded
- Throws:
java.io.IOException
-
loadBinarySurface
-