refactoredCPPNeuronMesher
|
OpenGL utility functions for neuron visualization. More...
Go to the source code of this file.
Functions | |
std::vector< SWCNode > | loadSWC (const std::string &filename) |
Loads neuron data from an SWC file. More... | |
void | computeBounds (const std::vector< SWCNode > &nodes, double &minX, double &maxX, double &minY, double &maxY, double &minZ, double &maxZ, double ¢erX, double ¢erY, double ¢erZ, double &radius) |
Computes the spatial bounds and center of a set of nodes. More... | |
void | openNeuronFile (std::vector< SWCNode > &nodes, double &minX, double &maxX, double &minY, double &maxY, double &minZ, double &maxZ, double ¢erX, double ¢erY, double ¢erZ, double &radius) |
Opens a file dialog to load a neuron file and updates the view. More... | |
void | printHelpText () |
Prints keyboard and mouse controls to the console. More... | |
Variables | |
std::string | currentLoadedFile |
Path to the currently loaded SWC file. More... | |
OpenGL utility functions for neuron visualization.
This header provides utility functions for OpenGL-based visualization of neuron morphologies, including file I/O, bounds computation, and help text display. These utilities handle the core functionality for loading and preparing neuron data for rendering.
void computeBounds | ( | const std::vector< SWCNode > & | nodes, |
double & | minX, | ||
double & | maxX, | ||
double & | minY, | ||
double & | maxY, | ||
double & | minZ, | ||
double & | maxZ, | ||
double & | centerX, | ||
double & | centerY, | ||
double & | centerZ, | ||
double & | radius | ||
) |
Computes the spatial bounds and center of a set of nodes.
Calculates the axis-aligned bounding box, center point, and maximum radius of a collection of SWC nodes. This is used for camera positioning and scaling.
[in] | nodes | Vector of SWC nodes to analyze |
[out] | minX | Minimum X coordinate of all nodes |
[out] | maxX | Maximum X coordinate of all nodes |
[out] | minY | Minimum Y coordinate of all nodes |
[out] | maxY | Maximum Y coordinate of all nodes |
[out] | minZ | Minimum Z coordinate of all nodes |
[out] | maxZ | Maximum Z coordinate of all nodes |
[out] | centerX | X coordinate of the center point |
[out] | centerY | Y coordinate of the center point |
[out] | centerZ | Z coordinate of the center point |
[out] | radius | Maximum distance from center to any node |
Computes the spatial bounds and center of a set of nodes.
[in] | nodes | Vector of SWC nodes to compute bounds for |
[out] | minX | Minimum X coordinate of the bounding box |
[out] | maxX | Maximum X coordinate of the bounding box |
[out] | minY | Minimum Y coordinate of the bounding box |
[out] | maxY | Maximum Y coordinate of the bounding box |
[out] | minZ | Minimum Z coordinate of the bounding box |
[out] | maxZ | Maximum Z coordinate of the bounding box |
[out] | centerX | X coordinate of the bounding box center |
[out] | centerY | Y coordinate of the bounding box center |
[out] | centerZ | Z coordinate of the bounding box center |
[out] | radius | Radius of the bounding sphere (half the maximum dimension) |
This function calculates the axis-aligned bounding box, center point, and bounding sphere radius for a set of 3D points represented by SWC nodes. The results are returned through reference parameters.
The function also prints the computed bounds and center to the console for debugging purposes.
std::vector<SWCNode> loadSWC | ( | const std::string & | filename | ) |
Loads neuron data from an SWC file.
Parses an SWC (Standardized Waveform Container) file containing neuron morphology data and returns a vector of SWCNode objects.
filename | Path to the SWC file to load |
std::runtime_error | If the file cannot be opened or is malformed |
Loads neuron data from an SWC file.
[in] | filename | Path to the SWC or UGX file to load |
This function loads a neuron morphology from the specified file and returns its nodes as a vector of SWCNode objects. It supports both SWC and UGX file formats and performs preprocessing on the loaded data.
The function:
std::runtime_error | if the file cannot be read or parsed |
void openNeuronFile | ( | std::vector< SWCNode > & | nodes, |
double & | minX, | ||
double & | maxX, | ||
double & | minY, | ||
double & | maxY, | ||
double & | minZ, | ||
double & | maxZ, | ||
double & | centerX, | ||
double & | centerY, | ||
double & | centerZ, | ||
double & | radius | ||
) |
Opens a file dialog to load a neuron file and updates the view.
Displays a file open dialog to the user and loads the selected SWC file. Updates the provided node container and computes the new spatial bounds.
[out] | nodes | Vector to store the loaded nodes |
[out] | minX | Minimum X coordinate (updated after loading) |
[out] | maxX | Maximum X coordinate (updated after loading) |
[out] | minY | Minimum Y coordinate (updated after loading) |
[out] | maxY | Maximum Y coordinate (updated after loading) |
[out] | minZ | Minimum Z coordinate (updated after loading) |
[out] | maxZ | Maximum Z coordinate (updated after loading) |
[out] | centerX | X coordinate of the center (updated after loading) |
[out] | centerY | Y coordinate of the center (updated after loading) |
[out] | centerZ | Z coordinate of the center (updated after loading) |
[out] | radius | Maximum radius from center (updated after loading) |
Opens a file dialog to load a neuron file and updates the view.
[out] | nodes | Vector to store the loaded SWC nodes |
[out] | minX | Minimum X coordinate of the bounding box |
[out] | maxX | Maximum X coordinate of the bounding box |
[out] | minY | Minimum Y coordinate of the bounding box |
[out] | maxY | Maximum Y coordinate of the bounding box |
[out] | minZ | Minimum Z coordinate of the bounding box |
[out] | maxZ | Maximum Z coordinate of the bounding box |
[out] | centerX | X coordinate of the bounding box center |
[out] | centerY | Y coordinate of the bounding box center |
[out] | centerZ | Z coordinate of the bounding box center |
[out] | radius | Radius of the bounding sphere |
This function opens a file dialog for the user to select an SWC or UGX file, loads the selected file, and computes the spatial bounds of the neuron. The function updates both the provided output parameters and the global state.
The function performs the following steps:
void printHelpText | ( | ) |
Prints keyboard and mouse controls to the console.
Displays a help message listing all available keyboard shortcuts and mouse controls for the neuron viewer application.
Prints keyboard and mouse controls to the console.
Displays the application's keyboard and mouse controls to the console. The help text is defined as a global string constant in globals.h.
|
extern |
Path to the currently loaded SWC file.
Stores the full path to the most recently loaded SWC file. Empty string if no file has been loaded yet.
Path to the currently loaded SWC file.