refactoredCPPNeuronMesher
|
OpenGL utility functions for neuron visualization. More...
Functions | |
void | printHelpText () |
Prints the help text to the standard output. More... | |
std::vector< SWCNode > | loadSWC (const std::string &filename) |
Loads a neuron morphology from an SWC or UGX 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 bounding box 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 and loads a neuron morphology file. More... | |
Variables | |
std::string | currentLoadedFile = "." |
Path to the currently loaded neuron file. More... | |
OpenGL utility functions for neuron visualization.
This file contains utility functions for handling OpenGL-related operations in the neuron visualization application. It provides functionality for loading neuron data from files, computing spatial bounds, and managing the visualization state.
Key features:
The implementation handles various neuron file formats and provides utility functions to support the OpenGL rendering pipeline.
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 bounding box and center of a set of nodes.
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 a neuron morphology from an SWC or UGX file.
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 and loads a neuron morphology file.
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 the help text to the standard output.
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.
std::string currentLoadedFile = "." |
Path to the currently loaded neuron file.
Path to the currently loaded SWC file.