Class NeuroMorphoLoader

java.lang.Object
sc.fiji.snt.io.NeuroMorphoLoader
All Implemented Interfaces:
RemoteSWCLoader

public class NeuroMorphoLoader extends Object implements RemoteSWCLoader
Importer for retrieving SWC data from neuromorpho.org.
Author:
Tiago Ferreira
  • Constructor Details

    • NeuroMorphoLoader

      public NeuroMorphoLoader()
  • Method Details

    • isDatabaseAvailable

      public boolean isDatabaseAvailable()
      Checks whether a connection to the NeuroMorpho database can be established.
      Specified by:
      isDatabaseAvailable in interface RemoteSWCLoader
      Returns:
      true, if an HHTP connection could be established, false otherwise
    • getReconstructionURL

      public String getReconstructionURL(String cellId)
      Gets the URL of the SWC file ('CNG version') associated with the specified cell ID.
      Specified by:
      getReconstructionURL in interface RemoteSWCLoader
      Parameters:
      cellId - the ID of the cell to be retrieved
      Returns:
      the reconstruction URL, or null if cell ID was not found or could not be retrieved
    • getReader

      public BufferedReader getReader(String cellId)
      Gets the SWC data ('CNG version') associated with the specified cell ID as a reader
      Specified by:
      getReader in interface RemoteSWCLoader
      Parameters:
      cellId - the ID of the cell to be retrieved
      Returns:
      the character stream containing the data, or null if cell ID was not found or could not be retrieved
    • enableSourceVersion

      public void enableSourceVersion(boolean enable)
      Enables or disables the use of source version URLs.
      Parameters:
      enable - true to enable source version URLs, false otherwise
    • getTree

      public Tree getTree(String cellId)
      Gets the collection of Paths for the specified cell ID
      Specified by:
      getTree in interface RemoteSWCLoader
      Parameters:
      cellId - the ID of the cell to be retrieved
      Returns:
      the data ('CNG version') for the specified cell as a Tree, or null if data could not be retrieved
    • get

      public static Tree get(String cellId) throws IOException
      Convenience method for retrieving SWC data,
      Parameters:
      cellId - the ID of the cell to be retrieved (case-sensitive). It may be the neuron name or its qualified filename. E.g., "cnic_002" or "cnic_002.swc" or "cnic_002.CNG.swc". By default, the standardized (CNG) version is assumed. Examples:
      
                     "cnic_002" -> CNG version of neuron cnic_002 is retrieved
                     "cnic_002.CNG.swc" -> CNG version of neuron cnic_002 is retrieved
                     "cnic_002.swc" -> Source version of neuron cnic_002 is retrieved
                     
      Returns:
      the specified neuron as a Tree object, or null if data could not be retrieved
      Throws:
      IOException - if an error occurs while retrieving the data
    • main

      public static void main(String... args) throws IOException
      Throws:
      IOException