Class 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 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 format FORMAT_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 format FORMAT_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 of FORMAT_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

      public boolean load​(InterfaceIOOptions options, ProgressUpdater progress_bar)
      Description copied from class: FileLoader
      Loads data from the set of files or URLs specified by options. Loading is controlled by the specifications of options. If loaded object is of type PersistentObject, 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:
      load in class SurfaceFileLoader
      progress_bar - An optional progress updater. Can be null.
      Returns:
    • loadSurface

      public Mesh3DInt loadSurface​(ProgressUpdater progress_bar, InterfaceIOOptions options) throws java.io.IOException
      Description copied from class: SurfaceFileLoader
      Loads 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:
      loadSurface in class SurfaceFileLoader
      Returns:
      Mesh3DInt mesh representing the surface being loaded
      Throws:
      java.io.IOException
    • loadBinarySurface

      protected Mesh3DInt loadBinarySurface​(ProgressUpdater progress_bar)